We are upgrading Metabase from 0.49 to 0.56.15, facing Migration Issues
Deployed using docker image via Kubernetes
metabase-clone-db=> SELECT
COUNT(*) as total_cards,
COUNT(view_count) as cards_with_view_count,
MAX(view_count) as max_views
FROM report_card;
total_cards | cards_with_view_count | max_views
-------------+-----------------------+-----------
8373 | 8373 | 0
metabase-clone-db=> SELECT id, dateexecuted, exectype, description
FROM databasechangelog
WHERE dateexecuted > '2025-12-16'
ORDER BY orderexecuted DESC
LIMIT 20;
id | dateexecuted | exectype | description
-------------------------+----------------------------+----------+------------------------------------------------------------------------------------------
v50.2024-04-25T16:29:31 | 2025-12-16 10:49:09.307685 | EXECUTED | addColumn tableName=report_card
v50.2024-04-25T03:15:02 | 2025-12-16 10:49:09.299983 | EXECUTED | addColumn tableName=permissions_group
v50.2024-04-25T03:15:01 | 2025-12-16 10:49:09.287129 | EXECUTED | addColumn tableName=core_user
v50.2024-04-25T01:04:07 | 2025-12-16 10:49:09.268389 | EXECUTED | customChange
v50.2024-04-25T01:04:06 | 2025-12-16 10:49:09.261826 | EXECUTED | customChange
v50.2024-04-25T01:04:05 | 2025-12-16 10:49:09.254468 | EXECUTED | customChange
v50.2024-04-19T17:04:04 | 2025-12-16 10:49:09.134644 | EXECUTED | sql
v50.2024-04-15T16:30:35 | 2025-12-16 10:49:09.122894 | EXECUTED | addColumn tableName=report_card
v50.2024-04-09T15:55:19 | 2025-12-16 10:49:09.11504 | EXECUTED | addColumn tableName=collection
v50.2024-03-29T10:00:00 | 2025-12-16 10:49:09.107881 | EXECUTED | addColumn tableName=report_card
v50.2024-03-28T16:30:35 | 2025-12-16 10:49:09.100721 | EXECUTED | customChange
v50.2024-03-25T14:53:00 | 2025-12-16 10:49:08.960762 | EXECUTED | addColumn tableName=query_field
v50.2024-03-24T19:34:11 | 2025-12-16 10:49:08.950676 | EXECUTED | sql
v50.2024-03-22T00:39:28 | 2025-12-16 10:49:08.922222 | EXECUTED | createIndex indexName=idx_field_usage_field_id, tableName=field_usage
v50.2024-03-22T00:38:28 | 2025-12-16 10:49:08.91196 | EXECUTED | createTable tableName=field_usage
v50.2024-03-21T17:41:00 | 2025-12-16 10:49:08.889908 | EXECUTED | addColumn tableName=metabase_table
v50.2024-03-18T16:00:01 | 2025-12-16 10:49:08.881131 | EXECUTED | addUniqueConstraint constraintName=idx_cache_config_unique_model, tableName=cache_config
v50.2024-03-18T16:00:00 | 2025-12-16 10:49:08.869095 | EXECUTED | createTable tableName=cache_config
v50.2024-03-12T17:16:38 | 2025-12-16 10:49:08.838433 | EXECUTED | dropTable tableName=activity
v50.2024-02-29T15:08:43 | 2025-12-16 10:49:08.816209 | EXECUTED | createIndex indexName=idx_query_field_field_id, tableName=query_field
metabase-clone-db=> EXPLAIN ANALYZE
SELECT c.id, COUNT(*)
FROM report_card c
LEFT JOIN view_log v ON v.model = 'card' AND v.model_id = c.id
GROUP BY c.id
LIMIT 100;
QUERY PLAN
Limit (cost=0.72..366588.74 rows=100 width=12) (actual time=13.071..12929.520 rows=100 loops=1)
-> GroupAggregate (cost=0.72..30694415.83 rows=8373 width=12) (actual time=13.070..12929.458 rows=100 loops=1)
Group Key: c.id
-> Merge Left Join (cost=0.72..30573086.33 rows=24249155 width=4) (actual time=1.123..12924.726 rows=23319 loops=1)
Merge Cond: (c.id = v.model_id)
-> Index Only Scan using report_card_pkey on report_card c (cost=0.29..321.88 rows=8373 width=4) (actual time=0.007..0.142 rows=101 loops=1)
Heap Fetches: 4
-> Index Scan using idx_view_log_model_id on view_log v (cost=0.44..30269629.08 rows=24249155 width=4) (actual time=0.573..12918.858 rows=23359 loops=1)
Filter: ((model)::text = 'card'::text)
Rows Removed by Filter: 300340
Planning Time: 9.489 ms
Execution Time: 12929.712 ms
(12 rows)
metabase-clone-db=> SELECT COUNT(*) FROM view_log WHERE model = 'card';
count
24209123
at metabase.app_db.core$setup_db_BANG\_.doInvoke(core.clj:105)
at clojure.lang.RestFn.invoke(RestFn.java:424)
at metabase.core.core$init_BANG__STAR_.invokeStatic(core.clj:173)
at metabase.core.core$init_BANG__STAR_.invoke(core.clj:151)
at metabase.core.core$init_BANG_.invokeStatic(core.clj:229)
at metabase.core.core$init_BANG_.invoke(core.clj:224)
at metabase.core.core$start_normally.invokeStatic(core.clj:243)
at metabase.core.core$start_normally.invoke(core.clj:235)
at metabase.core.core$entrypoint.invokeStatic(core.clj:278)
at metabase.core.core$entrypoint.doInvoke(core.clj:269)
at clojure.lang.RestFn.invoke(RestFn.java:400)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:135)
at clojure.lang.Var.applyTo(Var.java:707)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at metabase.core.bootstrap$_main.invokeStatic(bootstrap.clj:36)
at metabase.core.bootstrap$_main.doInvoke(bootstrap.clj:29)
at clojure.lang.RestFn.invoke(RestFn.java:400)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:135)
at metabase.core.bootstrap.main(Unknown Source)
2025-12-17 06:34:10,035 INFO core.core :: Metabase Shutting Down ...
2025-12-17 06:34:10,036 INFO server.instance :: Shutting Down Embedded Jetty Webserver
2025-12-17 06:34:10,046 INFO notification.send :: Shutting down notification dispatchers... {mb-dispatcher-count=2}
2025-12-17 06:34:10,051 INFO notification.send :: Starting notification thread pool with 3 threads {mb-dispatcher-count=2}
2025-12-17 06:34:10,053 INFO notification.send :: Gracefully shutting down notification dispatcher with 0 pending notifications to process {mb-dispatcher-count=2}
2025-12-17T06:34:11.055495079Z 2025-12-17 06:34:11,055 INFO notification.send :: Notification worker shut down successfully {mb-dispatcher-count=2}
2025-12-17 06:34:11,055 INFO notification.send :: Starting notification thread pool with 5 threads {mb-dispatcher-count=2}
2025-12-17 06:34:11,056 INFO notification.send :: Gracefully shutting down notification dispatcher with 0 pending notifications to process {mb-dispatcher-count=2}
2025-12-17T06:34:12.057534098Z 2025-12-17 06:34:12,057 INFO notification.send :: Notification worker shut down successfully {mb-dispatcher-count=2}
2025-12-17 06:34:12,057 INFO notification.send :: All notification workers shut down successfully {mb-dispatcher-count=2}
2025-12-17 06:34:12,059 WARN app-db.liquibase :: ()
2025-12-17 06:34:12,060 INFO core.core :: Metabase Shutdown COMPLETE
Let me know if need any other additional details