First of all you should copy MySQL.sql.gz
file to the app/tmp
directory.
Next execute docker-compose up
and log into the application container using the command docker-compose run app bash
.
All the following commands you should run inside the container:
- Restore MySQL dump to MySQL database:
$ gunzip < /app/tmp/MySQL.sql.gz | mysql -u root -h mysql pals
- Run the data migration:
$ pgloader mysql://root@mysql/pals postgresql://postgres@postgres/pals
- Copy
pgloader.log
file to theapp/tmp
directory for further analysis:
$ cp /tmp/pgloader/pgloader.log /app/tmp/
- Create Postgresql dump:
$ pg_dump -h postgres -U postgres -w pals | gzip -c > /app/tmp/postgresql.sql.gz
connect to mysql
$ mysql -u root -h mysql
Whow to convert from latin1
to utf-8
DB="icc_ffs_development"; ( echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;'; mysql -u root -h mysql "$DB" -e "SHOW TABLES" --batch --skip-column-names | xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) | mysql -u root -h mysql "$DB"