Opened 8 years ago
Last modified 6 years ago
#12299 closed enhancement
Integrate functionality of TracMigratePlugin — at Version 14
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Added TracAdmin |
||
API Changes: | |||
Internal Changes: |
Description
Database is locked is one of the most frequent duplicates. For migrating databases we suggest using TracMigratePlugin. The plugin is stable and I've used it for several migrations. We could move the code into tracopt
. I'm seeking feedback on that idea. Jun, are you okay with the code being moved into the Trac core?
We might consider naming the module convert.py
rather than migrate.py
. The TracMigrate page documents a slightly different scenario.
Change History (14)
comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
Jun, are you okay with the code being moved into the Trac core?
Yeah. No problem.
We could move the code into
tracopt
. …. We might consider naming the moduleconvert.py
rather thanmigrate.py
.
It would be good to move the code into trac.admin.convert
or trac.db.convert
. I think it would be useful to be able to use without changes of [components]
section.
follow-up: 4 comment:3 by , 8 years ago
Replying to jomae:
It would be good to move the code into
trac.admin.convert
ortrac.db.convert
. I think it would be useful to be able to use without changes of[components]
section.
Those changes sound good.
I haven't been able to get the TracMigratePlugin tests to pass with PostgreSQL. After the following change they pass:
-
tracmigrate/tests/admin.py
67 67 att.insert('filename.txt', StringIO('test'), 4) 68 68 env.shutdown() 69 69 70 if 'destroying' in inspect.getargspec(EnvironmentStub.__init__)[0]:71 def _destroy_db(self):72 EnvironmentStub(destroying=True)73 else:74 75 EnvironmentStub().destroy_db()70 # if 'destroying' in inspect.getargspec(EnvironmentStub.__init__)[0]: 71 # def _destroy_db(self): 72 # EnvironmentStub(destroying=True) 73 # else: 74 def _destroy_db(self): 75 EnvironmentStub(destroying=True).destroy_db() 76 76 77 77 def _get_all_records(self, env): 78 78 def primary(row, columns):
comment:4 by , 8 years ago
Replying to Ryan J Ollos:
I haven't been able to get the TracMigratePlugin tests to pass with PostgreSQL. After the following change they pass: […]
Thanks for the investigating! Fixed in th:r15147. I didn't probably test with Trac 1.0+ and PostgreSQL.
comment:5 by , 8 years ago
Milestone: | next-major-releases → 1.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
Summary: | Add TracMigratePlugin to tracopt → Integrate functionality of TracMigratePlugin |
comment:6 by , 8 years ago
There are some changes we should incorporate in th:#12696, th:#12697 and th:#12691.
comment:8 by , 8 years ago
For inplace migration, TracMigrate creates a temporary environment and for the SQLite case it copies the database file back to the migrated environment after the migration is finished. Would it work just as well if the source and destination environments were the same for an inplace migration?
comment:9 by , 8 years ago
I'm looking at moving the database conversion methods to trac.db.convert.DatabaseConverter
, and putting the migrate
command in trac.env.EnvironmentAdmin
. That would result in two trac-admin commands:
convertdb <dburi>
: convert database (inplace)migrate <dstenv> [dburi]
: migrate environment and optionally convert the database
follow-up: 11 comment:10 by , 8 years ago
I recently (and repeatedly) bumped into an issue with TracMigratePlugin and inherited trac.ini
files:
Missing configuration file appkit/conf/trac.ini Missing configuration file appkit/conf/site.ini Missing configuration file appkit/conf/site.ini
I'm not sure what's going on here. Moreover I'm not sure yet if it tied but as the plugins are enabled in one of the inherited files, the DB tables for those plugins are not exported.
comment:11 by , 8 years ago
Replying to Emmanuel Blot:
I recently (and repeatedly) bumped into an issue with TracMigratePlugin and inherited
trac.ini
files:[…]
I'm not sure what's going on here. Moreover I'm not sure yet if it tied but as the plugins are enabled in one of the inherited files, the DB tables for those plugins are not exported.
That may be caused by non-absolute path in [inherit] file
option. Could you please create new ticket with the details on trac-hacks.org?
comment:12 by , 8 years ago
Milestone: | 1.2 → 1.3.1 |
---|
comment:14 by , 7 years ago
Milestone: | next-dev-1.3.x → 1.3.2 |
---|---|
Release Notes: | modified (diff) |
I did some initial work in log:rjollos.git:t12299_trac_migrate. More work would be needed to move ahead.