You are viewing the PKP Support Forum | PKP Home Wiki

NotificationStatusDAO data migration? upgrading OJS 2.2.3

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

NotificationStatusDAO data migration? upgrading OJS 2.2.3

Postby makouvlei » Tue Sep 18, 2012 12:30 am

We're in the process of upgrading an installation from OJS 2.2.3 to 2.3.7. It seems between 2.2.3 and 2.3.0 the notification_status table and classes\journal\NotificationStatusDAO became obsolete and was replaced by the notification_settings and notifications tables and lib\pkp\classes\notification (although classes\journal\NotificationStatusDAO also still exists in a fresh ojs2.3.7 download..?)

However I can't find any sort of migration procedure that would've taken place during the upgrade of the data in the notification_status table, so in fact while notification_status is dropped during the database upgrade (dbscripts\xml\upgrade\2.3.0_update.xml), the notification_settings and notifications tables remain empty.

I could script a migration of the data but seeing as notification_settings and notifications currently contain no data to use as example, it would be great if you could provide some pointers so this is done correctly.

J van Tonder
Posts: 16
Joined: Wed Nov 17, 2010 2:56 am

Re: NotificationStatusDAO data migration? upgrading OJS 2.2.

Postby mcrider » Fri Sep 21, 2012 2:10 pm

Hi Jannie,

Thanks for spotting this, its actually a very old bug; And I'm not sure if its actually a bug (i.e. an oversight on my part when I implemented this) or a conscious decision. The notification_status table was only used for users to opt-in to emails about new issues being published, and this notification is automatically implemented for all users when the new notification structures were put in place (at OJS 2.3.0). However, the new issue notification will only appear in the notification feed (over the web) and not automatically be emailed to the user.

If you want to add all the users in the notification_status table to the notification_settings table and have them automatically receive emails about new issues, you can put your old notification_settings table into your upgraded database and run this bit of SQL to migrate the users over to the new structure:
Code: Select all
INSERT INTO `notification_settings` (`setting_name`, `setting_value`, `user_id`, `product`, `context`)
SELECT 'email', '268435477', user_id, 'ojs2', journal_id FROM notification_status;

Also, the NotificationStatusDAO class can be completely removed from OJS, its dead code and should have been taken out a while ago.

Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: NotificationStatusDAO data migration? upgrading OJS 2.2.

Postby makouvlei » Tue Sep 25, 2012 2:43 pm

Thanks, Matt, much appreciated.
Posts: 16
Joined: Wed Nov 17, 2010 2:56 am

Return to OJS Technical Support

Who is online

Users browsing this forum: Alexa [Bot] and 3 guests