Changes between Version 4 and Version 5 of TracMigrate
- Timestamp:
- May 15, 2015, 11:43:33 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracMigrate
v4 v5 8 8 9 9 * Create a repository on the new server: 10 {{{ 10 {{{#!sh 11 11 $ svnadmin create /var/spool/raid/svn_repo 12 12 }}} 13 13 14 14 * Make sure the commit hooks are configured to allow our 'svnsync' user to do anything it wants: 15 {{{ 15 {{{#!sh 16 16 $ echo "#!/bin/sh" > /var/spool/raid/svn_repo/hooks/pre-revprop-change 17 $ 17 $ chmod +x /var/spool/raid/svn_repo/hooks/pre-revprop-change 18 18 }}} 19 19 20 20 * Set destination repo to version 0 ('''svnsync --opts dest_repo src_repo'''): 21 {{{ 22 $ 21 {{{#!sh 22 $ svnsync --username svnsync init file:///var/spool/raid/svn_repo/ svn+ssh://root@192.168.11.128/home/repos/projects/ 23 23 Copied properties for revision 0. 24 24 }}} 25 25 26 26 * Sync the repositories: 27 {{{ 27 {{{#!sh 28 28 $ svnsync --username=svnsync --non-interactive sync file:///var/spool/raid/svn_repo/ 29 29 Committed revision 1. … … 41 41 Committed revision 7. 42 42 ..... 43 44 43 }}} 45 44 46 45 == Trac Migration 47 46 48 * Install a Trac environment on the destination machine.47 * Install a Trac project on the destination machine. 49 48 50 * On the source machine, dump the SQLite database: 51 {{{ 52 $ sqlite3 /path/to/trac/db/trac.db ".dump" >> sqlite_trac.sql 49 * On the source machine, backup the environment using `trac-admin $env hotcopy $backup_dir`, as described on the TracBackup page. 50 51 * 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. 52 53 * Copy the environment backup to the destination machine. 54 {{{#!sh 55 $ scp $backup_dir root@192.168.11.125:/root/ 53 56 }}} 54 57 55 * Adjust the system table ('''sqlite_trac.sql''') to fix the repository_dir if it is different on the destination machine: 56 {{{ 57 INSERT INTO "system" VALUES('repository_dir', 'svn:fc784ba1-7bb2-4f0b-9d6b-749d55304f83:/var/spool/raid/svn_repo'); 58 }}} 59 60 * Copy the db script to the destination machine: 61 {{{ 62 $ scp sqlite_trac.sql root@192.168.11.125:/root/ 63 }}} 58 * Copy the environment to the location of the project created in the first step. 64 59 65 * Import the script into a database and copy it to the relevant folder: 66 {{{ 67 $ cat sqlite_trac.sql | sqlite3 trac.db 68 $ mv trac.db /var/spool/raid/trac/db/trac.db 69 $ chown -R www-data /var/spool/raid/trac/db/trac.db 70 }}} 71 72 * Migrate any attachments that may exist: 73 {{{ 74 $ scp /home/trac/attachments/wiki root@192.168.11.125:/var/spool/raid/trac/attachments/ 75 $ chown -R www-data /var/spool/raid/trac/attachments/ 76 }}} 60 * Upgrade the environment if an upgrade is indicated to be necessary. See TracUpgrade for more information. 77 61 78 62 * Restart tracd or Apache.