[wx-dev] sf->trac import script
Robin Dunn
robin at alldunn.com
Sat May 3 22:09:57 PDT 2008
Marcin Wojdyr wrote:
> I'm attaching the import script - it's ready for testing. The first
> part of the file is configuration - how SF tracker fields are mapped
> to Trac fields.
I've attached a patch for some minor tweaks I've made to the script.
The site is accessible at http://trac.wxwidgets.org for people to play =
with. I propose that we don't go live with it quite yet, until we're =
finished with any initial tweaks that people suggest. I can reload the =
DB from a new SourceForge export at that time.
> =
> The script write a list of users to a text file. To enable transition
> of user accounts we will need AccountManagerPlugin, which can reset
> password and email a new password to user. It probably should be
> configured with password_store=3DSessionStore.
> I'll write a simple script that imports users later.
Have you done this yet?
I noticed the PREFORMAT_COMMENTS option in your script, but I didn't =
activate it. Now I see why it would make sense to do so, to prevent =
unwanted WikiName links in the tracker descriptions. (See =
http://trac.wxwidgets.org/ticket/4819 for example.) Does anybody know =
if there is an option or a plugin that will disable the auto WikiName =
linking in ticket descriptions? (They could still be done explicitly =
like [wiki:TheName].) If not then I think it would probably be better =
to use the preformatting option when reloading. There is an option for =
this for changeset messages, so I've turned it off there. However that =
means that the messages will be rendered as preformatted text without =
word-wrap.
I've installed several plugins, although some on Vadim's list a few =
weeks ago wouldn't install, mainly because of version conflicts and =
such. Here's the ones that are installed:
BreadCrumbsNavPlugin
AccountManager
MasterTickets
ProgressMeterMacro
Screenshots
SpamFilter
TagsPlugin
The AccountManager plugin will allow you to make your own accounts, =
although I wish that it would do an email verification. For the people =
with bugs assigned to you I suggest you use the same user ID as you have =
on Sourceforge so the existing tracker items will be assigned to you as =
needed.
I've noticed that queries with large result sets can cause Trac to crash =
when it is running via FastCGI. The same thing works with plain CGI, =
but slows things down more than we would want. Still not sure what is =
going on with that yet, in the meantime I've set the items_per_page =
option to 200 (this is a feature added in the 0.11 release candidate.) =
It looks like anything else that generates a very large page could have =
the same problem. Apache will automatically start a new instance of the =
FastCGI process when needed.
-- =
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
-------------- next part --------------
--- sfn2trac.py.orig 2008-05-03 15:20:07.000000000 -0700
+++ sfn2trac.py 2008-05-03 16:43:00.000000000 -0700
@@ -20,15 +20,23 @@
# the XML backup file. =
=
=
-##################### settings -- edit before running ####################=
###
+import sys
=
-# Path to the SourceForge's "new" backup file. =
-# This file can be downloaded *only by project administrator* from =
-# https://sourceforge.net/export/xml_export2.php?group_id=3D<project group=
id>
-SF_EXPORT2 =3D "export2.xml"
+try:
+ # Path to the SourceForge's "new" backup file. =
+ # This file can be downloaded *only by project administrator* from =
+ # https://sourceforge.net/export/xml_export2.php?group_id=3D<project g=
roup id>
+ SF_EXPORT2 =3D sys.argv[1] #"wxwindows_export2.xml"
=
-# Path to the Trac environment.
-TRAC_ENV =3D "/home/wojdyr/local/var/trac/"
+ # Path to the Trac environment.
+ TRAC_ENV =3D sys.argv[2] =
+ =
+except IndexError:
+ print "Usage: %s export_file trac_env_dir" % sys.argv[0]
+ sys.exit()
+ =
+ =
+##################### settings -- edit before running ####################=
###
=
IMPORT_SF_TRACKERS =3D [
"Bugs",
@@ -217,8 +225,11 @@
import time
import urllib
import socket
-import xml.etree.cElementTree as ET
-
+try:
+ import xml.etree.cElementTree as ET
+except ImportError:
+ import cElementTree as ET
+ =
from trac.env import Environment
from trac.attachment import Attachment
=20
More information about the wx-dev
mailing list