Error when trying to backup the database

Hi,

I have a private edge setup. I have created a backup of my portal, and I have deleted my database.

I am trying to restore from the backup and create a new database.I have given this command:

pg_restore --clean --create --dbname=devportal2 --host=localhost --username=apigee < /tmp/portal.bak

where portal.bak has my backup and devportal2 is my new DB that i want to create.BUt when I run this command, I am getting an error :

pg_restore: [archiver (db)] connection to database "devportal2" failed: FATAL: database "devportal2" does not exist.

I am puzzled on the fact as why I am not able to create the new database "devportal2".

Can you please let me know where I am going wrong.

Thanks

0 1 115
1 REPLY 1

I created the database manaully and made a change in the above command as:

pg_restore --clean --dbname=devportal2 --host=localhost --username=apigee < /tmp/portal.bak

I was able to successfully take tha backup of the portal.