Exporting data as SQLΒΆ
You can export your schema and data with pg_dump.
You will need to have pg_dump installed.
Forward the
postgresmicroservice to your localhost by running the following command from your directory:$ hasura microservice port-forward postgres -n hasura --local-port 6432After running the above command, the
postgresmicroservice will be running on your localhost on the port 6432.Then simply run the
pg_dumpcommand to get your data as SQL.$ pg_dump -U admin hasuradb --host=localhost --port=6432 > backup.sql
After the above command succeeds, you will have your backup in
backup.sql. You can replacebackup.sqlwith path to the file you wish to have your data in.
Was this page helpful?