0
I’m having trouble performing the Store from a dump. The scenario is as follows: I am migrating from a GCP environment to AWS, and at this time I am working on the bank migration.
A partner dumped the bank in GCP and put the file in AWS S3 (I don’t know the command he used to dump).
I created an EC2 in the AWS environment and copied the S3 dump into the EC2 (the file is 13 GB). I also created RDS to host the new database with all the correct firwerall (security group) settings.
Here comes the problem, I connect in the database from the server (EC2) without problems, but while doing the Restore using the pg_restore
i get the following error message: pg_restore: muitos argumentos de linha de comando (primeiro é "dbclient.dump")
.
The full command I used was this: pg_restore -h client-aurora-cluster-hmg-legado-instance-1.c23ltjbbz7ms.us-east-1.rds.amazonaws.com -U postgres -d db_hmg_legado dbclient.dump -W
So I changed my approach. I tried with psql
instead of pg_restore
and then the command went like this: psql -h client-aurora-cluster-hmg-legado-instance-1.c23ltjbbz7ms.us-east-1.rds.amazonaws.com -U postgres -d db_hmg_legado dbclient.dump -W
Only this time it worked!!!!
But I received some error messages while performing the Store. Which I put below:
psql:dbclient.dump:23: ERROR: schema "dw" already exists
CREATE EXTENSION
psql:dbclient.dump:37: ERROR: must be owner of extension hstore
CREATE EXTENSION
psql:dbclient.dump:51: ERROR: must be owner of extension intarray
CREATE EXTENSION
psql:dbclient.dump:65: ERROR: must be owner of extension pg_trgm
CREATE EXTENSION
psql:dbclient.dump:79: ERROR: must be owner of extension unaccent
Only the Store takes a long time and is finalized in part.
Overall I wanted to understand why pg_restore didn’t work. Someone has already gone through this?
And about these Owner mistakes someone knows how to solve it using psql?
As explained in the documentation the use of pg_restore is linked to how the restore file was generated. In your other question I asked you to inform what the command used to generate the file was because it is deduced how the restore should be done (pg_restore or psql, see documentation). As you reported not knowing because it would have been done by third parties then you will have to test both options (which, I understand, was what you did). As for extensions the information is insufficient, the easiest would be to reinstall them in the rebuilt bd, see in the documentation how.
– anonimo