Modify

Opened 7 years ago

Closed 7 years ago

#6207 closed defect (invalid)

error on migrating

Reported by: Ronaldo Owned by: John Hampton
Priority: highest Component: SqliteToPgScript
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

I'm trying to migrate 4 sqlite databases to postgree. All databases are trac enviroments. 2 of them are working ok and 2 are resulting at the error below:

sqlite: 3.5.9 postgre: 8.3 trac: 0.11.5

C:\Python25\Scripts>python sqlite2pg -e e:\trac\sites\bpp -p postgres://postgres:magna@localhost/bpp Traceback (most recent call last):

File "sqlite2pg", line 335, in <module>

sys.exit(main(sys.argv[1:]))

File "sqlite2pg", line 331, in main

Main(opts)

File "sqlite2pg", line 250, in Main

rc = tmigration.migrateTable(tname) or rc

File "sqlite2pg", line 72, in migrateTable

rc = self.default_copy(table)

File "sqlite2pg", line 93, in default_copy

pgcur.execute(insert_into, row)

File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by Ronaldo

C:\Python25\Scripts>python sqlite2pg -e e:\trac\sites\bpp -p postgres://postgres:magna@localhost/bpp
Traceback (most recent call last):
  File "sqlite2pg", line 335, in <module>
    sys.exit(main(sys.argv[1:]))
  File "sqlite2pg", line 331, in main
    Main(opts)
  File "sqlite2pg", line 250, in Main
    rc = tmigration.migrateTable(tname) or rc
  File "sqlite2pg", line 72, in migrateTable
    rc = self.default_copy(table)
  File "sqlite2pg", line 93, in default_copy
    pgcur.execute(insert_into, row)
  File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

comment:2 Changed 7 years ago by Ronaldo

Priority: normalhighest
Severity: normalcritical

comment:3 Changed 7 years ago by stefan.schlott@…

Severity: criticalmajor

We had the same error. The problem was a different database scheme - in our case, the table milestone had an additional column in the sqlite database. I assume that some plugin (which is no longer in use) created that column; the plugin was deinstalled, but the column was left. When we migrated to postgres, we used a new trac installation, containing only the plugins currently in use - and thus the stale column was missing.

The migration script will create insert statements without column names, thus the statement had one column to many - which gave the error above. Our solution: Compare database schemes, create missing columns.

Imho the migration script should check for such problems (or give a more descriptive error message); but since there is a workaround, I reduce the severity of this ticket.

comment:4 Changed 7 years ago by Ronaldo

Resolution: invalid
Status: newclosed

I have already solved the problem. There was a row with some required fieds with a null value. Att. Ronaldo.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Hampton.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.