Migration from SQLite -> PostgreSQL

I want to migrate our PI-Installation from the Test-SQLite to the production-Postgre.
I managed to import structure and data (except auditlog) with the ruby-gem sequel.

Authentication works but when I try to rollout a new token, I get an SQL-Error: (psycopg2.errors.UniqueViolation) FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »token_pkey« DETAIL: Schlüssel »(id)=(6)« existiert bereits.
Is there another way to migrate?


this is a tricky one since Postgres and SQLite are quite different. SQLite only provides a small subset of SQL which can not be easily migrated.
An idea might be to create the Postgres DB and then import only the data into the tables.
Or You could export all policies, events, resolver and realms with pi-manage and the tokens with the token janitor. But You would loose the token assignments.

The migration was no piece of cake!
The problem is not getting data migrated, but restoring functionality. Its my first postgre and I didn’t know these sequences…