Hi I'm trying to migrate my H2 application database to Postgres but the process errors out with
Command failed with exception: ERROR Clearing default entries created by Liquibase migrations...: ERROR Temporarily disabling DB constraints...: ERROR: relation "buckets" does not exist
I'm not sure where it's getting "buckets" from but I'd love to find it and remove it so I can move on. I've tried limiting Metabase's access on my target database to only the "public" schema which only has a single view in it. I have also tried both the Sync database schema now
and Re-scan field values now
buttons to no avail.
Any help here would be greatly appreciated!
P.S. I've made a pretty helpful script to do the migration for a docker container. It will copy the H2 out of the current "metabase" container to the host, and spin up another metabase container, mount the H2 file, and run the migration command on it. When it's done it will auto remove the new container for you. It's basically what is stated in the docs but sums it up into a quick 2 liner.
docker cp metabase:/metabase.db/metabase.db.mv.db ./metabase-backup
docker run --rm --name metabase-migrate -it \
-v $(pwd)/metabase-backup:/metabase-backup \
-e MB_DB_TYPE=postgres \
-e MB_DB_CONNECTION_URI=postgresql://postgres:<password>@<postgreshost>:5432/postgres \
--entrypoint '/bin/sh' \
metabase/metabase \
-c 'java -jar /app/metabase.jar load-from-h2 /metabase-backup/metabase.db'