I'm following this tutorial: https://learn.microsoft.com/en-us/azure/postgresql/howto-migrate-using-export-and-import
I've successfully created a script file using pg_dump. I ran this on my command line:
pg_dump –-host=local --username=postgres --dbname=satellite_data --file=satellite_data.sql
I'm now at the point where I have to use psql to import the data into my Azure Server for PostgreSQL (https://learn.microsoft.com/en-us/azure/postgresql/howto-migrate-using-export-and-import#import-the-data-on-target-azure-database-for-postgresql).
I used the command the tutorial suggested psql --file=<database>.sql --host=<server name> --port=5432 --username=<user> --dbname=<target database name>
. I ran this in the Azure cloud shell (bash). With my info, it was:
psql --file=satellite_data.sql --host=[redacted] --port=5432 --username=[redacted] --dbname=satellite_data
However, I get the following error:
psql: error: satellite_data.sql: No such file or directory
I have tried saving satellite_data.sql
in many locations (and then passing the full file path to --file in azure), but nothing works.
I've followed the tutorial, and nothing seems to fix the error. Intuitively, I can't see how Azure can access my local file system... but that's what they seemingly do in the tutorial.
How can I fix this error?