Problems with updating Metabase in Docker

Hi all!!!
I can't understand why when I update Metabase in Docker, I don't save data about reports and the database itself (I use an external database).
I'm following this process:
docker stop "container-name"
docker pull metabase/metabase:latest
docker run -d -p 80:3000 --name metabase metabase/metabase
My question is: What do I have to do to keep all my Metabase data and configuration settings after the upgrade so that I don't have to configure everything all over again.
I would appreciate your help)

Hi @bbrudastyy
Because you are using H2 in the container instead of storing it outside of the container or using a proper external database.
Please read this: https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html

Hi @flamber
I am using an external database that is stored in another container on the same server

@bbrudastyy Your Docker commands says otherwise. I think you are misunderstand the difference between the Metabase application database, where Metabase stores all its information, and your data source.

@flamber Now I see what you mean. I will try to follow the instructions you sent me.

@flamber
I have now copied the configuration with
docker cp CONTAINER_ID:/metabase.db ./
Then I installed from the new image like this:
docker run -d -p 80:3000 -v ~/metabase-data:/metabase-data -e "MB_DB_FILE=/metabase-data/metabase.db" --name metabase1 metabase/metabase
But on startup, Metabase still asks to reconfigure.
What is my mistake?

@bbrudastyy Post the output of ls -l ~/metabase-data/
If the actual H2 file is ~/metabase-data/metabase.db/metabase.db.mv.db, then you should use MB_DB_FILE=/metabase-data/metabase.db/metabase.db
And make sure that you're using the correct permissions.

But I can only recommend strongly that you don't use H2 if you are using Metabase in production: https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

@flamber It all worked out for me. Thank you very much for your help)