1

I am trying to optimize sql dump postgres database importation. My dumps weights about 1.5Go and it takes about 2 hours to import schema and data. My architecture is dockerized.

Did you faced this kind of issue ?

Do you advice to run more parallel postgres jobs or to remove some useless tables ?

[EDIT] I am using the classic craft cli command :

craft db/backup

All the best,

Emilie

1 Answer 1

0

By default, Craft won’t backup the data in these tables:

https://github.com/craftcms/cms/blob/develop/src/db/Connection.php#L215-L222

So those could be good candidates if you're looking to exclude data.

You don't say how the backup was make (psql vs. pg_dump, single line inserts vs. multiline, etc.), but generally speaking, using pg_dump with --format=custom so it does a binary dump and pairing it with pg_restore is going to be faster than plain text based dumps to restore.

1
  • True, these tables are already empty : assetindexdata, assettransformerindex, cache, sessions, templatecaches, templatecachecriteria, templatecacheelements. I will use pg_dump which is more low level with more options. Thanks ! Commented Jun 13, 2023 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.