Edgewall Software
Modify

Ticket #2439 (closed defect: wontfix)

Opened 6 years ago

Last modified 6 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:
Release Notes:
API Changes:

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

comment:1 Changed 6 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).

comment:2 Changed 6 years ago by mgood

  • Resolution set to wontfix
  • Status changed from new to closed

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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.