Version 7 (modified by jun66j5, 14 months ago) (diff)


Migrate to new environment with another database


The plugin provides script and migrate command of trac-admin which migrates to new environment with another database.

Bugs/Feature Requests

Existing bugs and feature requests for TracMigratePlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


You can check out TracMigratePlugin from here using Subversion, or browse the source with Trac.

Usage without installation

  1. Checkout or export latest source.
    svn co /path/to/tracmigrateplugin
  2. If new environment uses PostgreSQL or MySQL, create database for the new environment. See DatabaseBackend#BackendSpecificInstallationInstructions.
  3. Run
    $ cd /path/to/tracmigrateplugin
    $ ./ /path/to/source /path/to/destination mysql://tracuser:password@localhost/trac
    Copying tables:
      attachment table... 10 records.
      auth_cookie table... 9 records.
      cache table... 11 records.


  1. Install the plugin for Trac 0.12 or later.
  2. Enable the plugin in trac.ini of your source environment.
    tracmigrate.* = enabled


$ ./

  $ ./ /path/to/source /path/to/dest sqlite:db/trac.db
  $ ./ /path/to/source /path/to/dest postgres://tracuser:password@localhost/trac?schema=destination
  $ ./ /path/to/source /path/to/dest mysql://tracuser:password@localhost/trac

$ ./ /path/to/source-tracenv migrate /path/to/destination-tracenv postgres://tracuser:password@localhost/trac?schema=destination
Copying tables:
  attachment table... 10 records.
  auth_cookie table... 9 records.
  cache table... 11 records.
  component table... 5 records.
  enum table... 13 records.
  milestone table... 7 records.
  node_change table... 37 records.
  permission table... 17 records.
  report table... 11 records.
  repository table... 5 records.
  revision table... 35 records.
  session table... 2 records.
  session_attribute table... 19 records.
  ticket table... 35 records.
  ticket_change table... 110 records.
  ticket_custom table... 375 records.
  version table... 2 records.
  wiki table... 93 records.
Copying directories:
  attachments directory... done.
  htdocs directory... done.
  templates directory... done.
  plugins directory... done.


Recent Changes

[14462] by jun66j5 on 2015-02-25 09:46:26
TracMigratePlugin: fixed wrongly resetting sequences of non-current schema with PostgreSQL database
[14461] by jun66j5 on 2015-02-25 09:36:34
TracMigratePlugin: improve migration with SQLite database
[14071] by jun66j5 on 2014-08-07 09:02:15
tracmigrate: don't pass db parameter for Environment.get_version since the parameter has been removed in 1.1.2dev (refs #11899, trac:r12826)


Author: jun66j5
Maintainer: jun66j5