Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Upgrading to SilverStripe 3.0

Simon is a developer at PocketRent, a SaaS using SilverStripe.

Comments 1

by Simon Welsh

Posted 22 March 2012

Read post

Simon is a developer at PocketRent, a SaaS using SilverStripe. I'm currently working towards completing my Honours degree in Computer Science and Maths. I'm simon_w on both Twitter and the #silverstripe IRC channel.

Since beginning to use SilverStripe back when 2.2 was about to be released to the world, the most complex upgrade path was between 2.3 and 2.4, when, rather than simple replacing the Sapphire and CMS folders with the newer version (as well as updating any modules, of course), the jsparty folder had to be deleted.

Four and a half years after starting with SilverStripe, the release that is looking to have the most involved upgrade path is being prepared in SilverStripe 3.0. To help ensure the upgrade process goes as smoothly as possible when 3.0 is released in its full glory, beta 1 is available to allow people to test drive the new Framework and CMS, as well as testing the upgrade process.

Due to the magnitude of changes to both the CMS and underlying Framework in 3.0, updating anything but the most basic of sites to the beta version is likely to require some fiddling. Always run the upgrade in a testing environment and always backup your database and files before running the upgrade.

You can read about many of the benefits of upgrading to the 3.0 beta; the new Framework, grid field and the new ORM in blog posts, the dev channel and in the documentation.

Should I upgrade to beta?

These new features are definitely worth using, but many are wondering whether to upgrade to beta. The answer to that question depends on how comfortable you (and your clients) are using beta software.

Due to the changes in the CMS, any module that adds pages (like the blog module), adds functionality to every page (like googlesitemaps) or has its own interface in the CMS (like userforms) will not work until they're updated. Some modules will continue to work fine without any changes required, though if your site relies on many modules that haven't been upgraded or can't be easily replaced (e.g. DataObjectManager can be replaced by GridField, and Uploadify can be replaced by the new UploadField), then you shouldn't upgrade to 3.0.

On the other hand, if you want to make the modules ready for 3.0, by all means upgrade and submit patches to the author of the module.

If you have a large, existing code base you need to decide if it's worth upgrading to 3.0 at all. For some sites, this will take a reasonable amount of time, especially if it relies on some of the more advanced features of SilverStripe. If you do decide to upgrade such a code base, I suggest waiting until the stable release of 3.0.0, just so a change between now and the stable release doesn't break your entire site again.

However, upgrading a branch of your site to 3.0, and then keeping up with changes as they happen, will provide a lot of useful testing of 3.0 and should, hopefully, discover lots of minor bugs or things that just don't seem to work logically.

If your code base is simple enough, it is also worth considering if it'll be easy to just rewrite your code to take advantage of the new 3.0 features rather than upgrade. As the database structure remains the same, just create your classes with the same names, database fields and relationships, then write your functions again.

Running the upgrade

Running the upgrade is rather similar to upgrades in the past. First, backup your database and code. Now simply replace the Sapphire and CMS folder with the newer versions. If you are planning on contributing fixes back, I recommend using the master branch from the git repositories. Otherwise, use the folders in the beta1 tar ball. Then run/dev/build. If all goes well, your site should now be using 3.0.

This process will be enough in only a very small number of cases. The upgrade documentation lists some things that have changed that you may need to update on your site. Of particular interest are the changes to form fields' constructors, features that have been extracted out into modules and the deprecated/removed classes.

If you do decide to upgrade to the 3.0 beta, core developers want to hear how it went! We invite you to record what you had to do, and let them know.