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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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: Bing [Bot], Google [Bot] and 2 guests