# Docker Backup and Restore Question

**URL:** https://meta.discourse.org/t/docker-backup-and-restore-question/268740
**Category:** Self-hosting
**Created:** [June 17, 2023, 4:02pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740 "2023-06-17T16:02:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Taste-OF-IT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taste-of-it/32/303842_2.png) [@Taste-OF-IT](https://meta.discourse.org/u/Taste-OF-IT)
#### Post date: [June 17, 2023, 4:02pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/1 "2023-06-17T16:02:52Z")

</div>

Hi, i have Discourse CE run in Docker. I have root rights and i backup the container with docker id stop and docker image save -o file.tar. After that i upgrade discourse successfull. Now i tested the restore with docker image load -i file.tar and docker start id, but its still the upgrade version and not the old one as i aspekted.  
What did i wrong?

thx

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 17, 2023, 4:09pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/2 "2023-06-17T16:09:19Z")

</div>

That is strange.

I would expect it not to work since the database (which is in persistant storage) had been migrated past what the old image can support.

How did you upgrade? From the command line with a rebuild or from the Discourse UX?

---

<div class="post-metadata">

### Author: ![Taste-OF-IT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taste-of-it/32/303842_2.png) [@Taste-OF-IT](https://meta.discourse.org/u/Taste-OF-IT)
#### Post date: [June 17, 2023, 4:47pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/3 "2023-06-17T16:47:19Z")

</div>

Hi,  
yes i didnt understand that too. I try it again with same result. I gave the Web UI a chance and it works good. No errors no problems.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 17, 2023, 6:26pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/4 "2023-06-17T18:26:23Z")

</div>

Did you destroy the Discourse docker image or restore the backup to a different one?

---

<div class="post-metadata">

### Author: ![Taste-OF-IT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taste-of-it/32/303842_2.png) [@Taste-OF-IT](https://meta.discourse.org/u/Taste-OF-IT)
#### Post date: [June 17, 2023, 7:17pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/5 "2023-06-17T19:17:00Z")

</div>

No i didnt destroy the image. Was that my failure?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 17, 2023, 7:49pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/6 "2023-06-17T19:49:28Z")

</div>

I don’t know. I don’t think I have used image save before.

But I think I would try next to restore that backup to a new container name.

---

<div class="post-metadata">

### Author: ![Taste-OF-IT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taste-of-it/32/303842_2.png) [@Taste-OF-IT](https://meta.discourse.org/u/Taste-OF-IT)
#### Post date: [June 17, 2023, 10:23pm UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/7 "2023-06-17T22:23:52Z")

</div>

Sorry missing answer for your question. It was the same one, just backup and restore.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [June 18, 2023, 1:29am UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/8 "2023-06-18T01:29:47Z")

</div>

> [@Taste-OF-IT](#):
>
> i backup the container with docker id stop and docker image save -o file.tar

The persistent data is stored not in the container but on the filesystem as @pfaffman mentions.

We should ask: What task are you attempting to accomplish?

---

<div class="post-metadata">

### Author: ![Taste-OF-IT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taste-of-it/32/303842_2.png) [@Taste-OF-IT](https://meta.discourse.org/u/Taste-OF-IT)
#### Post date: [June 18, 2023, 11:08am UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/9 "2023-06-18T11:08:46Z")

</div>

The idea was simple to backup the whole docker container at night. Also like in this case bevor the upgrade from beta4 to beta5 and in case of an error, revert to the old container.  
thx

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 19, 2023, 9:46am UTC](https://meta.discourse.org/t/docker-backup-and-restore-question/268740/10 "2023-06-19T09:46:38Z")

</div>

You would also need to revert the database.

You might want a staging site to test the upgrade before you run it. You could also push the container from the staging site to a repo and then launch that on the production site.
