Issue
I have PostgreSQL dump file in my local environment, and I want to restore it on AWS server where Django app was deployed.
I think I should upload the dump file to AWS server but I don't know where it should be uploaded to and how to restore it.
Solution
First, copy your file from your local environment to AWS using scp
command
e.g
scp -i /directory/to/abc.pem mydump.sql [email protected]:/tmp/
where abc.pem
is your private aws key. mydump.sql
is your dump file and /tmp/
is the path where the dump file will be copied
Once the file is copied to your AWS /tmp folder or whatever location you use, Next you need to restore it to your database e.g using
./pg_restore -U postgres -p 5432 -d yourdatabase < mydump.sql
Answered By - Amjad Shahzad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.