From 45432f3df9ef5f91fd74b50b631f574feefa2249 Mon Sep 17 00:00:00 2001 From: Jim O'Halloran Date: Tue, 22 Aug 2023 15:16:06 +0930 Subject: [PATCH 1/2] Reduce heap usage in pgloader --- backend/setup/mysql-to-postgresql.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/setup/mysql-to-postgresql.rst b/backend/setup/mysql-to-postgresql.rst index 59bf3f020..2c17b44ba 100644 --- a/backend/setup/mysql-to-postgresql.rst +++ b/backend/setup/mysql-to-postgresql.rst @@ -29,6 +29,7 @@ is a sample migration config that can be used for this process: LOAD DATABASE FROM mysql://dbuser:dbpass@localhost:3306/old_db_name INTO postgresql://dbuser:dbpass@localhost:5432/new_db_name + WITH prefetch rows = 10000 alter schema 'old_db_name' rename to 'public' CAST type datetime to timestamp /*(DC2Type:datetime)*/ drop default drop not null using zero-dates-to-null, type int with extra auto_increment when (< precision 12) to serial drop typemod, From c039c5d9fb91405bd61467087d46ef5907e667c3 Mon Sep 17 00:00:00 2001 From: Jim O'Halloran Date: Tue, 22 Aug 2023 15:20:20 +0930 Subject: [PATCH 2/2] Ensure sequences are created for signed int primary keys Credit goes to @AdamJHall for this fix --- backend/setup/mysql-to-postgresql.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/setup/mysql-to-postgresql.rst b/backend/setup/mysql-to-postgresql.rst index 2c17b44ba..0e890131f 100644 --- a/backend/setup/mysql-to-postgresql.rst +++ b/backend/setup/mysql-to-postgresql.rst @@ -32,6 +32,7 @@ is a sample migration config that can be used for this process: WITH prefetch rows = 10000 alter schema 'old_db_name' rename to 'public' CAST type datetime to timestamp /*(DC2Type:datetime)*/ drop default drop not null using zero-dates-to-null, + type int with extra auto_increment to serial drop typemod, type int with extra auto_increment when (< precision 12) to serial drop typemod, type int with extra auto_increment when (>= 12 precision) to bigserial drop typemod, type int when (< precision 12) to int drop typemod,