# Database backup and restore

**URL:** https://discuss.tryton.org/t/database-backup-and-restore/651
**Category:** Developer
**Created:** [August 14, 2018, 9:05am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651 "2018-08-14T09:05:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![chunjie](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/c/41988e/32.png) [@chunjie](https://discuss.tryton.org/u/chunjie)
#### Post date: [August 14, 2018, 9:05am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/1 "2018-08-14T09:05:39Z")

</div>

Hello, the menu bar canceled the operation of the database after update 4.8. Now I am a little confused about how to operate the backup and restore of the database.  
If the system is used for a long time, a lot of data will be generated, which will affect the query speed.  
Tryton has no archiving mechanism.File those completed orders?  
Thank you very much！

---

<div class="post-metadata">

### Author: ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)
#### Post date: [August 14, 2018, 9:20am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/2 "2018-08-14T09:20:14Z")

</div>

> [@chunjie](#):
>
> Hello, the menu bar canceled the operation of the database after update 4.8. Now I am a little confused about how to operate the backup and restore of the database.

Hello,

You should use the postgresql utilities to do that: [pg\_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) and [pg\_restore](https://www.postgresql.org/docs/current/static/app-pgrestore.html).

> [@chunjie](#):
>
> If the system is used for a long time, a lot of data will be generated, which will affect the query speed.

It shouldn’t but you might have to tune the index your database is using when you encounter a slow query. Take a look at the postgresql [wiki article about EXPLAIN / ANALYZE](https://wiki.postgresql.org/wiki/Using_EXPLAIN) it might help you when you will have the issue.

---

<div class="post-metadata">

### Author: ![chunjie](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/c/41988e/32.png) [@chunjie](https://discuss.tryton.org/u/chunjie)
#### Post date: [August 14, 2018, 9:28am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/3 "2018-08-14T09:28:17Z")

</div>

Thank you very much，  
Do you need to operate at the database level after data backup and recovery?  
Do the restored database and tryton associations need to execute any commands?  
Thank you again for！

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 14, 2018, 10:03am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/4 "2018-08-14T10:03:27Z")

</div>

> [@chunjie](#):
>
> Do you need to operate at the database level after data backup and recovery?  
> Do the restored database and tryton associations need to execute any commands?

Not if you restore on the same version of Tryton that was used to make the backup. Otherwise you need to run an [update](https://trytond.readthedocs.io/en/latest/topics/setup_database.html#update-a-database) like for any version migration.

---

<div class="post-metadata">

### Author: ![chunjie](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/c/41988e/32.png) [@chunjie](https://discuss.tryton.org/u/chunjie)
#### Post date: [August 20, 2018, 1:43am UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/5 "2018-08-20T01:43:06Z")

</div>

I see. Thank you very much！

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [August 20, 2018, 1:43pm UTC](https://discuss.tryton.org/t/database-backup-and-restore/651/6 "2018-08-20T13:43:10Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
