Hi,
reminder for myself and everybody else:
It is not very difficult to merge two Trac instances, but the
specific steps depend on your usage.
Thanks to Ryan for very useful hints!
Of course, the merge is not "perfect", because intertrac links
between the instances are not changed automatically, nor ticket
references in the wiki etc.
In my case I could leave out some things:
- users were mostly identical (same team)
- ticket custom fields, priorities, resolutions, severities, and
ticket types, versions were default
- no plugins, that are using the database
This leaves:
- ticket components
- ticket milestones
- repositories
- wiki
What I did:
1. *Backup* everything, i.e. both instances
2. Add useful prefixes to all ticket components in both instances
to avoid collision
3. Add useful prefixes to all ticket milestones in both instances
to avoid collision
4. In one of the two instances add an offset to all ticket numbers
to avoid collision (id in table "ticket", "ticket" in tables
"ticket_change" and "attachment")
UPDATE ticket SET id = id + 10000;
UPDATE ticket_change SET ticket = ticket + 10000;
UPDATE ticket_custom SET ticket = ticket + 10000;
UPDATE attachment SET id = id + 10000 WHERE type = 'ticket';
5. Dump the relevant tables. To dump a single table:
pg_dump --format plain --verbose --file ticket.sql \
--table ticket dbname1
And copy it to the merged database:
psql dbname2 < ticket.sql
I removed everything from those files, but the actual COPY
command. Not sure, whether this was needed.
Same process for all six or seven tables.
6. Add the git repositories in the merged instance.
7. Copy all attachments from one instance to the other, more or
less it is:
cd instance1/files/attachments;
tar cf - * | ( cd ../../../instance2/files/attachments;
tar xf - )
I had to adjust minor things like git post-receive hooks, nginx
paths etc., but that's more or less it.
Many thanks again to Ryan!
Cheers
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.