wiki:TracMigratePlugin

Version 7 (modified by Jun Omae, 10 years ago) (diff)

--

Migrate to new environment with another database

Description

The plugin provides trac-migrate.py 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

Download the zipped source from [download:tracmigrateplugin here].

Source

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 http://trac-hacks.org/svn/tracmigrateplugin/0.12 /path/to/tracmigrateplugin
    
  2. If new environment uses PostgreSQL or MySQL, create database for the new environment. See DatabaseBackend#BackendSpecificInstallationInstructions.
  3. Run trac-migrate.py.
    $ cd /path/to/tracmigrateplugin
    $ ./trac-migrate.py /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.
    ....
    

Install

  1. Install the plugin for Trac 0.12 or later.
    easy_install http://trac-hacks.org/svn/tracmigrateplugin/0.12
    
  2. Enable the plugin in trac.ini of your source environment.
    [components]
    tracmigrate.* = enabled
    

Example

$ ./trac-migrate.py
Usage: ./trac-migrate.py SOURCE-TRACENV DEST-TRACENV DBURI

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

$ ./trac-migrate.py /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.

Tickets

Recent Changes

18447 by jun66j5 on 2021-09-30 23:43:37
TracMigratePlugin: fix ImportError with Trac 1.4.x (closes #14054)
17334 by jun66j5 on 2019-02-06 03:16:18
TracMigratePlugin: fix compatibility of unit tests with MySQL 8.0
15444 by jun66j5 on 2016-03-21 16:26:26
TracMigratePlugin: bump up the version and call setuptools.setup() only if run setup.py as a script
(more)

Author/Contributors

Author: jun66j5
Maintainer: jun66j5
Contributors: