Version 2 (modified by pacopablo, 10 years ago) (diff)


SQLite to PostgreSQL Script


Script to migrate a SQLite trac database to PostgreSQL

Bugs/Feature Requests

Existing bugs and feature requests for SqliteToPgScript are here.

If you have any issues, create a new ticket.


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


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


usage: sqlite2pg [options] [site]

sqlite2pg is used to migrate data from SQLite to PostgreSQL.

  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -t <path>, --tracbase=<path>
                        Parent path for trac sites
  -e <path>, --tracenv=<path>
                        Path to trac environment
  -m <list>, --migrate=<list>
                        Comma separated list of tables to migrate
                        Comma separated list of users to exclude from
                        permission migration
  -w <list>, --wikipages=<list>
                        Comma separated list of wiki page names to ommit from
                        the migration
  -p <uri>, --pg_uri=<uri>
                        DB URI for PostgreSQL database
  -s <uri>, --sqlite_uri=<uri>
                        DB URI for SQLite database
  --noclean             Do not clear PostgreSQL tables before transfer
./sqlite2pg -e /var/trac -p 'postgres://user:pass@localhost/db?schema=myschema'

Recent Changes

3826 by pacopablo on 2008-06-12 07:06:57
  • Accepted patch to create a main() function that is easily callable from other python modules. Thanks to alberto Closes #3148
  • Accepted patch to check for presence of arguments before checking value. Closes #3138
3707 by pacopablo on 2008-05-22 17:54:46
Changed author's email address as asylumware has, unfortunately, gone the way of the dodo
2377 by pacopablo on 2007-07-04 06:28:21


  • Fixes #1709 (really)
  • Yeah, good of me to actually test my changes. Fixed the typo caused by fixing the typo :)


Author: pacopablo