Skip to content

Instantly share code, notes, and snippets.

@dedunumax
Created March 5, 2020 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dedunumax/931e113b341cad572f742bfbbd5c670d to your computer and use it in GitHub Desktop.
Save dedunumax/931e113b341cad572f742bfbbd5c670d to your computer and use it in GitHub Desktop.
LOAD DATABASE
FROM mysql://root:Password123@mysqldb.example.com/real_db
INTO pgsql://postgres:Password456@pgserver101.example.com/adventure_db
WITH include drop, create tables
SET search_path to 'public'
INCLUDING ONLY TABLE NAMES MATCHING 'user'
ALTER TABLE NAMES MATCHING 'user' RENAME TO 'account'
ALTER SCHEMA 'real_db' RENAME TO 'public';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment