Hanging at cmd.copy step when upgrading from H2 to MySQL

openjdk version "11.0.2" 2019-01-15
Ubuntu 18.04.2 LTS
MySQL version: 5.7.12
Metabase v0.47.8 (639fa5e ?)
Running the JAR file directly

I'm trying to convert from h2 to MySQL but when it gets to the copy stage it just hangs

Here is what I'm seeing:
2023-11-25 16:13:54,393 INFO metabase.util :: Maximum memory available to JVM: 1.9 GB
2023-11-25 16:13:56,407 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. :unlock:
For more information, see Redirecting…
2023-11-25 16:14:02,365 INFO driver.impl :: Registered abstract driver :sql :truck:
2023-11-25 16:14:02,375 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql]) :truck:
2023-11-25 16:14:02,378 INFO metabase.util :: Load driver :sql-jdbc took 69.3 ms
2023-11-25 16:14:02,379 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc]) :truck:
2023-11-25 16:14:02,424 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc]) :truck:
2023-11-25 16:14:02,448 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc]) :truck:
2023-11-25 16:14:04,301 INFO metabase.core ::
Metabase v0.47.8 (639fa5e ?)

Copyright © 2023 Metabase, Inc.

Metabase Enterprise Edition extensions are NOT PRESENT.
2023-11-25 16:14:04,391 INFO driver.impl :: Registered abstract driver :metabase.driver.sql-jdbc.execute.legacy-impl/use-legacy-classes-for-read-and-set :truck:
2023-11-25 16:14:04,397 INFO driver.impl :: Registered abstract driver :metabase.driver.sql.query-processor.empty-string-is-null/empty-string-is-null :truck:
2023-11-25 16:14:04,512 INFO cmd.copy :: Set up h2 source database and run migrations...
2023-11-25 16:14:04,514 INFO db.setup :: Verifying h2 Database Connection ...
2023-11-25 16:14:04,999 INFO db.setup :: Successfully verified H2 2.1.214 (2022-06-13) application database connection. :white_check_mark:
2023-11-25 16:14:05,001 INFO db.setup :: Running Database Migrations...
2023-11-25 16:14:05,003 INFO db.setup :: Setting up Liquibase...
2023-11-25 16:14:05,357 INFO db.setup :: Liquibase is ready.
2023-11-25 16:14:05,358 INFO db.liquibase :: Checking if Database has unrun migrations...
2023-11-25 16:14:06,800 INFO db.setup :: Database Migrations Current ... :white_check_mark:
2023-11-25 16:14:06,802 INFO db.data-migrations :: Running all necessary data migrations, this may take a minute.
2023-11-25 16:14:07,439 INFO db.data-migrations :: Finished running data migrations.
2023-11-25 16:14:07,440 INFO metabase.util :: Database setup took 2.9 s
2023-11-25 16:14:07,440 INFO cmd.copy :: [OK]
2023-11-25 16:14:07,441 INFO cmd.copy :: Set up mysql target database and run migrations...
2023-11-25 16:14:07,441 INFO db.setup :: Verifying mysql Database Connection ...
2023-11-25 16:14:07,576 INFO db.setup :: Successfully verified MySQL 5.7.12 application database connection. :white_check_mark:
2023-11-25 16:14:07,577 INFO db.setup :: Running Database Migrations...
2023-11-25 16:14:07,579 INFO db.setup :: Setting up Liquibase...
2023-11-25 16:14:07,582 INFO db.setup :: Liquibase is ready.
2023-11-25 16:14:07,582 INFO db.liquibase :: Checking if Database has unrun migrations...
2023-11-25 16:14:08,554 INFO db.liquibase :: Database has unrun migrations. Waiting for migration lock to be cleared...
2023-11-25 16:14:08,696 INFO db.liquibase :: Migration lock is cleared. Running migrations...
2023-11-25 16:14:46,542 INFO impl.StdSchedulerFactory :: Using default implementation for ThreadExecutor
2023-11-25 16:14:46,552 INFO core.SchedulerSignalerImpl :: Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2023-11-25 16:14:46,553 INFO core.QuartzScheduler :: Quartz Scheduler v.2.3.2 created.
2023-11-25 16:14:46,554 INFO jdbcjobstore.JobStoreTX :: Using db table-based data access locking (synchronization).
2023-11-25 16:14:46,555 INFO jdbcjobstore.JobStoreTX :: JobStoreTX initialized.
2023-11-25 16:14:46,555 INFO core.QuartzScheduler :: Scheduler meta-data: Quartz Scheduler (v2.3.2) 'MetabaseScheduler' with instanceId 'ip-xx-xx-xx-xxxx0928886545'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports persistence. and is clustered.

2023-11-25 16:14:46,556 INFO impl.StdSchedulerFactory :: Quartz scheduler 'MetabaseScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2023-11-25 16:14:46,556 INFO impl.StdSchedulerFactory :: Quartz scheduler version: 2.3.2
2023-11-25 16:14:46,573 INFO core.QuartzScheduler :: Scheduler MetabaseScheduler_$ip-10-50-10-1911700928886545 started.
2023-11-25 16:14:46,592 INFO core.QuartzScheduler :: Scheduler MetabaseScheduler
$ip-10-50-10-1911700928886545 shutting down.
2023-11-25 16:14:46,592 INFO core.QuartzScheduler :: Scheduler MetabaseScheduler
$ip-10-50-10-1911700928886545 paused.
2023-11-25 16:14:46,593 INFO core.QuartzScheduler :: Scheduler MetabaseScheduler
$_ip-10-50-10-1911700928886545 shutdown complete.
2023-11-25 16:14:47,636 INFO db.custom-migrations :: No forward migration for DowngradeDashboardTab
2023-11-25 16:14:48,373 INFO db.setup :: Database Migrations Current ... :white_check_mark:
2023-11-25 16:14:48,373 INFO metabase.util :: Database setup took 40.9 s
2023-11-25 16:14:48,374 INFO cmd.copy :: [OK]
2023-11-25 16:14:48,374 INFO cmd.copy :: Testing if target mysql database is already populated...
2023-11-25 16:14:48,375 INFO cmd.copy :: [OK]
2023-11-25 16:14:48,376 INFO cmd.copy :: Clearing default entries created by Liquibase migrations...
2023-11-25 16:14:48,377 INFO cmd.copy :: Temporarily disabling DB constraints...
2023-11-25 16:14:48,380 INFO cmd.copy :: [OK]

The MySQL database is being populated with what looks like a clean install, but after this point it just hangs for hours without any updates to the database. The load on the server is 0.00 so it doesn't look like it's doing anything.

I've tried having it use 8gb of ram, running as root and a few other things but it's always the same issue.

Any help would be appreciated.

Thanks.

Try forcing the JVM to use more ram, e.g.: JAVA_TOOL_OPTIONS: -Xmx6144m -Xms4096m