How to load metabase's database backup inside Docker container?

If anyone still having this problem, here is what i did and worked well:

First, backup the metabase.db directory (yes, it is a folder inside /):

docker cp metabase:/metabase.db /home/metabase

To restore into a new container:

 docker run -d -p 3001:3000 --name metabase2 -v /home/metabase/metabase.db:/metabase.db -e "MB_DB_FILE=/metabase.db" metabase/metabase

Notice that i’ve changed the exposed port to 3001 and container name to metabase2.
If i hit http://localhost:3001 then it is all good.

2 Likes