Table of Contents
These are the steps to migrate a Subversion and Trac environment between two machines running on different Linux distributions. For svnsync, it is required to have both svn server versions ≥ 1.4.0.
- Create a repository on the new server:
$ svnadmin create /var/spool/raid/svn_repo
- Make sure the commit hooks are configured to allow our
svnsyncuser to do anything it wants:
$ echo "#!/bin/sh" > /var/spool/raid/svn_repo/hooks/pre-revprop-change $ chmod +x /var/spool/raid/svn_repo/hooks/pre-revprop-change
- Set destination repo to version 0 (svnsync —init dest_repo src_repo):
$ svnsync --username=svnsync init file:///var/spool/raid/svn_repo/ svn+ssh://firstname.lastname@example.org/home/repos/projects/ Copied properties for revision 0.
- Sync the repositories:
$ svnsync --username=svnsync --non-interactive sync file:///var/spool/raid/svn_repo/ Committed revision 1. Copied properties for revision 1. Committed revision 2. Copied properties for revision 2. Committed revision 3. Copied properties for revision 3. Committed revision 4. Copied properties for revision 4. Committed revision 5. Copied properties for revision 5. Committed revision 6. Copied properties for revision 6. Committed revision 7. .....
Note that it's possible to replicate just a subtree of your source repository.
- Install a Trac project on the destination machine.
- On the source machine, backup the environment following the steps described in TracBackup.
- Modify the repository location, if different on the destination machine, through the web administration page (
/admin/versioncontrol/repository), using TracAdmin or by directly editing trac.ini.
- Copy the environment backup to the destination machine.
$ scp $backup_dir email@example.com:/root/
- Copy the environment to the location of the project created in the first step.
- For a database other than SQLite, restore the database from the dump file created by
- Upgrade the environment if an upgrade is indicated to be necessary. See TracUpgrade for more information.
- Restart tracd or your web server.