DjangoCMS Migration from sqlite3 to postgres

Big surprise: Dumping from sqlite3 doesnt seem to generate SQL that can be read correctly by postgres.

Thankfully, in django we have a high-level export / import function.

Export everything to json from db.sqlite3:

./ dumpdata > db.json

Then switch your local djangoCMS installation to postgres (don’t forget to reload your env vars in case they contain your db settings).

createdb db-name
./manage migrate
# the following works on a mac (possibly because of the
# the following tables need to be flushed because they are populated with default data that collides with the imported data
delete from auth_group_permissions; delete from auth_permission; delete from django_admin_log; delete from django_content_type;
# now you can import
./ loaddata db.json
# doesnt hurt
./ cms fix-tree