Docker Backup and Restore Question

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

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?

1 Like

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.

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

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

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.

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

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?

1 Like

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

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.

2 Likes