# Backup database

**URL:** <https://discuss.tryton.org/t/backup-database/8940>\
**Category:** System Administrator\
**Created:** [November 11, 2025, 7:44am UTC](https://discuss.tryton.org/t/backup-database/8940 "2025-11-11T07:44:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spec001](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@spec001](https://discuss.tryton.org/u/spec001)\
**Post date:** [November 11, 2025, 7:44am UTC](https://discuss.tryton.org/t/backup-database/8940/1 "2025-11-11T07:44:21Z")

</div>

Hi! How can I create a backup of the Triton database from within the app? I couldn’t find a backup option in the program. If there’s another recommended way, could you please point me to it? Thanks!

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [November 11, 2025, 8:37am UTC](https://discuss.tryton.org/t/backup-database/8940/2 "2025-11-11T08:37:51Z")

</div>

There is no option to create backup directly from tryton. You should use the tools of your database in order to backup it

You can have a look at the following reply which explains the process for PostgreSQL:

> [@Backup databases](https://discuss.tryton.org/t/backup-databases/7559/2):
>
> You need to dump all the data of your database with [pg\_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and use [pg\_restore](https://www.postgresql.org/docs/current/app-pgrestore.html) to restore them on the other server. You also need to copy all the files create in the [[database] path](https://docs.tryton.org/latest/server/topics/configuration.html#path) on the other server. And you need to reinstall the same version of each Tryton packages and configure trytond the same way (mainly using a copy of the current configuration but updated to the new server).

---

<div class="post-metadata">

**Author:** ![spec001](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@spec001](https://discuss.tryton.org/u/spec001)\
**Post date:** [November 11, 2025, 10:00am UTC](https://discuss.tryton.org/t/backup-database/8940/3 "2025-11-11T10:00:32Z")

</div>

Please tell me how to run **pg\_dump** when Tryton is running in Docker and PostgreSQL is inside the container.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [November 11, 2025, 10:43am UTC](https://discuss.tryton.org/t/backup-database/8940/4 "2025-11-11T10:43:46Z")

</div>

To run pg\_dump when Tryton and PostgreSQL are in Docker containers, first find the PostgreSQL container’s name or ID using `docker ps`. Then, execute `docker exec <postgres_container_name_or_id> pg_dump -U <your_postgres_user> -d <your_tryton_database_name> > tryton_dump.sql` to create a dump file outside the container.

If you want the dump file inside the container, redirect the output to a path within the container, for example: `docker exec <postgres_container_name_or_id> pg_dump -U <your_postgres_user> -d <your_tryton_database_name> > /tmp/tryton_dump.sql` and then use `docker cp <postgres_container_name_or_id>:/tmp/tryton_dump.sql .` to copy it to your host.

P.S: I just used “Ask AI” feature from discuss to generate this reply.
