Patch #5035
openMigrate from trac - Errors in wiki formating
60%
Description
I have written a patch for a script of migration from Trac.
The list of the brought changes:- More complete regular expressions in many replacements of formatting wiki pages.
- The first and last name of the user are correctly recognised
- convert [[BR]] - before all
- Titles correctly converted and only h1. to h6. (Also work for #3910)
- External Links correctly converted (include mailto: links)
- Ticket links correctly converted
- Internal Links correctly converted
- Inline code are converted
- Tables are converted
- Lists correctly converted (include numbered)
- Inline images are converted
- Changed default database adapter to sqlite3
The patch works for audit 3517 and above
The additional information is in remarks. The patch works for r3517 and above.
Files
Related issues
Updated by Bryce Nordgren over 14 years ago
Updated by Mike Stupalov over 14 years ago
- File migrate_from_trac.rake migrate_from_trac.rake added
- File migrate_from_trac_v3.patch migrate_from_trac_v3.patch added
- % Done changed from 60 to 70
Very good. I combined these patches.
For migrate svn, use:
rake redmine:migrate_from_trac_svn RAILS_ENV="production"
out:
WARNING: all commit messages with references to trac pages will be modified Are you sure you want to continue ? [y/N] y Subversion repository url []: http://svn.server.dom/project Subversion repository username []: user Subversion repository password []: secret Redmine project identifier []: project-id
Also made a few corrections and additions to convert textile format (including previous):
- Convert macro - [TOC]
- Convert source links.
- In links recognized quotes and double quotes. (Because Trac supports both types of quotes).
remaining problems of converting the format:
- before and after the tables have to add blank lines. (Trac supports a table without the initial and final blank line, and Redmine - no)
- text within the code should be left as is. (now converted to all, including the code.)
Patch: migrate_from_trac_v3.patch
File: migrate_from_trac.rake
Updated by Bryce Nordgren over 14 years ago
Hi Mike,
I closed #5110 as resolved because you incorporated it here. I did some more issue triage over on the forums. There were open issues related to multibyte characters, header imports, "special links", and importing ticket keywords. I also included a "dependency graph" of sorts, indicating which issues tried to address problems raised in which other issues.
I'm new to Ruby, so I constrained myself to highlighting the main issues. I'd be grateful if you took a look. If everything on that page is addressed by your patch, I think a whole slew of issues could be closed when #5035 is.
Check out: http://www.redmine.org/boards/1/topics/12273
Thanks for your work!
Updated by Mike Stupalov over 14 years ago
- File migrate_from_trac.rake migrate_from_trac.rake added
- File migrate_from_trac_v4.patch migrate_from_trac_v4.patch added
Updated version.
Changes:
- completely fixed bugs #3910
- small fixes conversion links.
- added conversion attachments links (ex. [attachment:file.txt]). Closes #2146
- importing Trac keywords (include corrected patch from #2504)
Patch: migrate_from_trac_v4.patch
File: migrate_from_trac.rake
Updated by Mike Stupalov over 14 years ago
- Not converted an attachments in non-latin filename encoding.
- Trac encodes the filenames in hexadecimal number using uppercase letters.
- For the wiki pages also need to encode the subdirectory.
- "Issue categories" not converted "Assigned to" user.
- If specify the "Target project identifier" with a capital letter, then the error occurred.
Patch: migrate_from_trac_v5.patch
While no changes are made to the main repository, I made a fork of the file migrate_from_trac.rake here: http://github.com/landy2005/Redmine-migrate-from-Trac
P.S. All the changes I check on 3 big projects that we want to migrate from Trac.
Updated by Mike Stupalov over 14 years ago
I update migrate_from_trac.rake
Changes:- Changed progress meter to a simple progress bar.
- Moved requires for task ':migrate_from_trac_svn' to own module.
See latest version here: http://github.com/landy2005/Redmine-migrate-from-Trac
Updated by Bryce Nordgren over 14 years ago
Hi Mike,
Still watching your progress and appreciate all your work. I'm actually delaying the migration of our repositories until your improvements are finalized. :)
Thanks again!
Updated by Bryce Nordgren over 14 years ago
- File migrate_from_trac.rake migrate_from_trac.rake added
- % Done changed from 70 to 90
Hi Mike. I'm starting to use this (the version on github) to migrate our collection of Trac instances over to a new server. Great job! :)
I did have to add "PageTemplates" to the list of Trac pages to discard. I also commented out the part that creates a wiki page for every milestone.
I'm bumping this to 90% done just because I think the only thing left to do is have the admins integrate it with the main code base. I can verify that it works with my redmine, which was built from trunk on April 26, 2010.
Updated by Bryce Nordgren over 14 years ago
I know there are too many files named the same thing. This migrate_from_trac.rake is the version from github that I used. It has "PageTemplates" added, but it will still create a wiki page for every milestone.
Updated by Mike Stupalov over 14 years ago
OK, I also add "PageTemplates" to the list of Trac pages to discard. :)
But I do not understand what you propose to do with milestone? In your code, no changes associated with it.
In addition, I discovered another problem. The script does not convert the CC list to watchers. I'm working on correcting this.
Updated by Bryce Nordgren over 14 years ago
Well, in the version I uploaded, I didn't change the milestone part. In the version I used to migrate my trac instances, I commented out the 6 lines that create a wiki page for every milestone. Basically I did this because I have no use for a wiki page with the milestone text on it. The "version" page (with the same text) serves my purposes.
However, I didn't consider that to be an "error", just my personal preference, so I didn't change the code for that part.
Sorry for the confusion.
Updated by Bryce Nordgren over 14 years ago
One thing I did find is that when I converted trac instances where we never bothered to make a personal page (e.g., first name, last name, email), the script now assigns all tickets to Redmine Admin. As a matter of fact, I'm finding that converting trac instances with properly defined users causes the conversion script to create many unwanted accounts. This is mostly because, at the same time I'm switching from Trac to Redmine, I'm also switching from authenticating off of htpasswd
accounts to the corporate Active Directory. I find myself locking the accounts which were created during the conversion process, but which can never be used again due to the conversion.
Updated by Michalis Miatidis over 14 years ago
Everything OK except:
1) Requires merge with Patch #5764 to work with TRAC 0.12
2) At my local installation, migrated everything apart from users with Firstname of single world and Lastname as null.
Updated by patrick Sherman about 14 years ago
Hi,
This rake works perfectly with tickets but not with the wiki.
It stop conversion at the first accent and links with another page are lost.
What should I need to do?
Regards
Updated by Alexander Sapozhnikov about 14 years ago
redmine:migrate_from_trac_svn doesn't work. First time I got message:
Could not find issue custom field 'TracID'
I add custom field TracID
and got new error:
wrong number of arguments (7 for 4)
When spawned with --trace
both on Redmine 0.9.6 and on 1.0.2 too:
path/to/redmine/lib/tasks/migrate_from_trac.rake:910:in `initialize' path/to/redmine/lib/tasks/migrate_from_trac.rake:910:in `new' path/to/redmine/lib/tasks/migrate_from_trac.rake:910:in `scm' path/to/redmine/lib/tasks/migrate_from_trac.rake:873:in `migrate' path/to/redmine/lib/tasks/migrate_from_trac.rake:935
Updated by Alexander Sapozhnikov about 14 years ago
Line 910 is:
@scm ||= SvnExtendedAdapter.new @@svn_url, @@svn_url, @@svn_username, @@svn_password, 0, "", nil
I Updated by Alexander Sapozhnikov about 14 years ago
redmine:migrate_from_trac works, but acts as described in #6632 — it ignore fields lft
, rgt
and root_id
in table issues
.
Updated by Mike Stupalov about 14 years ago
- Assignee changed from Jean-Philippe Lang to Felix Schäfer
- % Done changed from 90 to 60
All many thanks for the found errors.
Unfortunately the main developers redmine don't give attention to a script of migration from trac.
I will try to look at the arisen errors. But in connection with study at me hasn't enough time, therefore fast correction I do not promise :)I will try to look at the arisen errors. But in connection with study at me hasn't enough time, therefore fast correction I do not promise :)
Please send more version informations trac, what database is used, a debug output of a script and certainly a command output:
RAILS_ENV="production" script/about
Updated by Felix Schäfer about 14 years ago
- Assignee deleted (
Felix Schäfer)
Please don't assign issues to anyone who hasn't said to do so, thanks.
Updated by Michał Wróbel about 14 years ago
I made some patches which improve TracWiki conversion.