Changes between Version 11 and Version 12 of TracMigratePlugin
- Timestamp:
- Mar 13, 2015, 9:14:17 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracMigratePlugin
v11 v12 5 5 == Description 6 6 7 The plugin provides `trac-migrate.py` script and `migrate` command of `trac-admin` which migrates to a new Trac environment with another database.7 The plugin provides `trac-migrate.py` script and the `migrate` command of `trac-admin` which migrates to a new Trac environment with another database. 8 8 9 9 == Bugs/Feature Requests … … 27 27 == Usage without installation 28 28 29 1. Checkout or export latest source .29 1. Checkout or export latest source: 30 30 {{{#!sh 31 31 svn co http://trac-hacks.org/svn/tracmigrateplugin/0.12 /path/to/tracmigrateplugin 32 32 }}} 33 2. If new environment uses PostgreSQL or MySQL, create database for the new environment. See[t:DatabaseBackend#BackendSpecificInstallationInstructions].34 3. Run `trac-migrate.py` .33 2. If the new environment uses PostgreSQL or MySQL, create database for this new environment. See: [t:DatabaseBackend#BackendSpecificInstallationInstructions]. 34 3. Run `trac-migrate.py`: 35 35 {{{#!sh 36 36 cd /path/to/tracmigrateplugin 37 37 ./trac-migrate.py /path/to/source /path/to/destination mysql://tracuser:password@localhost/trac 38 }}} 39 This would result in: 40 {{{#!sh 38 41 Copying tables: 39 42 attachment table... 10 records. … … 45 48 == Installation 46 49 47 1. Install the plugin for Trac 0.12 or later .50 1. Install the plugin for Trac 0.12 or later: 48 51 {{{#!sh 49 52 easy_install http://trac-hacks.org/svn/tracmigrateplugin/0.12 50 53 }}} 51 2. Enable the plugin in trac.ini of your source environment.54 2. Enable the plugin in `trac.ini` of your source environment: 52 55 {{{#!ini 53 56 [components] … … 55 58 }}} 56 59 57 == Example 60 == Examples 58 61 59 62 === Usage … … 61 64 {{{#!sh 62 65 $ ./trac-migrate.py 66 63 67 Usage: trac-migrate.py [OPTIONS] SOURCE-TRACENV [DEST-TRACENV] DBURI 64 68 … … 68 72 Options: 69 73 -i, --in-place migrate without creating a new environment 74 }}} 70 75 71 76 Examples: 72 $ trac-migrate.py /path/to/source /path/to/dest sqlite:db/trac.db 73 $ trac-migrate.py /path/to/source /path/to/dest postgres://tracuser:password@localhost/trac?schema=destination 74 $ trac-migrate.py /path/to/source /path/to/dest mysql://tracuser:password@localhost/trac 75 $ trac-migrate.py --in-place /path/to/source sqlite:db/trac.db 76 $ trac-migrate.py --in-place /path/to/source postgres://tracuser:password@localhost/trac?schema=destination 77 $ trac-migrate.py --in-place /path/to/source mysql://tracuser:password@localhost/trac 78 77 {{{ 78 trac-migrate.py /path/to/source /path/to/dest sqlite:db/trac.db 79 trac-migrate.py /path/to/source /path/to/dest postgres://tracuser:password@localhost/trac?schema=destination 80 trac-migrate.py /path/to/source /path/to/dest mysql://tracuser:password@localhost/trac 81 trac-migrate.py --in-place /path/to/source sqlite:db/trac.db 82 trac-migrate.py --in-place /path/to/source postgres://tracuser:password@localhost/trac?schema=destination 83 trac-migrate.py --in-place /path/to/source mysql://tracuser:password@localhost/trac 79 84 }}} 80 85 81 86 === Migration to a new environment 82 87 88 The syntax for migrating to a new environment would be as follows: 89 83 90 {{{#!sh 84 91 $ ./trac-migrate.py /path/to/source-tracenv /path/to/destination-tracenv postgres://tracuser:password@localhost/trac?schema=destination 92 85 93 Copying tables: 86 94 attachment table... 10 records. … … 111 119 === Migration to a new database without creating a new environment 112 120 121 The syntax for migrating to a new database without creating a new environment would be as follows: 122 113 123 {{{#!sh 114 124 $ ./trac-migrate.py --in-place /path/to/tracenv postgres://trac:password@localhost/trac?schema=new_schema 125 115 126 Copying tables: 116 127 attachment table... 31 records.