Redmine Migration From Trac 0.12

This article will demostrate a near perfect redmine migration from trac 0.12 step by step.

1
2
3
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby
* /etc/httpd/conf.d/redmine.conf
1
2
3
4
5
6
7
8
   <VirtualHost *:80>
      ServerName redmine.miiicasa.com 
      DocumentRoot /home/m/share/htdocs/redmine/public
      <Directory /home/m/share/htdocs/redmine/public>
         AllowOverride all    
         Options -MultiViews    
      </Directory>
   </VirtualHost>
  • Get Redmine source from miiiCasa github repo (bundler integrated and migrate_from_trac.rake modified)
  • install bundler and bundle install
1
2
sudo gem install bundler
bundle install
  • Setup mysql database and user
1
2
3
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
  • cp config/database.yml.example config/database.yml and modify it based on previous settings.
  • cp config/configure.yml.example config/configure.yml and modify it.
  • Generate the session store
1
RAILS_ENV=production bundle exec rake generate_session_store
  • Migrate the database models
1
RAILS_ENV=production bundle exec rake db:migrate
  • Load default data
1
RAILS_ENV=production bundle exec rake redmine:load_default_data
  • Migrate from trac
    • install sqlite3-ruby
1
sudo gem install sqlite3-ruby
  • migrate from trac
1
2
3
4
5
6
7
8
RAILS_ENV=production bundle exec rake redmine:migrate_from_trac
...
Are you sure you want to continue ? [y/N] y                     

Trac directory []: /var/www/trac/miiicasa
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite3]:
Trac database encoding [UTF-8]: 
Target project identifier []: miiicasa
1
2
3
4
5
6
$ RAILS_ENV=production ./script/console
..
for u in User.all
  u.admin = true
  u.save
end
  • Login and setup scm path
  • Load git repo from script (prevent timeout)
1
$ ruby script/runner "Repository.fetch_changesets" -e production

This action could take a very long time (maybe 1 day) and it got no progress bar nor any output. If you want to check where it went, try:

1
ps axww | grep git | grep -v grep

You’ll see it’s parsing git log.

Comments