Tuesday, April 24, 2018

[google-cloud-sql-discuss] Error importing SQL dump from bucket (exported from Google Cloud Console)

I have a Google App Engine project running Wordpress and everything is working fine on that. I exported the Cloud SQL instance to a bucket in that project and then transferred to a bucket in an new Google App Engine project where I want to import the SQL instance. 

I've tried importing through the Google Cloud Console, but I get an unknown error, so I switched to the command line utility. 

Here are the commands I've run following the doc here... 

https://cloud.google.com/sql/docs/postgres/import-export/importing

gcloud sql instances describe  myapp-wp-db-app-v2

// the serviceAccountEmailAddress (a fake version of it)
hvintl4c5h3uot6h7e5vfxz@sparkle-boots-23.iam.gserviceaccount.com

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:W gs://[BUCKET_NAME]
gsutil acl ch -u hvintl4c5h3uot6h7e5vfxz@sparkle-boots-23.iam.gserviceaccount.com:W gs://import-myapp-wp-app-v2

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:R gs://[BUCKET_NAME]/[IMPORT_FILE_NAME]
gsutil acl ch -u hvintl4c5h3uot6h7e5vfxz@sparkle-boots-23.iam.gserviceaccount.com:R gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/

// gcloud sql import sql [INSTANCE_NAME] gs://[BUCKET_NAME]/[IMPORT_FILE_NAME] \
                            --database=[DATABASE_NAME]
gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/ \
                            --database=wordpress_db


The last command gives me the following in the command line utility..
Importing data into Cloud SQL instance...failed.
ERROR: (gcloud.sql.import.sql) ERROR_RDBMS
and " gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/: Not found (bad bucket name?)" in the Console's operations log.

This command below (without a trailing slash) give me unknown error...
gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52) \
                            --database=wordpress_db


The documentation says that if you have "ERROR_RDBMS" that it is probably related to permissions and did not elaborate.Since I exported the SQL dump from Cloud SQL, I thought that it would have the correct permissions need to import back in to Cloud SQL. 

Any idea how to handle this?

Cheers.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a0b4711d-c465-444c-a80d-5f7505892a7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment