Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created September 8, 2009 22:41
Show Gist options
  • Save edavis10/183286 to your computer and use it in GitHub Desktop.
Save edavis10/183286 to your computer and use it in GitHub Desktop.
Moving and upgrading a Redmine database
1. Create a text backup of your data form the live server. This will ask for a password.
mysqldump -u your_user -p your_redmine_database > backup_sql_file.sql
2. Transfer the backup_sql_file.sql to your new server.
3. Once there, drop the existing database on the new server.
!!!! Triple check this is on the new server and not your live one!!!!
mysql -u your_user -p your_redmine_database
mysql> DROP database your_redmine_database;
mysql> CREATE database your_redmine_database;
mysql> quit
4. Now import your database to the empty database on the new server.
mysql -u your_user -p your_redmine_database < /path/to/backup_sql_file.sql
5. Now it's time to do the migrations to convert your data backup to the latest version.
cd /path/to/redmine
6. Run the Redmine core migrations
rake db:migrate RAILS_ENV=production
7. Run any Redmine plugin migrations
rake db:migrate_plugins RAILS_ENV=production
6. Then restart Redmine's web server and you should be good to go.
(Any of the MySQL commands can be carried out via a GUI if you have one.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment