-
Notifications
You must be signed in to change notification settings - Fork 260
Upgrading to 3.4.x from 3.3.x
- This guide assumes you are upgrading a BrowserCMS project to 3.4.x from 3.3.x. For other versions, see Upgrading BrowserCMS
- 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 (i.e. rake rails:update
), 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.
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.
This issue may occur when running the rake db:migrate
task, due to 'old' seed data that appears in migrations. The easiest solution is:
- Delete all db/migrate/_browsercms.rb files
- Run
rake cms:install:migrations
to regenerate up to date versions.
You may need to alter the timestamps of your custom CMS migrations to fix their order.
Again, while running rake db:migrate
. Review your project's migrations for its custom blocks, and change any statements that look like this:
# Old
ContentType.create!(:name => "Product", :group_name => "Product")
# to This
Cms::ContentType.create!(:name => "Product", :group_name => "Product")