vendredi 8 janvier 2016

How to migrate from sqlite to postgresql

I have Rails app created initially with sqlite3. Now I have a need to move it to Postgres with all the data.

I tried to do it as suggested here.

sqlite3 development.db .dump | psql dbname username

In my case:

sqlite3 development.sqlite3 .dump | psql dev_db deployer

And I got this:

ERROR:  syntax error at or near "PRAGMA"
LINE 1: PRAGMA foreign_keys=OFF;
    ^
BEGIN
ERROR:  syntax error at or near "AUTOINCREMENT"
LINE 1: CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMEN...

Are those just SQL implementation differences? How can I solve it?

Aucun commentaire:

Enregistrer un commentaire