Metabase backup and restore

Hi guys, I am working on a project where I am using Metabase + Nodered + Postgres each one running on a different docker container plus compose file.
The Metabase docker-compose file is configured as following:

  metabase:
    image: metabase/metabase:latest
    container_name: metabase-secrets
    hostname: metabase-secrets
    volumes: 
    - ./volumes/metabase-data:/dev/random:ro
    ports:
      - 3000:3000
    environment: 
      MB_DB_TYPE: postgres
      MB_DB_DBNAME: metabase
      MB_DB_PORT: 5432
      MB_DB_USER: postgres
      MB_DB_PASS: 1234
      MB_DB_HOST: postgres
    mem_limit: 3g 
    restart: always

On the Postgres side I can confirm that the configuration worked (visualization through DBeaver):

So, what I would like to know is how to make a backup of the metadata (questions and dashboards). To do this, I though about:

  1. Backup only the metadata somehow, into a file that I could point to into the compose file (for easy restoration);
  2. Backup the entire container;

Tanks in advance.

Hi @pedro.vitor
You need to backup the Postgres container. You could use pg_dump for that or perhaps the built-in Docker container snapshot functionality. You'll find better resources about backup of Postgres on forums dedicated to that database or stackoverflow.com

Hi @flamber thank you for your answer. The postgres container has production data as well. As such, is it possible to backup and restore only the Metabase data or only the container?

If not, what would you suggest, create a new postgres container specifically for metabase metadata?

Thanks againd for the answer

@pedro.vitor Keep the Metabase data separate from your actual data, then it's easier to manage.