Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2439 closed defect (wontfix)

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 Borgström
Priority: normal Milestone:
Component: general Version: devel
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal 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 (0)

Change History (2)

comment:1 by ben@…, 19 years ago

Component: ticket systemgeneral
Summary: SQLite -> Postgres migration doesn't set ticket id as serial resulting in inability to create ticketsSQLite -> 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 by Matthew Good, 19 years ago

Resolution: wontfix
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.