Skip to content

Migrate Sqlite to Postgresql #433

Answered by tuetenk0pp
tuetenk0pp asked this question in Q&A
Discussion options

You must be logged in to vote

Sooo, migration from sqlite to postgres is actually quite simple. Here's how I did it:

  • set up postgres as described in the tandoor docs
  • install pgloader on your local machine (use WSL if you're on Windows)
  • grab a copy of the sqlite database, in my case recipes.db
  • set up a .load file for pgloader. Here's an example: sqlite.load.txt. Please remember to remove the .txt extention if you're working off that sample file.
  • type pgloader sqlite.load and hope for no errors

sqlite.load sample:

load database
	from /PATH/TO/recipes.db
	into postgresql://djangouser:password@PSQLHOSTNAME:5432/djangodb

with no truncate, create tables, include drop, create indexes, reset sequences, downcase identifier…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@tuetenk0pp
Comment options

Comment options

You must be logged in to vote
2 replies
@vabene1111
Comment options

@tuetenk0pp
Comment options

Answer selected by tuetenk0pp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants