Metabase H2 Database Locked After Host Reboot – Cannot Access Existing .mv.db File in Docker

Hi Metabase Community,

I’ve run into a critical issue with my Metabase Docker setup and I’m hoping for guidance. Here’s the situation:

Setup:

  • Metabase running in Docker for ~6 months

  • Database: H2, stored in a Docker volume (metabase.db.mv.db)

  • All reports and dashboards have been working perfectly

  • Host OS rebooted recently

Problem:
After a host reboot, my Metabase container stopped working. Any attempt to start the container now fails immediately. Logs show the database file appears locked or inaccessible.

Examples of errors when starting the Docker container:

Caused by: org.h2.mvstore.MVStoreException: The file is locked: /metabase.db/metabase.db.mv.db
Caused by: java.nio.channels.OverlappingFileLockException

When trying to import the same H2 file into a new container or migrate it to PostgreSQL, I get:

Database may be already in use: "/metabase-data/metabase.db.mv.db"
Error while creating file "/metabase-data/metabase.db.mv.db (a file with this name already exists)"

What I’ve tried:

  • Stopping all containers and making sure no other process is using the H2 file

  • Starting a fresh Metabase container with the same volume

  • Restoring backups from 2–3 months ago

  • Attempting to migrate the H2 database to PostgreSQL

All attempts result in the same “file locked” or “database already in use” errors.

Additional info:

  • This is not a typical concurrent access issue — the database was working fine before the host reboot.

  • Even older backups fail to start, which suggests a possible corruption or H2 file lock metadata issue. What I find weird, is that the old backups back then did not have any file corruption, and now they seem to… as they do not work…

Request for help:

  • Is there a safe way to unlock or repair the H2 .mv.db file after a host reboot?

  • Can I recover my existing Metabase data without losing all dashboards/reports?

  • Is migration to PostgreSQL possible with the current state of the H2 file?

Any guidance or steps to safely recover the database would be greatly appreciated.

Thank you in advance!

Please see this information on how to unlock a locked .mv.db file due to a crash: