Migration of MySQL to PostgreSQL with pgloader fails

Summary

I tried to migrate my MySQL database to PostgresSQL with pgloader but it fails due my actual MySQL database scheme seems to be different to the postgres scheme generated in version 12.0.0

Steps to reproduce

First, I installed Gems related to Postgresql:

sudo -u git -H rm .bundle/config
sudo -u git -H bundle install --deployment --without development test mysql aws kerberos

I prepared the schema:

sudo -u git -H bundle exec rake db:create db:migrate RAILS_ENV=production

I created a file commands.load with this code:

LOAD DATABASE
     FROM mysql://username:password@host/gitlabhq_production
     INTO postgresql://postgres@unix://var/run/postgresql:/gitlabhq_production

WITH include no drop, truncate, disable triggers, create no tables,
     create no indexes, preserve index names, no foreign keys,
     data only

ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public'

;

And finally:

sudo -u postgres pgloader commands.load

What is the current bug behavior?

The migration stopped due it cannot find a column on the new postgres database scheme

What is the expected correct behavior?

Finish properly

Relevant logs and/or screenshots

The error shown is:

What I am doing here?

pgloader failed to find column "public"."pool_repositories"."name" in target table "\"public\".\"pool_repositories\""

My pool_repository table from MySQL has 24 columns while my new postgres scheme has 5.

image

image

Possible fixes

Assignee Loading
Time tracking Loading