Opened 6 years ago

Closed 2 years ago

#4560 closed defect (wontfix)

Unsupported operand type(s) for +: 'NoneType' and 'int'

Reported by: fermulator Owned by: pacopablo
Priority: normal Component: SqliteToPgScript
Severity: blocker Keywords:
Cc: pacopablo Trac Release: 0.11



I'm trying to upgrade my SQLITE db to POSTGRES. I run the following:

./sqlite2pg -e /srv/trac -p 'postgres://postgres:mypassword@localhost/trac?schema=myschema'

And receive the following error:

Traceback (most recent call last):
  File "./sqlite2pg", line 335, in <module>
  File "./sqlite2pg", line 331, in main
  File "./sqlite2pg", line 244, in Main
    pgenv = getPostgreSQLEnvironment(opts)
  File "./sqlite2pg", line 222, in getPostgreSQLEnvironment
  File "/usr/lib/python2.5/site-packages/Trac-", line 449, in upgrade
  File "/usr/lib/python2.5/site-packages/Trac-", line 502, in upgrade_environment
    for i in range(dbver + 1, db_default.db_version + 1):
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by fermulator

Any ideas on this problem? It might not even be a bug ... but I'm not sure what exactly is the issue. Seems to perhaps be related to trac itself?...

comment:2 Changed 6 years ago by ruben@…

I'm having exacly the same problem here
Trac 0.11.1 from Debian repos (Lenny)

comment:3 Changed 5 years ago by spreng@…

I'm having exactly the same problem when I try specify a different schema name. If I leave out the schema part, it works without a problem (Debian/Lenny).

comment:4 Changed 5 years ago by landolt@…

I'm not sure if it really matters whether the trac tables are in schema 'tracschema' (or 'myschema', or whatever), or if they're in the public schema.

But, if you're using PostgreSQL 8+ and you want to have the tables in the correct schema, you can use sqlite2pg to migrate from sqlite into the postgres public schema and _then_ move it to your schema of choice.

1) run the conversion into the public schema

./sqlite2pg -e /srv/trac -p 'postgres://postgres:mypassword@localhost/trac'

2) create the schema

mach=> create schema myschema;

3) move all tables, one by one, into the new schema:

mach=>alter table table_one set schema myschema;

and repeat for all tables, indexes, and sequences

The Postgres 8 Docs can tell you more.

comment:5 Changed 2 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

This plugin is deprecated. See the TracMigratePlugin.

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.