A life boat to escape the Trac ocean liner.
TracBoat is a toolbox for exporting whole Trac instances, saving them and migrating them to other platforms.
- Export Trac projects along with issues, issue changelogs (with attachments) and wiki pages (with attachments)
- Export Trac projects to local files (in json, toml, Python literal or Python pickle formats)
- Migrate Trac projects directly from remote instances as well as from previously created export files
- Migrate Trac projects to a live GitLab instance
- Migrate Trac projects to a mocked GitLab on the file system to check for correctness
TracBoat is available on pypi, so to install it just type:
$ pip install tracboat
If you want to install from source, doing it in a virtualenv
is highly recommended. After having this repo cloned, just type:
$ cd tracboat
$ virtualenv -p python2.7 VENV
$ source VENV/bin/activate
$ pip install -r requirements.txt
$ pip install -e .
Every command line option can be specified as an evironment variable, so the following command:
$ tracboat users --trac-uri=https://mytrac/xmlrpc --no-ssl-verify
...is exactly the same as the following:
$ export TRACBOAT_TRAC_URI=https://mytrac/xmlrpc
$ export TRACBOAT_SSL_VERIFY=0
$ tracboat users
Another way to conveniently configure tracboat
is with a configuration file in TOML format. Providing a file
$ cat mytrac.toml
[tracboat]
trac_uri = "https://mytrac/xmlrpc"
ssl_verify = false
$ tracboat --config-file=mytrac.toml users
Please note that when a value is specified more that once, the priority order considered is the following:
- command line option;
- environment variable;
- configuration file;
- default value.
If you are very curious about how to play with command line options, have a look to the click documentation.
$ tracboat users --trac-uri=http://localhost/xmlrpc
$ tracboat export --trac-uri=http://localhost/xmlrpc --format=json --out-file=myproject.json
$ cat awesomemigration.toml
[tracboat]
from-export-file = "myexportedtracproject.json"
gitlab-project-name = "migrated/myproject"
gitlab-version = "9.0.0"
gitlab_db_password = "Բարեւ աշխարհ"
$ tracboat --config-file=awesomemigration.toml migrate
The initial inspiration and core migration logic comes from the trac-to-gitlab project by Maël Lavault: this project was born from heavy cleanup and refactoring of that original code, so this is why this spinoff inherited its GPLv3 license.
- Project import.