Trac importer module for activeCollab
Before I get to the meat of the subject, let me provide some background information that lead to the Trac importer module for activeCollab.
Last month, the company I work for, Work at Play, implemented some changes. The big part of this is re-branding. The other is modification to system infrastructure. Trac, which is a component of this system, is being used as a ticketing tool, as well as some sort of a time tracking device. After a year and a half of usage and 30 separate instances (one for each project), it was time to change Trac to something that can scale with our requirements. Enter activeCollab. Why activeCollab? Because it’s awesome. It also replaces our BaseCamp instance for collaboration and project management needs.
The change requires to export all data from Trac and import it to activeCollab. This includes users, tickets, comments, attachments, milestones, and time records. My initial approach was to use activeCollab’s web service API, but the control over data attributes was limited. So, I’ve decided to create the activeCollab module, tracimporter.
Here is a list of key features of this module:
- Imports multiple instances of Trac
- Imports Trac tickets, milstones, comments, attachments, and hours
- Will use an existing activeCollab project if the trac instance being imported has the same name
- Keeps a log of imported data
- Can be ran multiple times without duplicating data
- Will automatically create users for un-recognized trac user names or content authors
This module is fairly straight forward to use involving just a few steps to set it up. But first, some notes:
- AC is the location where activeCollab is deployed, ex. /var/www/activecollab
- site.com is the URL of your activeCollab instance
Now the instructions:
- Backup your activeCollab, this includes the files and database.
- Copy all trac instances to
AC/import/tracs
*make sure appropriate permission is set for the files
and directories so that the tool can read them - Move tracimporter into the modules directory
AC/application/modules/ - Modify the variables.ini inside tracimporter and specify the following:
- company.id – the company to which the project(s) will be added to
- leader.id – the user whom the project will belong to, usually the admin account
- password – default password for new users
- role.id – default role for new users, 3 is a good choice
- ticket.visibility – default ticket visibility, should be 1
- [user_mapping] – a list of trac user names mapped to a list of email addresses
- Enable the tracimporter module via activeCollab’s admin panel.
Now, you can run the importer by going to this URL but do not visit it just yet because there are useful available options:
http://site.com/public/index.php/tracimporter
The following is a list of options than can be added to the URL as parameters:
- chunk - process this many new tickets, defaults to 100 if not specified; this means the importer will have to be ran multiple times
- rescan - rescan ticket changes (new comments) for previously imported tickets
- project – the name of the trac instance to process
- reset - will delete project(s)!
With these, you can specify the importer to process a thousand more tickets from the ‘test’ Trac project, while rescanning previously imported tickets for changes like so:
http://site.com/public/index.php/tracimporter?chunk=1000&rescan=1&reset=...
Before initiating the import, take these final notes:
- giving a high chunk number may cause a timeout, so keep it decent
- this is far from the final version and needs some cleaning up, but we ran it for all Work at Play trac projects (some with more than 1000 tickets) without any problems; I'd like to do more development on it though.
You can download the module below.
If you have any questions, please contact me here.
Update:
I have attached a version that will work with 2x. If you already have the previous version of the module, backup the file, variables.ini first, and overwrite the tracimporter module director.
The module was tested doing the following:
- I made a duplicate instance of our ActiveCollab - a dev copy
- Since I didn't have a new Trac project that hasn't been imported already, I deleted one of the projects
- I emptied ActiveCollab's trash
- I went into phpMyAdmin and deleted the rows in the acx_trac_imports that were associated with the deleted project
- did the import again by doing the above instructions
The results were as expected: the module re-imported the data from Trac like before, minus any deleted content there were created after the initial import.
| Attachment | Size |
|---|---|
| tracimporter.zip | 13.04 KB |
| tracimporter-2.0.zip | 14.57 KB |

Hey,
I was trying to use your script (thanks for letting it out for public consumption btw!), but I got the following error:
Fatal error: require_once() [function.require]: Failed opening required '[...]/activecollab/application/modules/tracimporter/TracimporterModule.class.php' (include_path='.:/php/includes:/usr/share/pear') in [...]/activecollab/application/modules/system/models/modules/Modules.class.php on line 71
Am I using a newer version of AC that's not compatible? Is there a quick fix?
Thanks!!!
- reply
Submitted by Marcel (not verified) on Jun 29, 2009 - 10:27am.The above file is indeed for aC 1.x. The addition of some files and a bit of refactoring are needed to make it compatible to aC 2.x.
I have already started doing this, but couldn't find the time to finish. I will try complete the update to today, and upload a new version by tomorrow.
Thank you for your interest.
- reply
Submitted by ronn on Jun 30, 2009 - 9:16am.Hi
Thanks for the quick response! If it's just a quick change, you could point me at the documentation and give me a list of what needs doing I'll happily have a bash at it, and send it back to you afterwards.
Cheers
- reply
Submitted by Marcel (not verified) on Jul 01, 2009 - 1:39am.Count me in as another person who'd find an update for 2.x incredibly useful. Thanks Ronn.
- reply
Submitted by Anonymous (not verified) on Jul 06, 2009 - 3:40am.Please see above updates and attachment: tracimporter-2.0.zip
- reply
Submitted by ronn on Sep 11, 2009 - 1:51pm.For active rapidshare users one of the most convenient ways of finding films/music at rapidshare is to use rapidshare SE ( http://rapidqueen.com )
- reply
Submitted by Omari (not verified) on Jun 18, 2010 - 5:27pm.|
casinoonline-the most famous italian casino online rating contact asa@gmail.com
|
Casino online-Italias official online casino guide IF you can afford
|
roulette on line- best casino roulette on line for italian
players is europa casino|
casino online sicuri-migliori casino online sicuri in italia contact asa@gmail.com
|online poker find the top 10 online poker rooms and bonuses IF enamels
|
blackjack online blackjack online in europa casino is the leading casino
- reply
Submitted by Anonymous (not verified) on Jul 12, 2010 - 5:08pm.Post new comment