One of our biggest webdesign and development projects, an online gaming community named X-Power.be, is in need for a total makeover. I think it’s more then one year ago since we planned to make a new version: 4.0. We started developing in Symfony 1.0.x, but in the meanwhile Symfony 1.1 and 1.2 came out. Time to start planning some upgrade tasks!
I’ll give you a (hopefull) quick overview of my upgrade steps. I will perform the upgrade from 1.0.18 to 1.1.4. Later on I will make a second post for upgrading the 1.1 to 1.2.
Let’s start the process:
- Follow the nice upgrade tutorial on the Symfony website. I could copy the steps in this blog post, but we developers want to keep everything central
Just make a few changes to a couple of files, and launch the upgrade task. It’s very easy! Below those steps you can read some additional information. - The upgrade process is completed. Don’t forget to read the output from the upgrade task, since you have to delete some unneeded files to keep everything clean.
- Trying to display the homepage, the following error came up (thanks to sfGuardPlugin) :
Fatal error: Call to undefined method sfRouting::getinstance()
The sfGuardPlugin was still the old version, so we need to upgrade this as well:
symfony1.1 plugin:upgrade sfGuardPlugin
Again something wrong happened :
Plugin “sfGuardPlugin” installation failed: No valid packages found
The plugin:upgrade task tries to install the latest version, which is one for Symfony 1.2 projects. So we have to tell the plugin:upgrade task which version it has to take :
symfony1.1 plugin:upgrade sfGuardPlugin –release=2.2.0
Version 2.2.0 is the latest version for 1.1 projects. You can look it up under the “All releases” tab on the sfGuardPlugin page.
Retrying to display the homepage, the following error came up (this time thanks to the sfSupportPlugin) :
Fatal error: Call to undefined method sfRouting::getinstance() in /PROJECT_PATH/plugins/sfSupportPlugin/config/config.php on line 5
Same problem as the sfGuardPlugin: old version using old & deprecated core functions. Problem with the sfSupportPlugin: no version available for Symfony 1.1 projects, so we need to alter the plugin ourself. Change the content of the plugins config/config.php into :
if (in_array(‘sfSupport’, sfConfig::get(‘sf_enabled_modules’, array())))
{
$this->dispatcher->connect(‘routing.load_configuration’, array(‘sfSupportRouting’, ‘listenToRoutingLoadConfigurationEvent’));
}
If you have more old plugins, you have to redo the last step for every plugin. After this you should be able to see the homepage.
Tip: get an error after authenticating?
Fatal error: Class ‘BaseSfGuardUserPeer’ not found
Rebuild your model, do a cache:clear and it should be fixed!
In a couple of days I will write a new post about the upgrade process to Symfony 1.2.