Import or export data from a Looker (Google Cloud core) instance

You may want to export your Looker (Google Cloud core) instance data — which includes created content and internal data about your Looker (Google Cloud core) instance — from one Looker (Google Cloud core) instance and then import that data to another Looker (Google Cloud core) instance. There are several reasons that you may want to export and import data:

  • You want to upgrade or downgrade to a different edition of Looker (Google Cloud core).
  • You want to move to a Looker (Google Cloud core) instance in a different project.
  • You want to move to a Looker (Google Cloud core) instance in a different region.

Required role

To get the permissions that you need to import or export Looker (Google Cloud core) instance data, ask your administrator to grant you the Looker Admin (roles/looker.admin) IAM role on the project in which the instance was created. For more information about granting roles, see Manage access.

You might also be able to get the required permissions through custom roles or other predefined roles.

Exporting your Looker (Google Cloud core) instance data to a Cloud Storage bucket

Required objects and permissions for exporting to a Cloud Storage bucket

  • A Cloud Storage bucket with the storage.objects.create permission assigned to the Looker (Google Cloud core) instance service account. The Storage Object Creator (roles/storage.objectCreator) role includes this permission, so you can alternatively assign that role to the Looker (Google Cloud core) instance service account.
  • A customer-managed encryption key (CMEK). This CMEK is specific to the export and import process and is different from a CMEK used for encrypting your instance data. The CMEK cloudkms.cryptoKeyVersions.useToEncrypt permission must be assigned to the Looker (Google Cloud core) instance service account. The Cloud KMS CryptoKey Encrypter (roles/cloudkms.cryptoKeyEncrypter) role includes this permission, so you can alternatively assign that role to the Looker (Google Cloud core) instance service account.

Exporting to a Cloud Storage bucket

To export your data:

console

  1. Go to the Looker page in the Google Cloud console.

    Go to Looker instances

  2. On the Select organization drop-down list at the top of the page, select the organization resource that includes the Looker (Google Cloud core) instance for which you want to export data.

  3. Click the name of the instance for which you want to export data.

  4. Click Export.

  5. In the Export Bucket field, specify the bucket location where you want the export artifact to be created. You can either enter the path in the input field as <bucket_name>/<folder_name> or browse to select the appropriate location in the bucket.

  6. In the Select a customer-managed key field, select the CMEK to be used for encrypting the export artifact.

  7. Click EXPORT.

gcloud

gcloud looker instances export LOOKER_INSTANCE_NAME \
--target-gcs-uri='gs://BUCKET_NAME/FOLDER_NAME' \
--kms-key=KMS_KEY_ID

Importing your data from a Cloud Storage bucket to a Looker (Google Cloud core) instance

Required permissions for importing from a Cloud Storage bucket

  • Grant the storage.objects.get permission to the Looker (Google Cloud core) instance service account. The Storage Object Viewer (roles/storage.objectViewer) role includes this permission, so you can alternatively assign that role to the Looker (Google Cloud core) service account.
  • The cloudkms.cryptoKeyVersions.useToDecrypt permission must be assigned to the Looker (Google Cloud core) instance service account. The Cloud KMS CryptoKey Decrypter (roles/cloudkms.cryptoKeyDecrypter) role includes this permission, so you can alternatively assign that role to the Looker (Google Cloud core) service account.

Importing from a Cloud Storage bucket

To import your data:

console

  1. Go to the Looker page in the Google Cloud console.

    Go to Looker instances

  2. On the Select organization drop-down list at the top of the page, select the organization resource that includes the Looker (Google Cloud core) instance where you want to import data.

  3. Click the name of the instance where you want to import data.

  4. Click IMPORT.

  5. In the Import Bucket field, either enter the path or browse to the Cloud Storage location where you exported your data. Select the folder containing the metadata.json file and other files.

  6. Click IMPORT.

gcloud

gcloud looker instances import LOOKER_INSTANCE_NAME \
--source-gcs-uri='gs://BUCKET_NAME/FOLDER_NAME'

Troubleshooting the export or import of Looker (Google Cloud core) data

This section describes how to remediate error conditions that could cause an export or import process to fail.

Errors during export

Import errors

  • Ensure that you have granted the Looker (Google Cloud core) service account the storage.objects.get permission or the Storage Object Viewer (roles/storage.objectViewer) role to the Cloud Storage bucket.

  • Ensure that you have granted the Looker (Google Cloud core) service account the cloudkms.cryptoKeyVersions.useToDecrypt permission or the Cloud KMS CryptoKey Decrypter (roles/cloudkms.cryptoKeyDecrypter) role to the Customer-managed encryption key (CMEK) that you created.

  • Importing can fail due to version incompatibility between the target instance and the export instance, as follows:

    • The target instance has a Looker minor version that is less than the Looker version of exported data. For example, the target instance is on Looker 23.5.X, but the export was created from an instance on Looker version 23.6.X.
    • The minor version of the instance that created the export data is behind the Looker version of the target instance by more than one release. For example, the target instance is on Looker 23.6.X, but the export was created from an instance on Looker version 23.4.X.

    In this case, upgrade either the export instance or the target instance so that both instances are running the same Looker version.