# Is dump from within Docker safe?

**URL:** <https://forum.gitea.com/t/is-dump-from-within-docker-safe/5402>\
**Category:** Install/Maintain/Configure\
**Created:** [June 26, 2022, 3:35pm UTC](https://forum.gitea.com/t/is-dump-from-within-docker-safe/5402 "2022-06-26T15:35:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simmonmt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/simmonmt/32/2763_2.png) [@simmonmt](https://forum.gitea.com/u/simmonmt)\
**Post date:** [June 26, 2022, 3:35pm UTC](https://forum.gitea.com/t/is-dump-from-within-docker-safe/5402/1 "2022-06-26T15:35:23Z")

</div>

The Backup [instructions](https://docs.gitea.io/en-us/backup-and-restore/) start off with:

> To ensure the consistency of the Gitea instance, it must be shutdown during backup.

But then the backup [Using Docker](https://docs.gitea.io/en-us/backup-and-restore/#using-docker-dump) instructions provide a command line for running `gitea dump` inside the running container.

How are those two not at odds? `docker exec` doesn’t stop the container, so the service is still running. `gitea dump` doesn’t seem to do anything special to pause the service, so how do we not run the risk of an inconsistent backup?

Is there a safe way to take a backup of a Docker Gitea?

---

<div class="post-metadata">

**Author:** ![dachary](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dachary/32/4990_2.png) [@dachary](https://forum.gitea.com/u/dachary)\
**Post date:** [June 26, 2022, 10:04pm UTC](https://forum.gitea.com/t/is-dump-from-within-docker-safe/5402/2 "2022-06-26T22:04:22Z")

</div>

These [instructions](https://docs.gitea.io/en-us/backup-and-restore/#using-docker-dump) are indeed inconsistent with [the recommendation for consistency](https://docs.gitea.io/en-us/backup-and-restore/#backup-consistency) and should be updated.

Assuming the Gitea instance was installed as per [the docker instructions](https://docs.gitea.io/en-us/install-with-docker/), the safest way to perform a backup is to shutdown the container, dump the SQL database and save the file system directory. And the start the container again. See the [backup section of the Hostea upgrade guide](https://forum.hostea.org/t/howto-gitea-upgrades-a-guide-for-admins/39#backup-1) for more details.

---

<div class="post-metadata">

**Author:** ![friedrichsenm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/friedrichsenm/32/6281_2.png) [@friedrichsenm](https://forum.gitea.com/u/friedrichsenm)\
**Post date:** [September 23, 2024, 3:53pm UTC](https://forum.gitea.com/t/is-dump-from-within-docker-safe/5402/3 "2024-09-23T15:53:34Z")

</div>

The link to Hostea isn’t working for me. Do you have a working link?
