Edgewall Software
Home
Trac
Trac Hacks
Genshi
Babel
Bitten
Home
Download
Documentation
Mailing Lists
License
FAQ
Search:
Login
Preferences
Help/Guide
About Trac
Wiki
Timeline
Roadmap
Browse Source
View Tickets
New Ticket
Search
Context Navigation
+0
Start Page
Index
History
Editing TracMigrate
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
= 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: {{{ $ svnadmin create /var/spool/raid/svn_repo }}} * Make sure the commit hooks are configured to allow our 'svnsync' user 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 --opts dest_repo src_repo'''): {{{ $ 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: {{{ $ 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 environment on the destination machine. * On the source machine, dump the SQLite database: {{{ $ sqlite3 /path/to/trac/db/trac.db ".dump" >> sqlite_trac.sql }}} * Adjust the system table ('''sqlite_trac.sql''') to fix the repository_dir if it is different on the destination machine: {{{ INSERT INTO "system" VALUES('repository_dir', 'svn:fc784ba1-7bb2-4f0b-9d6b-749d55304f83:/var/spool/raid/svn_repo'); }}} * Copy the db script to the destination machine: {{{ $ scp sqlite_trac.sql root@192.168.11.125:/root/ }}} * Import the script into a database and copy it to the relevant folder: {{{ $ cat sqlite_trac.sql | sqlite3 trac.db $ mv trac.db /var/spool/raid/trac/db/trac.db $ chown -R www-data /var/spool/raid/trac/db/trac.db }}} * Migrate any attachments that may exist: {{{ $ scp /home/trac/attachments/wiki root@192.168.11.125:/var/spool/raid/trac/attachments/ $ chown -R www-data /var/spool/raid/trac/attachments/ }}} * Restart tracd or Apache.
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.