Date from Trac not importing correctly

shinyidol July 1, 2011

I'm evaluating JIRA using a Trac database. Everything imported correctly accept for the date field. It imported every date as 20/31/69 04:20 PM. This is for opened, updated, resolved date.

I tried looking into the Day/Month/Year Format in JIRA and it didn't seem to matter. The date in Trac is correct.

Any ideas?

7 answers

1 vote
Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2011

I just glanced at the import code, and it looks like JIRA is expecting that trac stores the dates as timestamps - microseconds since epoch.

final Long ts = rs.getLong(column);
return (ts != null && ts != 0) ? new Date(ts / 1000) : null; // they store timestamps in microseconds since epoch, we need miliseconds

Can you confirm if that is what you are seeing in the trac source database?

0 votes
Pradeep Pamidipalli January 26, 2012

I have faced the same problem while migrating from Trac to Jira. We were using trac 0.11.7 version. All the tickets that were imported to Jira were displaying date as Jan 01 1970.

The best way to handle issues with the tickets creation time is to upgrade your trac to 0.12 version. Follow the simple steps to upgrade to latest trac version:

Step 1: easy_install --upgrade Trac==0.12.2

Step 2: trac-admin <location of our trac environment> upgrade

Example: trac-admin E:\TracEnv upgrade

These two steps will surely resolve the probelms related to time creation dates of the tickets. An import after the upgradation will show you the correct dates.

Thanks,

Pradeep

0 votes
Jan Philipp July 12, 2011

I have the same problem, importing data from a Trac 0.11.7 into a current JIRA 4.3.

What is you idea? Fixing the trac-db before?

-Jan

0 votes
Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 5, 2011

What version of trac are you migrating from?

Looks like early last year trac switched to storing microseconds for their timestamps - http://trac.edgewall.org/changeset/9210

I'm wondering if then JIRA was updated to handle this but you are updating from an older version of trac??

0 votes
shinyidol July 5, 2011

So what should the value be?

Trac is sending this value, 1246465866 which is being recorded as 1969-12-31 16:20:46.465-08 in the SQL in jiraissues.created

0 votes
shinyidol July 5, 2011

Trac is sending this value, 1246465866 which is being recorded as 1969-12-31 16:20:46.465-08 in the SQL in jiraissues.created

0 votes
shinyidol July 4, 2011

I checked the code today and it is stored as normal UNIX time stamp in the database.

Tried to import again, and came in as the same thing.

Suggest an answer

Log in or Sign up to answer