-
Notifications
You must be signed in to change notification settings - Fork 259
Upgrading a BrowserCMS project
- This guide assumes you are upgrading a BrowserCMS project to 3.4.x from 3.3.x. (See a list of instructions for older versions.
- It assumes the project is currently running on Rails 3.0 and will be updated to Rails 3.1 as part of this process.
- The project being managed using Git (or other SCM)
Ensure you have the correct version:
$ bcms -v
Should return BrowserCMS 3.4.0
or some other 3.4.x version.
In your project, run the following script from the command line:
$ bcms upgrade # Type 'a' when prompted
During the update, a rake task to upgrade rails will be run, and you will be prompted to overwrite some files. Enter 'a' when prompted to overwrite all the files. This will update the project to use the new version of the gem, add new migrations and seed data as needed. Then do the following:
- Review the following files and ensure the specified lines appear (use Git to selectively discard the changes):
config/environment/development.rb => Should contain:
SITE_DOMAIN=localhost:3000
config/environment/production.rb => Should contain:
SITE_DOMAIN=http://your-site-domain.com
config.action_controller.page_cache_directory = File.join(Rails.root, 'public', 'cache')
config.action_mailer.smtp_settings = {:address => 'mail.yourmailserver.com', :domain => "#{SITE_DOMAIN}"}
config/environment/test.rb => Should contain:
SITE_DOMAIN=localhost:3000
- Run
git checkout config/routes.rb
to revert this file - Run
rake db:migrate
to migrate the database - Edit the db/seeds.rb to remove all the BrowserCMS specific seed data calls. It will be duplicative with what is contained in the db/browsercms.seeds.rb file.
If you need instructions for how to upgrade earlier versions of BrowserCMS, see the following list:
- Upgrading to 3.3.3 from 3.3.x
- Upgrading to 3.3.x from 3.1.x (aka Rails 2 to Rails 3)
- Upgrading to 3.1.5 (from 3.1.x)
- Upgrading to 3.1.x (from earlier versions)
As part of this upgrade, a new migration will be generated to 'correct' any custom blocks in your project. Ensure you review db/migrate/*_update_version_id_columns.rb
to ensure it's correcting the right tables.