Modify

Opened 10 years ago

Closed 10 years ago

#12141 closed defect (worksforme)

Trac-Migration stops at milestone-table with unknown column error

Reported by: anonymous Owned by: Jun Omae
Priority: normal Component: TracMigratePlugin
Severity: major Keywords:
Cc: Trac Release: 1.0

Description (last modified by Jun Omae)

Trac-Migration stops at milestone-table with unknown column error.

$ tracmigrateplugin/trac-migrate.py --in-place /home/trac mysql://user:pass@localhost/trac
  ...
  milestone table... Traceback (most recent call last):
  File "tracmigrateplugin/trac-migrate.py", line 55, in <module>
    sys.exit(main(sys.argv[1:]) or 0)
  File "tracmigrateplugin/trac-migrate.py", line 51, in main
    return TracMigrationCommand(env)._do_migrate(dest, dburi)
  File "/home/trac/tracmigrateplugin/tracmigrate/admin.py", line 34, in _do_migrate
    return self._do_migrate_inplace(dburi)
  File "/home/trac/tracmigrateplugin/tracmigrate/admin.py", line 68, in _do_migrate_inplace
    self._copy_tables(src_db, dst_db, src_dburi, dburi, inplace=True)
  File "/home/trac/tracmigrateplugin/tracmigrate/admin.py", line 132, in _copy_tables
    @self._with_transaction(dst_db)
  File "/home/trac/tracmigrateplugin/tracmigrate/admin.py", line 221, in wrapper
    fn(db)
  File "/home/trac/tracmigrateplugin/tracmigrate/admin.py", line 167, in copy
    cursor.executemany(query, rows)
  File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 92, in executemany
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 206, in executemany
    r = r + self.execute(query, a)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'started' in 'field list'")

Cent OS 7 Python 2.7

Attachments (0)

Change History (5)

comment:1 Changed 10 years ago by Jun Omae

Keywords: needinfo added
Severity: blockermajor

started column is not used in Trac core. Could you post Trac's version and installed plugins? I cannot reproduce it if you don't provide the details.

comment:2 Changed 10 years ago by anonymous

Thanks for the fast reply. I am using Trac 1.0 with plugin binary-agilo 1.3.12-PRO (http://www.agilofortrac.com/download-agilo-trac/).

It seems that the column "started" is not created, I was able to fix it by creating it before copying the tables:

--- tracmigrate/admin.py.old    2015-01-13 18:01:38.124709905 +0100
+++ tracmigrate/admin.py        2015-01-13 18:14:02.520750015 +0100
@@ -124,6 +124,7 @@
         src_cursor = src_db.cursor()
         src_tables = set(self._get_tables(src_dburi, src_cursor))
         cursor = dst_db.cursor()
+        cursor.execute("ALTER TABLE milestone ADD started BIGINT(20) NULL AFTER completed")
         tables = set(self._get_tables(dburi, cursor)) & src_tables
         sequences = set(self._get_sequences(dburi, cursor, tables))
         progress = self._isatty()

Do you think it is a bug of the agilo-plugin? Then I can report it there.

comment:3 Changed 10 years ago by Jun Omae

Works for me on new environment.

$ virtualenv /dev/shm/agilo
New python executable in /dev/shm/agilo/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
$ /dev/shm/agilo/bin/pip install ~/arc/Genshi-0.6.tar.gz
$ /dev/shm/agilo/bin/pip install ~/arc/Trac-1.0.2.tar.gz
$ /dev/shm/agilo/bin/easy_install -ZU ~/arc/binary_agilo-1.3.14_PRO-py2.7.egg
$ /dev/shm/agilo/bin/trac-admin /dev/shm/agilo-trac initenv
Creating a new Trac environment at /dev/shm/agilo-trac
...
Congratulations!

$ cat >>/dev/shm/agilo/conf/trac.ini <<EOS
> [components]
> agilo.* = enabled
> agilo_common.* = enabled
> agilo_pro.* = enabled
> EOS
$ /dev/shm/agilo/bin/trac-admin /dev/shm/agilo-trac upgrade
Creating Product Backlog...
Creating Sprint Backlog...
Upgrade done.

You may want to upgrade the Trac documentation now by running:

  trac-admin /dev/shm/agilo-trac wiki upgrade
Trac [/dev/shm/agilo-trac]>

$ /dev/shm/agilo/bin/python ./trac-migrate.py --in-place /dev/shm/agilo-trac sqlite:db/trac-migrated.db
Creating Product Backlog...
Creating Sprint Backlog...
Copying tables:
  agilo_backlog table... 2 records.
  agilo_backlog_ticket table... 0 records.
  agilo_burndown table... 0 records.
  agilo_burndown_data_change table... 0 records.
  agilo_calendar_entry table... 0 records.
  agilo_contingent table... 0 records.
  agilo_link table... 0 records.
  agilo_sprint table... 0 records.
  agilo_team table... 0 records.
  agilo_team_member table... 0 records.
  agilo_team_metrics_entry table... 0 records.
  attachment table... 0 records.
  auth_cookie table... 0 records.
  cache table... 4 records.
  component table... 2 records.
  enum table... 16 records.
  milestone table... 4 records.
  node_change table... 0 records.
  permission table... 17 records.
  report table... 8 records.
  repository table... 0 records.
  revision table... 0 records.
  session table... 1 records.
  session_attribute table... 1 records.
  system table... 3 records.
  ticket table... 0 records.
  ticket_change table... 0 records.
  ticket_custom table... 0 records.
  version table... 2 records.
  wiki table... 59 records.
Back up conf/trac.ini to conf/trac.ini.migrate-1421212255 in /dev/shm/agilo-trac.

Also, Agilo doesn't add started column to milestone table.

$ sqlite3 /dev/shm/agilo-trac/db/trac.db '.schema milestone'
CREATE TABLE milestone (
    name text PRIMARY KEY,
    due integer,
    completed integer,
    description text
);
$ sqlite3 /dev/shm/agilo-trac/db/trac-migrated.db '.schema milestone'
CREATE TABLE milestone (
    name text PRIMARY KEY,
    due integer,
    completed integer,
    description text
);

I guess that you have previously tried some plugins (currently disabled or uninstalled) and one has added the started column, e.g. ScrumBurndownPlugin. Please drop the started column from milestone table before migration.

Last edited 10 years ago by Jun Omae (previous) (diff)

comment:4 Changed 10 years ago by anonymous

Thank you very much for your help. It is an old trac-database, so it could be that someone tried another plugin in the past.

Sorry for the inconvenience caused.

comment:5 Changed 10 years ago by Jun Omae

Description: modified (diff)
Keywords: needinfo removed
Resolution: worksforme
Status: newclosed
Trac Release: 1.0

Thanks for the feedback. Closing this.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
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.