Edgewall Software
Modify

Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#3521 closed enhancement (worksforme)

Updates sourceforge2trac.py to work with at least trac 0.9.6

Reported by: grim@… Owned by: Christian Boos
Priority: normal Milestone:
Component: contrib Version: 0.9.6
Severity: normal Keywords: helpwanted contrib review
Cc: wojdyr@…, techtonik@…
Release Notes:
API Changes:

Description

This updates the necessary field names for the script to run correctly. I have however run into an issue with the way the script is built and the way sourceforge stores mass updates to tickets in the xml dump. And that being that time stamps get duplicated when comments were added very shortly after a mass comment addition. This isn't major, but due to my current lack of time, the script does not handle this at all and dies out. There is however a commented out line to help you find the culprit and then adjust the time in the xml file directly.

Attachments (5)

sourceforge2trac.py.diff (4.2 KB) - added by grim@… 10 years ago.
the patch
sourceforge2trac.py.2.diff (4.9 KB) - added by grim@… 10 years ago.
the working patch…
sourceforge2trac-mvanbaak.py.diff (4.6 KB) - added by mvanbaak 9 years ago.
My patch
sourceforge2trac-patch.txt (4.8 KB) - added by dossy@… 9 years ago.
sourceforge2trac-patch.txt
sfn2trac.py (19.9 KB) - added by wojdyr@… 9 years ago.
a new import script

Download all attachments as: .zip

Change History (24)

Changed 10 years ago by grim@…

Attachment: sourceforge2trac.py.diff added

the patch

comment:1 Changed 10 years ago by anonymous

Guess I should have tested this better… new patch coming shortly…

Changed 10 years ago by grim@…

Attachment: sourceforge2trac.py.2.diff added

the working patch…

comment:2 Changed 10 years ago by grim@…

Theres the working patch…

comment:3 Changed 10 years ago by anonymous

Hi,

Last night we patched the latest version of sourceforge2trac.py with the 2nd attached diff and were able to successfully import our sourceforge project. So, I think it is safe to commit the patch if anyone around can do that.

Thank you so much for your help and hard work!

Cheers, Mark

comment:4 Changed 10 years ago by Christian Boos

Keywords: helpwanted added
Milestone: none

comment:5 Changed 9 years ago by mvanbaak

I've been working on this as well last night. I was not able to import my projects and started work on the script without having a look on the trac tickets first *DUH*

I can upload a diff where I first create a sql query before running execute so it's even easier to find ticket_change queries that wont work because of the same time/ticket/field values.

What I did was drop the table and recreate it without the UNIQUE constraint before running this script.

Changed 9 years ago by mvanbaak

My patch

comment:6 Changed 9 years ago by osimons

Milestone: not applicable0.11.1

Is there any reason why we should not just update this in /contrib? I looks a lot more sound than the current import script that still uses kind= for enum types…

However, I won't be testing it myself so I can just commit it as-is on blind faith - thinking it will anyway be much better than what we currently have in trunk…

comment:7 Changed 9 years ago by grim@…

Doesn't matter to me as I don't have any more projects at sf ;)

comment:8 Changed 9 years ago by osimons

BTW: It would be great if anyone with recent success with this script can verify that #2808 is no longer an issue - ie. using Postgres and non-ascii characters in tickets.

Changed 9 years ago by dossy@…

Attachment: sourceforge2trac-patch.txt added

sourceforge2trac-patch.txt

comment:9 Changed 9 years ago by dossy@…

I just uploaded sourceforge2trac-patch.txt which includes the changes I needed to make to get the sourceforge2trac.py script to import the tracker export into trac-0.10.4. The diff is against SVN trunk as of a few minutes ago.

I'm not too thrilled about mvanbaak's patch as it removes the use of bind variables (ick).

comment:10 Changed 9 years ago by lucor@…

I've tried the sourceforge2trac-patch.txt against trac 0.11b2 with SQLite version 3.5.7. It works fine except the changetime value that generate a "TypeError?: a float is required" when I try to browse te ticket. To fix it I've executed the following query:

update ticket set changetime=0;

Regards, Luca

comment:11 Changed 9 years ago by lucor@…

To set the correct data I've executed for each ticket the following query:

update ticket set changetime=(select distinct time from ticket_change where ticket=$i) where id = $i;

where $i is the ticket id Regards, Luca

comment:12 Changed 9 years ago by anonymous

I'm attaching a new script sfn2trac.py for SF import, that was just used for wxWidgets/wxPython migration ( http://trac.wxwidgets.org/ ).

It takes a file in different format as an input (a new SF backup file) and imports also attachments and users.

Changed 9 years ago by wojdyr@…

Attachment: sfn2trac.py added

a new import script

comment:13 Changed 9 years ago by Marcin Wojdyr <wojdyr@…>

Cc: wojdyr@… added

I submitted the new script here: http://trac-hacks.org/wiki/SfnToTracScript

comment:14 Changed 8 years ago by Christian Boos

Keywords: contrib added
Milestone: 0.11-retriagenot applicable

comment:15 Changed 7 years ago by anatoly techtonik <techtonik@…>

Cc: techtonik@… added

Will it be removed from contrib/ with not applicable milestone or just wait until somebody contributes a better patch?

comment:16 Changed 7 years ago by John Hampton

Keywords: review added

I'm all for removing it from contrib and just leaving it on http://trac-hacks.org.

comment:17 Changed 7 years ago by Christian Boos

Component: generalcontrib
Owner: changed from Jonas Borgström to Christian Boos

Let's just do that then.

We should keep in contrib the scripts actively maintained.

Same thing for bugzilla2trac and others, when someone feels like starting a "fork" and maintain it on TracHacks or elsewhere, we'll also remove it.

Too bad for my just created contrib component ;-)

comment:18 Changed 7 years ago by Christian Boos

Milestone: not applicable
Resolution: worksforme
Status: newclosed

Wait, looks like the contrib/sourceforge2trac.py is now more up to date than this sfn2trac.py script (which was not really maintained there either after the initial code drop).

So if someone feels like creating a NewHack from the current sourceforge2trac.py script, please do so, in the meantime there's no harm in keeping it in the contrib (as it can then get the occasional update, like happened for r9169).

comment:19 in reply to:  18 Changed 7 years ago by wojdyr@…

Replying to cboos:

Wait, looks like the contrib/sourceforge2trac.py is now more up to date than this sfn2trac.py script (which was not really maintained there either after the initial code drop).

I'm the maintainer of sfn2trac.py. The script haven't been updated since we finished the migration of wxWidgets to Trac, because I haven't got any feedback from other users and I even don't know if anyone else was considering using this script.

I guess that there are not that many people doing migrations, and most of them probably just finds the official script and is not aware of the alternative. I'm not for removing the official script from contrib/, but it could be useful for some users if you put a comment in this script with a link to sfn2trac.py. AFAICS the script in contrib/ still can't download attachments, so sfn2trac.py can be more useful in some cases.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.