Skip to content

Instantly share code, notes, and snippets.

@aladagemre
Created April 14, 2025 19:38
Show Gist options
  • Save aladagemre/7114477283a18c208b7275f6068b1927 to your computer and use it in GitHub Desktop.
Save aladagemre/7114477283a18c208b7275f6068b1927 to your computer and use it in GitHub Desktop.
# Export data from source postgresql database.
pg_dump --format=custom --no-owner --verbose --file=backup.dump "$SOURCE_URL"
# Restore the data to the target postgresql database.
pg_restore --clean --if-exists --no-owner --verbose --dbname="$TARGET_URL" backup.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment