#✅ SQLite -> PostgreSQL (moving data)

14 messages · Page 1 of 1 (latest)

pseudo blaze
#

Hi,

I can apply the snapshot created with the server cli from SQLite to a new PostgreSQL database but I find myself in the position of needing to also copy over all the data from SQLite.

I tried dumping all the tables from SQLite and using psql -f to populate the new pg db and also using pgloader, but the data type differences make it tricky.

Could anyone suggest a tool to take table dumps from SQLite and insert them into tables in Postgres created with directus’ snapshot apply? I have 3-4K rows.

Thanks for any help,
Gav

void pantherBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

grizzled goblet
#

Oof 🤦‍♂️ I went through this myself once. Tried several different tools I found on StackOverflow threads to try and get it done "easily".

#

Ended up writing a script that used the Directus API instead.

pseudo blaze
#

I was hoping for a npx directus snapshot —with-data flag 😭. If you have anything left from that script, I’d love to take a look.

grizzled goblet
#

not sure how it reacts with a large set of data but should put you on the right track

sinful gate
#

How much data do you have

pseudo blaze
#

The db is only 3mb and that includes all the directus data, it’s mainly contacts data, 3-4K rows I think.

void pantherBOT
#

✅ SQLite -> PostgreSQL (moving data)

void pantherBOT
pseudo blaze
#

Closed by mistake

#

I will be taking a look @sinful gate