= Migration [[TracGuideToc]] I had 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. == Subversion Replication * Create a repository on the new server: {{{#!sh $ svnadmin create /var/spool/raid/svn_repo }}} * Make sure the commit hooks are configured to allow our 'svnsync' user to do anything it wants: {{{#!sh $ 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 --opts dest_repo src_repo'''): {{{#!sh $ svnsync --username svnsync init file:///var/spool/raid/svn_repo/ svn+ssh://root@192.168.11.128/home/repos/projects/ Copied properties for revision 0. }}} * Sync the repositories: {{{#!sh $ 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. ..... }}} == Trac Migration * Install a Trac project on the destination machine. * On the source machine, backup the environment using `trac-admin $env hotcopy $backup_dir`, as described on the TracBackup page. * Modify the repository location, if different on the destination machine, through the web administration page (`/admin/versioncontrol/repository`), using [TracRepositoryAdmin#ReposDatabase TracAdmin] or by directly editing trac.ini. * Copy the environment backup to the destination machine. {{{#!sh $ scp $backup_dir root@192.168.11.125:/root/ }}} * Copy the environment to the location of the project created in the first step. * Upgrade the environment if an upgrade is indicated to be necessary. See TracUpgrade for more information. * Restart tracd or your web server.