Actually it’s a trivial task that has been already discussed and described in all glory details. Anyway, just for a record, I’ll duplicate that information here.
- Dump the content of your current SVN repository.
svnadmin dump /var/svn > /tmp/svn_repository.dump
- Transfer it to a new server.
- Create a new repository and load the dump into.
svnadmin create /var/svn
svnadmin load /var/svn < /tmp/svn_repository.dump
Just that simple.
In this post I’d like to describe the process of upgrading Redmine from 0.8 release to a new stable version (1.1) acompanied by a migration to a new host. Before we begin please visit the official upgrade guide since it lists all the details that would suffice most of the users.
- Save the content of your DB, I’m using MySQL, and the Redmine’s uploads.
# mysqldump --add-drop-database --add-drop-table -C -e redmine -uredmine -p > /tmp/redmine.sql
# tar -cpjf /tmp/redmine_files.tar.bz2 /var/www/redmine/files/
- Prepare a new server and install the missing required software. In my case I had to install the following packages:
# apt-get install subversion rubygems rake librack-ruby librack-ruby1.8 libmysql-ruby1.8
- cd to a directory where you’d like Redmine to be installed, I used /var/www, and check out from the SVN repository as it’s a recommended way.
svn co http://redmine.rubyforge.org/svn/branches/1.1-stable redmine-1.1
- Due to the requirements imposed by Redmine I had to install several gems manually:
Create a new database and copy previously saved database’s sql dump and the upload directory from the old server.
gem install rack -v=1.0.1
gem install rails -v=2.3.5
gem install -v=0.4.2 i18n
mysql -uroot -p
mysql> create database redmine;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'redmine_password';
# mysql -b redmine -uredmine -p < /tmp/redmine.sql
Copy config/database.yml and config/email.yml from the old server.
Change into Redmine's directory and run the upgrade.
# cd /var/www/redmine-1.1
# rake generate_session_store
# rake db:migrate RAILS_ENV=production
# rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production
# rake db:migrate_plugins RAILS_ENV=production
Finally I installed and configured Phusion_Passenger as described in my other post.
Don't forget to set DocumentRoot and PassengerAppRoot to corerctly point to the Redmin's installation. In my case it was:
As the last step, change the owner of the Redmine's files to belong to the Apache's user (in Ubuntu it's www-data).
# chown -R www-data:www-data /var/www/redmine-1.1
As soon as I switched to Nginx yesterday the positive outcome wasn’t long in coming.
As you could see I was able to save 200MB of precious RAM just swapping from Apache and mod_fcgid to Nginx and php-fpm. Do happy savings ;-)
If you missed the chance to participate in linux.conf.au this year or, like me, you’re thousands miles away from Down Under then this link http://linuxconfau.blip.tv/ would help you stay tuned and feel the pulse of Linux kernel development. Another options is to subscribe to a podcast using iTunes. Choose one that suits you best. Enjoy watching the cool stuff.