Blog » Upgraded to Silverstripe 2.4.0

Upgraded to Silverstripe 2.4.0

This website has just been upgraded to Silverstripe 2.4.0, which adds (amongst other things) hierarchical URLs. While the effort has been worth it, this upgrade was more problematic than previous ones due to version 2.4 including a cleanup of the API, and some rather major changes. Fortunately I now have a test server that I can do trial runs on before making changes to the live website. Here's a quick rundown of the problems that I experienced, and the solutions.

With the first test upgrade, a series of warnings about extraStatics() being deprectated, followed by an error saying: [User Warning] Cookie 'bypassStaticCache' can't be set. After a quick look for this error on the Silverstripe forums, I discovered that a set of modules had to be upgraded. Thus, the following modules were upgraded to either the latest public release (if that release supported Silverstripe 2.4), or the latest daily snapshot:

  • auth_openid,
  • blog,
  • forum,
  • gallery,
  • mollom,
  • newsletter,
  • securefiles,
  • spamprotection, and
  • userforms.

With these modules upgraded, the rebuild (/dev/build) succeeded. However, new problems arose due to some module upgrades being incompatible with older versions. In particular, the forum module had lost all posts, and some of its links (e.g., the login link) were broken. The broken links were due to the templates being out of date, so I took the new templates, and fixed up my theme's CSS files so that the forum looked good again. Next, the forum documentation mentioned a migration task (/dev/tasks/ForumMigrationTask). After executing the migration task, all of the forum posts reappeared.

The next issue was with the userforms; the form itself had disappeared, leaving only the submit button. Here too, a migration script was available. Unfortunately it didn't work. It complained about cartain database tables starting with _obsolete were missing. Looking in the database (by executing 'SHOW TABLES;' in MySQL), I noticed that the tables in question had been renamed with all lowercase, and the script was expecting certain letters to be capitalized. So, the script was updated to match the database, and the script executed a bit further. Nevertheless, there was still an error: "Unknown column 'CustomParameter' in 'field list'." Another search on the forums revealed that this was due to a residual obsolete column still being present. Executing the following fixed it:

ALTER TABLE `EditableFormField` DROP `CustomParameter`;

With this done, the migration script completed successfully, and after republishing the forms, the forms worked correctly again.

The last remaining issue was very minor; the blog widgets had disappeared. These were simply reinserted using the Silverstripe CMS pages. Unfortunately the Tag Cloud and Archive widgets are still not working. These are issues that I still need to look in to.

Once the website was working properly on my test server, the upgrade procedure was repeated on this live site. Interestingly, data (e.g., form submissions) that had disappeared on the test site remained intact in the actual upgrade. This is probably due to various steps that I took back then being skipped in the actual upgrade, because I knew by then that they would not work.

So far Silverstripe 2.4.0 is performing well. Small issues that I had previously are now gone, it feels a little faster (although this may be pure imagination), and the hierarchical URLs are a welcome improvement. Don't worry, the old URLs are automatically redirected to the new ones so existing bookmarks should still work.



Blog » Upgraded to Silverstripe 2.4.0

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments


Blog » Upgraded to Silverstripe 2.4.0