I would like to migrate my local PostgreSQL database to the deployed PostgreSQL database on fly.io. What should I do?
How about pg_dump & pg_restore?
(Untested. Based on Migrate from Heroku · Fly Docs)
On your computer, create a DB dump:
pg_dump -Fc --no-acl --no-owner YOUR_DATABASE > db.dump
Upload the dump to the VM:
fly ssh sftp shell put db.dump /tmp/db.dump
then exit out of the SFTP shell.
SSH into the VM and load the dump:
fly ssh console pg_restore --verbose --clean --no-acl --no-owner -d "$DATABASE_URL" /tmp/db.dump
Thanks it useful
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.