Project

General

Profile

Help! trac to redmine migration problem

Added by Don Doffe over 12 years ago

Hi,

I'm new to RoR, Ruby and Redmine. Nevertheless I would like to set up and run redmine.
The problem is migration from Trac:

PGError: ERROR: timestamp out of range: "40780483-05-28 22:03:50.802674"

: INSERT INTO "wiki_pages" ("wiki_id", "title", "created_on", "protected", "parent_id") VALUES
/u00/redmine/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'

Attaching the whole logfile.

Postgres 8.1.23 running on RHEL 5.7.

Could someone please indicate what could I do to fix?

Thank you.

error.log (6.02 KB) error.log

Replies (4)

RE: Help! trac to redmine migration problem - Added by Don Doffe over 12 years ago

timestamp as in trac - "1286845590164631"

RE: Help! trac to redmine migration problem - Added by B V over 12 years ago

Did you find a solution to this? I'm having the exact same problem. I'd REALLY love to get my company's projects off of Trac and move them to Redmine. Somebody please help :)

Some useful information:
postgresql 8.4.2
ruby 1.8.7
rails 2.3.11
pg (0.11.0)
rack (1.1.2, 1.1.1)
rake (0.8.7)

RE: Help! trac to redmine migration problem - Added by Slava K over 12 years ago

I've ran into this issue and was able to resolve it. The proper unix timestamp format is 10 digits. In my case, all the time stamps in the Trac database were 16 digits - the first 10 digits were the proper time stamp, followed by 6 0s. In order to fix it, I ran the query below on all the columns that stored time stamps in every table that had them:

UPDATE public.ticket SET time = time / 1000000 where time > 9999999999;

After setting all the time stamps in the database to proper format, the Trac to Redmine script worked successfully. Hope this helps

RE: Help! trac to redmine migration problem - Added by Sean Gollschewsky about 11 years ago

To save others having to sift through each table, here's the ones that I found I had to run the above query on (obviously with table and column names changed appropriately)...

update ticket set changetime = changetime / 1000000 where changetime > 9999999999;
update wiki set time = time / 1000000 where time > 9999999999;
update milestone set due = due / 1000000 where due > 9999999999;
update attachments set created_on = created_on / 1000000 where created_on > 9999999999;
update revision set time = time / 1000000 where time > 9999999999;
update ticket_change set time = time / 1000000 where time > 9999999999;

    (1-4/4)