Hello,
I am trying to migrate the application database from H2 to postgres. The image we have used for docker is metabase/ci:circleci-java-11-clj-1.10.3.929-07-27-2021-node-browsers.
I tried following this documentation. I received the following error when I ran the command java -jar metabase.jar load-from-h2 /path/to/metabase.db:
ERROR MESSAGE: Batch entry 79 INSERT INTO metabase_field ( "description", "database_type", "semantic_type", "table_id", "coercion_strategy", "name", "fingerprint_version", "has_field_values", "settings", "caveats", "fk_target_field_id", "updated_at", "custom_position", "effective_type", "active", "nfc_path", "parent_id", "id", "last_analyzed", "position", "visibility_type", "preview_display", "display_name", "database_position", "fingerprint", "created_at", "base_type", "points_of_interest" ) VALUES ( NULL, 'java.lang.String', 'type/URL', 6721, NULL, 'EDIT_LINK', 5, 'auto-list', NULL, NULL, NULL, '2021-11-13 08:30:09.477+00', 0, 'type/Text', 'TRUE', NULL, NULL, 50467, '2021-11-07 13:24:15.043+00', 66, 'normal', 'TRUE', 'Edit Link', 37, '{"global":{"distinct-count":3,"nil%":0.9998},"type":{"type/Text":{"percent-json":0.0,"percent-url":2.0E-4,"percent-email":0.0,"percent-state":0.0,"average-length":0.0098}}}', '2021-11-07 13:21:07.239+00', 'type/Text', NULL ) was aborted: ERROR: duplicate key value violates unique constraint "idx_uniq_field_table_id_parent_id_name_2col"
To fix this, ran the two commands below on the target database (remove the unique constraint on the stated index), and then tried the migration again. This time, it was successful.
- drop index idx_uniq_field_table_id_parent_id_name_2col;
- create index idx_uniq_field_table_id_parent_id_name_2col
on metabase_field (table_id, name)
where (parent_id IS NULL);
Now when I try to run Metabase via docker-compose with the appropriate env variables, I get the below error stating that checksums validation has failed.
Can you please help in resolving this?