Edgewall Software

Changes between Version 4 and Version 5 of TracMigrate


Ignore:
Timestamp:
May 15, 2015, 11:43:33 PM (9 years ago)
Author:
Ryan J Ollos
Comment:

Provide better steps for migrating an environment. The previous steps were overly complex.

Legend:

Unmodified
Added
Removed
Modified
  • TracMigrate

    v4 v5  
    88
    99 * Create a repository on the new server:
    10 {{{
     10{{{#!sh
    1111$ svnadmin create /var/spool/raid/svn_repo
    1212}}}
    1313
    1414 * Make sure the commit hooks are configured to allow our 'svnsync' user to do anything it wants:
    15 {{{
     15{{{#!sh
    1616$ echo "#!/bin/sh" > /var/spool/raid/svn_repo/hooks/pre-revprop-change
    17 $  chmod +x /var/spool/raid/svn_repo/hooks/pre-revprop-change
     17$ chmod +x /var/spool/raid/svn_repo/hooks/pre-revprop-change
    1818}}}
    1919
    2020 * Set destination repo to version 0 ('''svnsync --opts dest_repo src_repo'''):
    21 {{{
    22 $  svnsync --username svnsync  init file:///var/spool/raid/svn_repo/   svn+ssh://root@192.168.11.128/home/repos/projects/ 
     21{{{#!sh
     22$ svnsync --username svnsync  init file:///var/spool/raid/svn_repo/   svn+ssh://root@192.168.11.128/home/repos/projects/ 
    2323Copied properties for revision 0.
    2424}}}
    2525
    2626 * Sync the repositories:
    27 {{{
     27{{{#!sh
    2828$  svnsync --username=svnsync --non-interactive sync file:///var/spool/raid/svn_repo/
    2929Committed revision 1.
     
    4141Committed revision 7.
    4242.....
    43 
    4443}}}
    4544
    4645== Trac Migration
    4746
    48  * Install a Trac environment on the destination machine.
     47 * Install a Trac project on the destination machine.
    4948
    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/
    5356}}}
    5457
    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.
    6459
    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.
    7761
    7862 * Restart tracd or Apache.