<p>By default, Craft won’t backup the data in these tables:</p>
<p><a href="https://github.com/craftcms/cms/blob/develop/src/db/Connection.php#L215-L222" rel="nofollow noreferrer">https://github.com/craftcms/cms/blob/develop/src/db/Connection.php#L215-L222</a></p>
<p>So those could be good candidates if you're looking to exclude data.</p>
<p>You don't say how the backup was make (psql vs. pg_dump, single line inserts vs. multiline, etc.), but generally speaking, using <a href="https://www.postgresql.org/docs/current/app-pgdump.html" rel="nofollow noreferrer">pg_dump</a> with <code>--format=custom</code> so it does a binary dump and pairing it with <code>pg_restore</code> is going to be faster than plain text based dumps to restore.</p>

CC BY-SA 4.0
2023-06-13T08:03:10.767Z
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 !
emilie zawadzki
CC BY-SA 4.0
2023-06-09T18:07:51.433Z
2023-06-09T18:07:51.433Z
Brad Bell
<p>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.</p>
<p>Did you faced this kind of issue ?</p>
<p>Do you advice to run more parallel postgres jobs or to remove some useless tables ?</p>
<p>[EDIT]
I am using the classic craft cli command :</p>
<pre><code>craft db/backup
</code></pre>
<p>All the best,</p>
<p>Emilie</p>

<postgresql>
Import database too long
# Import database too long

(Asked by: username_0 on 2023-06-09)

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

**Tags:** postgresql


---

## 1 answers

### Answer by username_1 on 2023-06-09. Score: 0 | Accepted answer

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](https://www.postgresql.org/docs/current/app-pgdump.html) 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.

> **Comments:**
> **username_0**: 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 !  

---

