I need to import from CSV while preserving existing issue numbers
Added by James Brady over 4 years ago
TLDR¶
I am trying to do a CSV import from a very old redmine install to a newer one.
I need the issue numbers to stay the same.
Every time I do the import, the process completes successfully, but all of the issue numbers are just autoincremented, starting at 1 (now ~500, because of repeated attempts).
I'm hoping there's some simple step I'm omitting.
Longer story¶
After creating some of the category and tracker data manually, and creating my users, everything imported ok.
When I exported from my old install, I chose "all columns".
When mapping values in the import wizard, *File Content Preview" shows the proper task numbers in the "#" field (the first field).
I selected the "#" field for "Unique ID". But the numbers just continue to auto increment:
Neither the old nor the new redmine install has any connection to our code repos.
But we still reference these issue numbers all over the place.
I googled to see if anyone else had the same issue, and found nothing.
All of the closely related problems I've seen on the forums are either very old or using a plugin (I'm just using the built-in Import feature), and none of them seem to mention this particular issue at all.
As I said before, we reference these issue numbers in lots of places.
It will add considerable difficulty if we have to adjust all of these references to point to new numbers for these existing tasks.
Old:
Environment: Redmine version 2.0.3.devel.10073 Ruby version 1.9.3 (x86_64-linux) Rails version 3.2.6 Environment production Database adapter Mysql2 Redmine plugins: no plugin installed
New:
Environment: Redmine version 4.1.1.stable Ruby version 2.5.8-p224 (2020-03-31) [x64-mingw32] Rails version 5.2.4.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Git 2.27.0 Filesystem Redmine plugins: no plugin installed
Replies (2)
RE: I need to import from CSV while preserving existing issue numbers - Added by James Brady about 4 years ago
So, does using csv import mean that the issue numbers will irrevocably change, and there's no way to prevent/mitigate that?
RE: I need to import from CSV while preserving existing issue numbers - Added by Bernhard Rohloff about 4 years ago
James Brady wrote:
So, does using csv import mean that the issue numbers will irrevocably change, and there's no way to prevent/mitigate that?
That's exactly how it works. The new Redmine doesn't know anything about the old instance. It just creates a new issue for every row in your CSV file.
If you would like to upgrade your database to a newer version of Redmine I think an upgrade in multiple steps (2.0 -> 2.6 -> 3.4 -> 4.1.1) should work fine. As there aren't any plugins installed, this shouldn't be a huge deal.
And as always...
... don't forget to backup your database first. ;-)