Changes between Version 3 and Version 4 of TracMigrate
- Timestamp:
- Feb 22, 2015, 1:08:53 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracMigrate
v3 v4 1 = Migration = 1 = Migration 2 2 3 [[TracGuideToc]] 3 4 4 I had to migrate a subversion and Trac enviroment between two machines; Different distributions. For svnsync, it is required to have both svn server versions >= 1.4.05 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. 5 6 6 == Subversion Replication ==7 == Subversion Replication 7 8 8 * Create a repository on the new server 9 * Create a repository on the new server: 9 10 {{{ 10 11 $ svnadmin create /var/spool/raid/svn_repo 11 12 }}} 12 13 13 * Make sure the commit hooks are configured to allow our 'svnsync' user to do anything it wants .14 * Make sure the commit hooks are configured to allow our 'svnsync' user to do anything it wants: 14 15 {{{ 15 16 $ echo "#!/bin/sh" > /var/spool/raid/svn_repo/hooks/pre-revprop-change … … 17 18 }}} 18 19 19 * Set destination repo to version 0 ('''svnsync --opts dest_repo src_repo''') 20 * Set destination repo to version 0 ('''svnsync --opts dest_repo src_repo'''): 20 21 {{{ 21 22 $ svnsync --username svnsync init file:///var/spool/raid/svn_repo/ svn+ssh://root@192.168.11.128/home/repos/projects/ … … 23 24 }}} 24 25 25 26 * Sync the repositories 26 * Sync the repositories: 27 27 {{{ 28 28 $ svnsync --username=svnsync --non-interactive sync file:///var/spool/raid/svn_repo/ … … 43 43 44 44 }}} 45 * Done!!!46 45 47 == Trac Migration ==46 == Trac Migration 48 47 48 * Install a Trac environment on the destination machine. 49 49 50 * Install a Trac enviroment on the destination machine 51 52 * On the source machine, dump the sqlite db: 50 * On the source machine, dump the SQLite database: 53 51 {{{ 54 52 $ sqlite3 /path/to/trac/db/trac.db ".dump" >> sqlite_trac.sql 55 53 }}} 56 54 57 * Adjust the system table ('''sqlite_trac.sql''') to fix the repository_dir if it 's different in the destination machine55 * Adjust the system table ('''sqlite_trac.sql''') to fix the repository_dir if it is different on the destination machine: 58 56 {{{ 59 57 INSERT INTO "system" VALUES('repository_dir', 'svn:fc784ba1-7bb2-4f0b-9d6b-749d55304f83:/var/spool/raid/svn_repo'); 60 58 }}} 61 59 62 * Copy the db script to the destination machine 60 * Copy the db script to the destination machine: 63 61 {{{ 64 62 $ scp sqlite_trac.sql root@192.168.11.125:/root/ 65 63 }}} 66 64 67 * Import the script into a d b and copy it to the relevant folder65 * Import the script into a database and copy it to the relevant folder: 68 66 {{{ 69 67 $ cat sqlite_trac.sql | sqlite3 trac.db … … 72 70 }}} 73 71 74 * Migrate any attachments that may exist 72 * Migrate any attachments that may exist: 75 73 {{{ 76 74 $ scp /home/trac/attachments/wiki root@192.168.11.125:/var/spool/raid/trac/attachments/ … … 78 76 }}} 79 77 80 * Restart tracd or apache and have fun78 * Restart tracd or Apache.