Modify

Opened 8 years ago

Closed 8 years ago

#12697 closed enhancement (fixed)

SQL logs from destination environment

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Component: TracMigratePlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

I'm seeing some warnings on migration, which I'm guessing may be related to trac:#8396.

$ trac-admin /var/trac migrate -i mysql://tracuser:<password>@localhost:3306/trac
Upgrading SimpleMultiProject database schema
SimpleMultiProject database schema version is 0, should be 6
Copying tables:
  attachment table... 7268 records.
  auth_cookie table... 1 records.
  cache table... 7 records.
  component table... 95 records.
  enum table... 40 records.
  milestone table... 127 records.
  node_change table... 230975 records.
  permission table... 67 records.
  report table... 72 records.
  repository table... 11 records.
  revision table... 26318 records.
  session table... 192 records.
  session_attribute table... /usr/lib/python2.6/site-packages/Trac-1.0.10-py2.6.egg/trac/db/util.py:72: Warning: Column 'authenticated' cannot be null
  return self.cursor.execute(sql_escape_percent(sql), args)
  session_attribute table... 1096 records.
  smp_component_project table... 59 records.
  smp_milestone_project table... 58 records.
  smp_project table... 21 records.
  smp_version_project table... 0 records.
  system table... 3 records.
  ticket table... /usr/lib/python2.6/site-packages/Trac-1.0.10-py2.6.egg/trac/db/util.py:72: Warning: Data truncated for column 'description' at row 27
  return self.cursor.execute(sql_escape_percent(sql), args)
  ticket table... 19506 records.
  ticket_change table... /usr/lib/python2.6/site-packages/Trac-1.0.10-py2.6.egg/trac/db/util.py:72: Warning: Data truncated for column 'newvalue' at row 34
  return self.cursor.execute(sql_escape_percent(sql), args)
  ticket_change table... /usr/lib/python2.6/site-packages/Trac-1.0.10-py2.6.egg/trac/db/util.py:72: Warning: Data truncated for column 'newvalue' at row 45
  return self.cursor.execute(sql_escape_percent(sql), args)
  ticket_change table... /usr/lib/python2.6/site-packages/Trac-1.0.10-py2.6.egg/trac/db/util.py:72: Warning: Data truncated for column 'newvalue' at row 36
  return self.cursor.execute(sql_escape_percent(sql), args)
  ticket_change table... 156755 records.
  ticket_custom table... 134688 records.
  version table... 0 records.
  wiki table... 9614 records.

Do you think it would make sense to enable [trac] debug_sql and set [logging] log_level to DEBUG, and save the logs from the temporary environment?

That might not be necessary, but I thought it might be helpful. I'll poke at the database some more given what we know about the field size limitations that are documented in trac:#8396.

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Ryan J Ollos

Is it intentional to skip the [trac] section of trac.ini when migrating to a new environment? Does this change make sense:

  • tracmigrateplugin/0.12/tracmigrate/admin.py

     
    9999        plugins = []
    100100        for section in self.config.sections():
    101101            for name, value in self.config.options(section):
    102                 if section == 'trac' or name == 'database':
     102                if section == 'trac' and name == 'database':
    103103                    continue
    104104                entry = (section, name, value)
    105105                if section != 'components':

comment:2 Changed 8 years ago by Ryan J Ollos

I ran a migration to a new environment with the comment:1 patch and debug_sql = enabled. The SQL statements in the logs did not look very useful, so we can probably just close this ticket.

Another thing, just for future reference. In the message Warning: Data truncated for column 'description' at row 27, the row number does not seem to correspond to the row in the destination table. I'm guessing it is a row number in the chunked data insert. The actual ticket id for this case was 3628, and the ticket numbering has started at 1, with few or no missing tickets.

comment:3 Changed 8 years ago by Jun Omae

In 15436:

TracMigratePlugin: fix not migrating all options in [trac] section (refs #12697)

comment:4 in reply to:  1 Changed 8 years ago by Jun Omae

Replying to rjollos:

Is it intentional to skip the [trac] section of trac.ini when migrating to a new environment? Does this change make sense:

-                if section == 'trac' or name == 'database':
+                if section == 'trac' and name == 'database':

Nice find! Fixed and added unit tests in [15436].

comment:5 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Thanks for apply fix and adding tests. I'll make sure the fix and tests get ported over to trac:#12299.

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.