Created
July 7, 2025 02:00
-
-
Save jkerhin/46c605f4a499853a042722435158940d to your computer and use it in GitHub Desktop.
Load YugabyteDB .sql dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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