Skip to content
Wim Vinckier edited this page Jan 15, 2013 · 2 revisions

Migrating trac from sf.net

Recently sf.net announced they would retire their hosted apps so I wondered if I could import the backup into a virtual machine. These are my notes while testing. They probably aren't complete but it should be a good lead.

I wrote the documentation while testing the situation on ddclient so replace ddclient with the name of your project.

This document is currently available as moving trac on github.

Preparing the virtual machine

I'm using debian 6 from thoughtpolice as the startimage. I change the default passwords and add my public ssh-key to make remote access much easier. After these step, update the system:

apt-get update
apt-get upgrade

Now we have a system where we can install trac.

Installing trac

This part is ratter easy:

apt-get install trac mysql-client apache2 python-mysqldb mysql-server

The version used by sf.net is 0.11.2.1 while debian runs 0.11.7 which makes it perfect usable as a backup. We prefer to use mysql because sf.net uses mysql to.

Creating the backup

Go to your project and from the project admin choose features and enabled backups. Choose the hosted apps and create a backup from the files and the database. I used the gzip version but that doesn't matter as long as you don't forget to unzip it.

If you also want to migrate your subversion away from sf.net or you want the links to be working, you can create a sync using "using rsync for backups"-instruction from sourceforge.

Preparing the database

Use mysql as root with the previously addes password to create a new database:

create database trac_ddclient;
CREATE USER 'trac'@'localhost' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON trac_ddclient.* TO 'trac'@'localhost'; 

CREATE USER 'trac'@'localhost' IDENTIFIED BY 'Co3KDNAAqtee';

Restore the backup:

zcat ddclient_trac_mysqldump.sql.gz |  \
mysql -pmypassword -utrac trac_ddclient

Restoring the trac environment

We simply have to put the files back where they belong

tar -xvzf -C /opt ddclient_trac_files.tar.gz

After restoring change the database configuration in trac.ini to mysql://trac@localhost/trac_ddclient. If you synchronized your svn repository, you can also change the repository configuration in trac.ini to point to your backup. Don't forget to run trac-admin resync after you changed this setting.

Test the result

tracd --port 8000 /opt/ddclient

Use your browser to go to http://localhost:80000/

Configure apache

to be done

Correcting rights

to be done