Edgewall Software

Ticket #2439 (closed defect: wontfix)

Opened 3 years ago

Last modified 3 years ago

SQLite -> Postgres migration doesn't set ticket/report id as serial resulting in inability to create tickets and reports

Reported by: ben@… Owned by: jonas
Priority: normal Milestone:
Component: general Version: devel
Severity: blocker Keywords:
Cc:

Description

When doing an upgrade from a sqlite 3 backend to a Postgres backend, the SQLite dump does not set the ticket id as 'serial', merely as an int. This means new ticket creation fails since no ID is supplied during this.

Fixing the issue is rather simple, but should probably be mentioned on the TracUpgrade doc regarding Postgres as the instructions there result in a system that doesn't let you make new tickets. There's likely a shorter Postgres command to create this, but I don't know it obviously.

> psql trac_database
trac_database=> select id from ticket order by id desc limit 1;
# Use this number + 1 as NUM
trac_database=> create sequence ticket_id_seq increment by 1 start with NUM;
trac_database=> alter table ticket alter column id set default nextval('public.ticket_id_seq'::text);

Creating new tickets then works as usual.

Attachments

Change History

Changed 3 years ago by ben@…

  • component changed from ticket system to general
  • summary changed from SQLite -> Postgres migration doesn't set ticket id as serial resulting in inability to create tickets to SQLite -> Postgres migration doesn't set ticket/report id as serial resulting in inability to create tickets and reports

I should also note, this affects Reports as well and perhaps other tables (though I haven't hit any furthor problems... yet).

Changed 3 years ago by mgood

  • status changed from new to closed
  • resolution set to wontfix

Using the SQLite dump to convert to PostgreSQL is not officially supported, and I've removed it from the TracUpgrade page for now since it apparently doesn't work quite as expected. I've entered #2441 since what's needed is an actual script to move the data from SQLite to PostgreSQL so that it can address the necessary steps needed to do the conversion properly.

Add/Change #2439 (SQLite -> Postgres migration doesn't set ticket/report id as serial resulting in inability to create tickets and reports)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.