Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active September 26, 2024 15:46
Show Gist options
  • Save ziadoz/27a130887b30dcdadb357b4cbe886d64 to your computer and use it in GitHub Desktop.
Save ziadoz/27a130887b30dcdadb357b4cbe886d64 to your computer and use it in GitHub Desktop.
PGLoader - Importing MySQL into Postgres
# Docker
docker run --rm -it --network="host" --add-host host.docker.internal:host-gateway dimitri/pgloader:latest pgloader --verbose --debug --client-min-messages debug --log-min-messages debug mysql://<user>:<password>@127.0.0.1:3306/dbname postgresql://<user>:<password>@127.0.0.1:5432/dbname
# Brew
# @see: https://github.com/dimitri/pgloader/issues/962
brew install pgloader
pgloader --verbose --debug --client-min-messages debug --log-min-messages debug --dynamic-space-size 262144 -v pgloader.load
# Config (pgloader.load)
LOAD DATABASE
FROM mysql://root:[email protected]:3306/fusions_local
INTO postgresql://root:[email protected]:5432/fusions_local
WITH prefetch rows = 100,
max parallel create index = 1
SET MySQL PARAMETERS
net_read_timeout = '3600',
net_write_timeout = '3600';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment