Skip to content

Instantly share code, notes, and snippets.

@jkerhin
Created July 7, 2025 02:00
Show Gist options
  • Select an option

  • Save jkerhin/46c605f4a499853a042722435158940d to your computer and use it in GitHub Desktop.

Select an option

Save jkerhin/46c605f4a499853a042722435158940d to your computer and use it in GitHub Desktop.
Load YugabyteDB .sql dump
# This would all work with Docker as well
# Annoyingly, YugabyteDB dumps _cannot_ be restored into PostgreSQL databases,
# they use custom syntax. YugabyteDB *can* load PostgreSQL dumps.
# From host
# ====================
# Make sure image is availible
podman load -i yugabyte_image.tar.gz
# Spin up the yugabyte db container in one tab
podman run --rm -v /path/to/wdir:/workspace --name yugabyte yuga yugabyted start --background=false
# From a different tab
# ====================
podman exec -it yuga bash
# From inside the podman container
# ====================
# Find the IP to use
yugabyted status
# Load in the dump file
ysqlsh -h 10.0.2.100 -f /workspace/yugadump.sql
# Explore the DB
ysqlsh -h 10.0.2.100 -c "\d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment