Exporting customer-hosted Looker data to Looker (Google Cloud core)

As an admin of a customer-hosted Looker instance, you can migrate directly to Looker (Google Cloud core) by using a single-hop, self-service export workflow. First, the open-source export script (looker_export.py) extracts your database, Git model repositories, and Looker encryption keys and encrypts them with your Cloud Key Management Service customer-managed encryption key (CMEK). Next, you upload the encrypted files to Cloud Storage to import them into Looker (Google Cloud core).

If you manage a Looker-hosted instance, see Self-service migration from Looker (original) to Looker (Google Cloud core). If you're using the Looker-assisted migration process, see Exporting data from a customer-hosted Looker instance.

Customer-hosted migration options

When you migrate a customer-hosted Looker instance, you can choose between two pathways:

  • Self-service export to Looker (Google Cloud core) (this document): Recommended if you're migrating directly to Looker (Google Cloud core). This pathway provides a self-service, single-hop export that you manage directly by using provided Python scripts, your own Cloud KMS customer-managed encryption key (CMEK), and your own Cloud Storage bucket.
  • Looker-assisted migration: Designed for migrating to a Looker-hosted (original) environment, or for organizations that require custom engagement with Google Cloud's Professional Services Organization (PSO) or Cloud Customer Care. This pathway involves support tickets, questionnaire intake, SRE-generated GnuPG (GPG) encryption keys, and manual data handoffs. For instructions, see Exporting data from a customer-hosted Looker instance.

Migration process overview

Migrating a customer-hosted Looker instance to Looker (Google Cloud core) by using the self-service export workflow involves five main steps. Before you start step 1, you can optionally run the collect_looker_diagnostics.py script while your Looker instance is live to check database and directory sizes before cutover. For more information, see Evaluate your instance for migration.

  1. Create your Looker (Google Cloud core) instance, CMEK, bucket, and export credentials: As a one-time setup in Google Cloud, create the target instance for the import, the Cloud KMS key to encrypt your export deliverables, and the Cloud Storage bucket to stage them. Additionally, grant the required export Identity and Access Management (IAM) permissions on the key and bucket to an export service account or user account.
  2. Prepare your instance for export: Install dependencies on your export host and authenticate with Google Cloud.
  3. Export and encrypt: Stop your customer-hosted instance, run the looker_export.py script, and verify the five encrypted deliverables in the ${BACKUP_DIR}/final_artifacts/ directory.
  4. Upload deliverables to Cloud Storage: Upload the five encrypted deliverables to your Cloud Storage migration bucket.
  5. Import into Looker (Google Cloud core): Trigger an import on your target Looker (Google Cloud core) instance by following Importing your data from a Cloud Storage bucket to a Looker (Google Cloud core) instance.

Choose a database export mode

The single-threaded versus multi-threaded choice applies specifically to database extraction. Both modes stage your Looker file system directories, wrap keys with Cloud KMS and Tink Streaming AEAD, and upload and import deliverables identically.

Database export mode tab Database extraction and import Advantages and trade-offs
Single-threaded export (mysqldump) Uses the standard mysqldump utility (included with mysql-client or mariadb-client-core), packaged in a .tar.gz archive with gzip or compatible parallel tools such as pigz when supported. Restored by using the standard Cloud SQL import path during Looker (Google Cloud core) import.

Advantage: Places lower CPU, disk I/O, and connection impact on the source database, and doesn't require extra third-party database packages or separate upstream package downloads.

Trade-off: Slower single-threaded extraction and restore on large Looker backend databases.

Multi-threaded export (mydumper) Uses mydumper (0.16.0 or later) to extract tables and table chunks in parallel across worker threads, packaged in a .tar.gz archive. Automatically restored in parallel by using myloader during Looker (Google Cloud core) import.

Advantage: Delivers nearly 3x to 10x faster database export performance (plus parallel import restore) when compared to the single-threaded mode, making it well suited for larger databases or tight cutover windows.

Trade-off: Parallel extraction places higher concurrent CPU, disk I/O, and connection load on the source database. Because mydumper speed depends on the configured worker threads (MYDUMPER_THREADS, default 4), start with a smaller thread count such as the default 4 and increase it gradually as database capacity allows. See the export-to-core README for optimal thread (MYDUMPER_THREADS) and chunk-size (MYDUMPER_CHUNK_ROWS) configuration.

Caveat: Requires separately downloading and installing mydumper (from the upstream mydumper releases page, subject to its upstream open-source licensing terms) and compression tools such as zstd.

Before you begin

Before you run looker_export.py, verify that your environment meets the system requirements, confirm your IAM permissions, complete pre-export preparation, and review what the workflow excludes or overwrites.

System and encryption requirements

Verify that your customer-hosted Looker instance, database, and encryption configuration meet the following requirements:

  • Your Looker instance must run a supported Looker release version.
  • Your instance must use an external MySQL database (version 8.0.0 or later) or MariaDB database (version 10.4.0 or later).
  • If you use AWS KMS, migrate to Looker AES-256 GCM encryption before exporting by following Changing Looker's encryption keys.
  • Your database character set and collation must be set to utf8mb4 (recommended) or utf8.

Required IAM permissions

Before you prepare your export host, verify that the Google Cloud user account or service account JSON key file (GOOGLE_APPLICATION_CREDENTIALS) that you use on the export host has the following IAM roles, or equivalent custom-role permissions:

Target Google Cloud resource Required permissions Predefined IAM role
Cloud KMS CryptoKey (used in Export and encrypt)
  • cloudkms.cryptoKeyVersions.useToEncrypt (wraps LOOKER_MASTER_KEY and Tink DEK handles)
  • cloudkms.cryptoKeyVersions.useToDecrypt (verifies Tink Envelope AEAD access during pre-flight)
Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter), or both roles/cloudkms.cryptoKeyEncrypter and roles/cloudkms.cryptoKeyDecrypter
Cloud Storage migration bucket (used in Upload deliverables to Cloud Storage)
  • storage.objects.create (uploads the five deliverables in final_artifacts/)
  • storage.objects.get and storage.objects.list (verifies uploaded files with gcloud storage ls)
  • storage.objects.delete (required only if overwriting files in an existing migration folder)
Storage Object User (roles/storage.objectUser) or Storage Object Admin (roles/storage.objectAdmin)

Pre-export preparation and script options

Before you run looker_export.py, complete the following preparation steps. For configuration options, see the export-to-core README or run ./looker_export.py --help.

  • Commit all uncommitted LookML code: Have developers commit and push all uncommitted Development Mode changes beforehand. looker_export.py doesn't copy individual developer workspaces (models-user-*, other than the shared models-user-looker directory).
  • Have LOOKER_MASTER_KEY ready: Verify that the person who runs the export knows and has access to the LOOKER_MASTER_KEY that was created for your customer-hosted Looker application. looker_export.py requires this key to verify the active database Key Encryption Key (KEK) and wrap LOOKER_MASTER_KEY with your Cloud KMS CMEK.
  • Optionally disable scheduled plans in the exported artifact: By default (DISABLE_SCHEDULED_PLANS=true), looker_export.py disables scheduled plans so that schedules don't run automatically right after you import data into Looker (Google Cloud core). This setting affects only the exported artifact and doesn't modify your live source database. You can re-enable schedules in Looker (Google Cloud core) whenever you want, or set DISABLE_SCHEDULED_PLANS=false before exporting to keep them enabled.
  • Include or exclude Looker Marketplace content: By default (EXCLUDE_MARKETPLACE=false), looker_export.py exports installed Looker Marketplace blocks and applications. To exclude Looker Marketplace content instead, set EXCLUDE_MARKETPLACE=true before running the export.

Export scope and overwrite behavior

Review the following export exclusions and import overwrite behavior before you start the migration:

  • Instance settings (setting table) aren't copied: Because Looker (Google Cloud core) and customer-hosted Looker settings differ, looker_export.py doesn't copy general rows from the setting table. It copies only the closed_system and crypt_canary_gcm rows. Configure other instance-level settings directly on the target Looker (Google Cloud core) instance after import.
  • OAuth tokens for database credentials aren't copied: For security reasons, looker_export.py doesn't copy OAuth tokens for database credentials from the oauth_user_state table. After import, you must reconfigure OAuth database credentials and have users re-authenticate on the target Looker (Google Cloud core) instance.
  • Full export and overwrite import behavior: Every run of looker_export.py starts from the beginning and runs to completion. Exports aren't incremental or resumable. Every import into Looker (Google Cloud core) overwrites any previous data and in-app configuration on the target instance.

Evaluate your instance for migration (optional)

Before scheduling your cutover window, we recommend running the read-only Python 3 diagnostic script (collect_looker_diagnostics.py) on your live customer-hosted Looker server. Because the script uses only the Python standard library and performs strictly read-only checks without downtime, running it ahead of time helps you:

  • Verify local staging disk capacity and target instance sizing: Measures subdirectory disk usage (du -hs) across your Looker application and shared data mounts and sums per-table byte sizes (data_length + index_length) so you can confirm at least 1.5x free local staging disk space and right-size your target Looker (Google Cloud core) instance.
  • Decide between mysqldump and mydumper: Surfaces large backend tables (such as history, event, or pdt_event_log) early so you can decide whether you need multi-threaded mydumper to fit within your maintenance window.

  • Catch database version, collation, or directory layout issues before cutover: Confirms MySQL (8.0+) or MariaDB (10.4+) version compatibility, checks per-table character sets and collations (utf8mb4 or utf8), and audits your directory structure (excluding individual models-user-[0-9]* developer directories) for unexpected mounts before taking downtime.

Diagnostic data collected

The diagnostic script gathers the following information:

  • File system structure and sizes: Top-level subdirectory disk usage (du -hs) and directory tree hierarchy across both the Looker application directory and shared data mount.
  • MySQL database metadata: A single query against information_schema.tables that captures the MySQL or MariaDB version, table names, character sets, collations, and table sizes (data_length + index_length).

Security and privacy safeguards

  • Read-only inspection: Never reads or outputs file contents, SSH private keys (id_rsa), certificates, or Git configuration files.
  • Excludes developer workspaces: Automatically skips individual developer directories (models-user-[0-9]*) while preserving shared production directories (models-user-looker).
  • Interactive password prompting: Prompts for database passwords interactively without echoing to the terminal screen and never saves passwords to disk.

Run the diagnostic script

On your Looker server, clone the looker-open-source/customer-scripts repository. If your directory and database connection variables differ from the defaults, set them. For all variable options, run ./collect_looker_diagnostics.py --help or see the export-to-core README. Then, run the read-only diagnostic check:

git clone https://github.com/looker-open-source/customer-scripts.git
cd customer-scripts/export-to-core

export LOOKER_APP_DIR="LOOKER_APP_DIR"
export LOOKER_DATA_DIR="LOOKER_DATA_DIR"
export PRIMARY_DB_HOST="DB_HOST"
export PRIMARY_DB_USER="DB_USER"
export PRIMARY_DB_NAME="DB_NAME"

./collect_looker_diagnostics.py

Replace the following values:

  • LOOKER_APP_DIR: path to your Looker application directory where looker.jar is located.
  • LOOKER_DATA_DIR: path to your Looker shared data directory, if separate from LOOKER_APP_DIR, such as in a clustered deployment (default: /mnt/looker-data).
  • DB_HOST, DB_USER, and DB_NAME: source MySQL or MariaDB hostname or IP address, username, and schema name for your primary Looker MySQL or MariaDB database.

The script writes a diagnostic report to /tmp/looker_infra_report.txt that contains your file system disk usage, directory structure, database size summary, and per-table breakdown. Expand the following section to view sample output:

Sample diagnostic report output

================================================================================
=== LOOKER DIAGNOSTIC REPORT
=== Generated: 2026-11-13T14:30:00Z | Host: looker-app-01
================================================================================

================================================================================
=== FILESYSTEM ANALYSIS: LOOKER_APP_DIR (Application Directory) (/home/looker/looker) ===
================================================================================
--- [1] Subdirectory Disk Usage (du -hs) ---
4.2G    /home/looker/looker
512M    /home/looker/looker/.cache
340M    /home/looker/looker/looker.jar
3.1G    /home/looker/looker/log

--- [2] Directory Structure (excluding models-user-[0-9]*) ---
/home/looker/looker
/home/looker/looker/.cache
/home/looker/looker/log

================================================================================
=== FILESYSTEM ANALYSIS: LOOKER_DATA_DIR (Shared/Data Directory) (/mnt/looker-data) ===
================================================================================
--- [1] Subdirectory Disk Usage (du -hs) ---
1.8G    /mnt/looker-data
620M    /mnt/looker-data/bare_models
16K /mnt/looker-data/deploy_keys
24K /mnt/looker-data/git_hooks
740M    /mnt/looker-data/models
410M    /mnt/looker-data/models-user-looker

--- [2] Directory Structure (excluding models-user-[0-9]*) ---
/mnt/looker-data
/mnt/looker-data/bare_models
/mnt/looker-data/bare_models/ecommerce.git
/mnt/looker-data/deploy_keys
/mnt/looker-data/git_hooks
/mnt/looker-data/models
/mnt/looker-data/models/ecommerce
/mnt/looker-data/models-user-looker

================================================================================
=== LOOKER MYSQL DATABASE DIAGNOSTICS: looker (PRIMARY_DB) ===
================================================================================
>>> STARTING DATABASE COLLECTION FOR DB: looker <<<
--------------------------------------------------------------------------------
DATABASE ANALYSIS FOR DB NAME: looker [Label: PRIMARY_DB]
  Host: 192.0.2.10:3306 | User: looker
--------------------------------------------------------------------------------
--- [1] Database Size Summary (DB: looker) ---
+---------------+-------------+------------------+-------------------+----------------+--------------+--------------+-------------------------+
| mysql_version | table_count | total_data_bytes | total_index_bytes | total_db_bytes | total_db_mib | total_db_gib | est_1_5x_db_staging_gib |
+---------------+-------------+------------------+-------------------+----------------+--------------+--------------+-------------------------+
| 8.0.36        |           7 |      24159191040 |        4898947072 |    29058138112 |     27711.99 |        27.06 |                   40.59 |
+---------------+-------------+------------------+-------------------+----------------+--------------+--------------+-------------------------+

--- [2] Per-Table Version, Character Set, Collation & Size (DB: looker, Largest First) ---
+---------------+----------------+---------------+--------------------+-------------+----------------+
| mysql_version | table_name     | table_charset | table_collation    | total_size  | total_size_mib |
+---------------+----------------+---------------+--------------------+-------------+----------------+
| 8.0.36        | history        | utf8mb4       | utf8mb4_general_ci | 19327352832 |       18432.00 |
| 8.0.36        | event          | utf8mb4       | utf8mb4_general_ci |  6442450944 |        6144.00 |
| 8.0.36        | pdt_event_log  | utf8mb4       | utf8mb4_general_ci |  3221225472 |        3072.00 |
| 8.0.36        | dashboard      | utf8mb4       | utf8mb4_general_ci |    48234496 |          46.00 |
| 8.0.36        | look           | utf8mb4       | utf8mb4_general_ci |    16777216 |          16.00 |
| 8.0.36        | setting        | utf8mb4       | utf8mb4_general_ci |       65536 |           0.06 |
| 8.0.36        | encryption_key | utf8mb4       | utf8mb4_general_ci |       32768 |           0.03 |
+---------------+----------------+---------------+--------------------+-------------+----------------+

================================================================================
=== DIAGNOSTIC COLLECTION COMPLETE
================================================================================

Create your Looker (Google Cloud core) instance, CMEK, bucket, and export credentials

Create the following Google Cloud resources and export credentials before preparing your export host:

  1. Create a target Looker (Google Cloud core) instance: Provision the destination instance by following Create a public secure connections Looker (Google Cloud core) instance. If you need a private connections instance instead, create a Private Service Connect or private services access instance. If you want instance-level CMEK on an Enterprise or Embed instance, you must configure it before creating the instance by following Enable CMEK for Looker (Google Cloud core). You can't enable instance-level CMEK on an existing instance.

  2. Create a Cloud KMS CMEK for the migration: Create a key ring and encryption key by following Create a key. This CMEK is specific to the export and import process and is separate from any instance-level CMEK on your Looker (Google Cloud core) instance. looker_export.py uses this key to wrap your encryption keys, and Looker (Google Cloud core) uses it to decrypt your deliverables during import.

  3. Create a Cloud Storage bucket: Create the migration bucket that stages your five encrypted deliverables before import by following Create a bucket.

  4. Set up export credentials and grant IAM permissions: Verify that the Google Cloud user account or service account that you use on your export host has the required IAM permissions on your Cloud KMS CMEK and Cloud Storage migration bucket.

    Create a service account and JSON key with Google Cloud CLI (optional)

    If you authenticate on a headless or automated Linux host by using a service account JSON key file, run the following commands from an authenticated workstation to create a dedicated service account, grant the required roles on your Cloud KMS key and Cloud Storage bucket, and generate the .json key file:

    gcloud iam service-accounts create EXPORT_SA_NAME \
        --project=PROJECT_ID \
        --display-name="Looker Core migration export"
    
    gcloud kms keys add-iam-policy-binding KEY_NAME \
        --project=PROJECT_ID \
        --location=REGION \
        --keyring=KEY_RING \
        --member="serviceAccount:EXPORT_SA_NAME@PROJECT_ID.iam.gserviceaccount.com" \
        --role="roles/cloudkms.cryptoKeyEncrypterDecrypter"
    
    gcloud storage buckets add-iam-policy-binding gs://YOUR_MIGRATION_BUCKET_NAME \
        --member="serviceAccount:EXPORT_SA_NAME@PROJECT_ID.iam.gserviceaccount.com" \
        --role="roles/storage.objectUser"
    
    gcloud iam service-accounts keys create PATH_TO_SERVICE_ACCOUNT_KEY.json \
        --iam-account="EXPORT_SA_NAME@PROJECT_ID.iam.gserviceaccount.com"

    Replace the following values:

    • EXPORT_SA_NAME: name for the new export service account.
    • PROJECT_ID: your Google Cloud project ID (not the numeric project number).
    • KEY_NAME, REGION, and KEY_RING: CryptoKey name, region, and key ring for your Cloud KMS CMEK.
    • YOUR_MIGRATION_BUCKET_NAME: name of your Cloud Storage migration bucket.
    • PATH_TO_SERVICE_ACCOUNT_KEY: local path where you want to save the JSON key file.

    Copy PATH_TO_SERVICE_ACCOUNT_KEY.json to your export host, set owner-only permissions by using chmod 600, and delete the key after your migration completes.

Prepare your instance for export

Complete these one-time setup steps on the Linux host that has access to your Looker data directory and MySQL or MariaDB database.

Install dependencies

Select your database extraction mode and install the required system packages. Required system packages include Python 3.9 or later, Git 2.36.0 or later, the mysql client, tar, gzip, and gcloud CLI:

Single-threaded export

Uses mysqldump and gzip, which are included with standard MySQL or MariaDB client packages:

sudo apt-get update
sudo apt-get install -y \
    git \
    python3 \
    python3-pip \
    default-mysql-client \
    tar \
    gzip

Multi-threaded export

Uses mydumper (0.16.0 or later, from mydumper releases) and zstd for parallel extraction:

sudo apt-get update
sudo apt-get install -y \
    git \
    python3 \
    python3-pip \
    default-mysql-client \
    tar \
    gzip \
    zstd

# Install mydumper (>= 0.16.0) for your distribution, then verify:
mydumper --version

Clone the looker-open-source/customer-scripts repository and install the required Python libraries. If you already cloned customer-scripts on this host, skip git clone, change to customer-scripts/export-to-core, and run git pull before installing requirements.txt:

git clone https://github.com/looker-open-source/customer-scripts.git
cd customer-scripts/export-to-core
pip3 install -r requirements.txt

Authenticate with Google Cloud

looker_export.py uses Application Default Credentials (ADC) to call Cloud KMS. Authenticate on the export host with an account or service account that has the required IAM permissions:

  • Option 1: Interactive user login (gcloud CLI)

    gcloud auth application-default login
    
  • Option 2: Service account JSON key (for headless or automated hosts)

    chmod 600 "PATH_TO_SERVICE_ACCOUNT_KEY.json"
    export GOOGLE_APPLICATION_CREDENTIALS="PATH_TO_SERVICE_ACCOUNT_KEY.json"
    

    Replace PATH_TO_SERVICE_ACCOUNT_KEY with the path to your service account JSON key file (excluding the .json extension).

Export and encrypt

looker_export.py starts from the beginning and runs to completion on every run without modifying your live source database or file system:

  • Pre-flight checks: Verifies CLI tools, versions, Cloud KMS access, LOOKER_MASTER_KEY KEK unwrap, and 1.5x free staging disk space.
  • Read-only database extraction: Runs mysqldump --single-transaction or mydumper --trx-tables --sync-thread-lock-mode=NO_LOCK --skip-ddl-locks and applies collation, schema, and schedule updates only to local staged files.
  • File system staging: Copies supported directories (models, models-user-looker, models-self-service, bare_models, remote_dependencies, deploy_keys, git_hooks, and .persistent_store) from your Looker file system root path.
  • Encryption and manifest: Wraps LOOKER_MASTER_KEY with your Cloud KMS CMEK, encrypts archives with Tink Streaming AEAD (AES128_CTR_HMAC_SHA256_1MB), and writes metadata.json.

Stop Looker, change to your customer-scripts/export-to-core directory (if you aren't already in it), set your environment variables, and run looker_export.py. Run ./looker_export.py --help or see the export-to-core README for optional flags. When prompted, enter MYSQL_PWD and LOOKER_MASTER_KEY. looker_export.py doesn't echo them to the terminal:

export ON_PREM_LOOKER_DATA_DIR="ON_PREM_LOOKER_DATA_DIR"
export BACKUP_DIR="BACKUP_DIR"
export DB_HOST="DB_HOST"
export DB_USER="DB_USER"
export DB_NAME="DB_NAME"
export KMS_KEY_NAME="projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
# Uncomment for multi-threaded database export (requires mydumper and zstd):
# export USE_MYDUMPER="true"

./looker_export.py

Replace the following values:

  • ON_PREM_LOOKER_DATA_DIR: path to your Looker file system root directory.
  • BACKUP_DIR: local output directory (must not overlap with ON_PREM_LOOKER_DATA_DIR).
  • DB_HOST, DB_USER, and DB_NAME: source MySQL or MariaDB hostname, username, and schema name.
  • PROJECT_ID, REGION, KEY_RING, and KEY_NAME: Google Cloud project ID (not project number), region, key ring, and CryptoKey name.

Verify exported deliverables

Confirm that all five encrypted deliverables exist and are non-empty in ${BACKUP_DIR}/final_artifacts/, and inspect ${BACKUP_DIR}/looker_export.log for warnings:

ls -lh "${BACKUP_DIR}/final_artifacts/"
Filename Description
mysql-data Tink Streaming AEAD (AES128_CTR_HMAC_SHA256_1MB) encrypted .tar.gz archive of the mysqldump or mydumper database export.
mysql-handle Cloud KMS envelope-encrypted Tink keyset handle for mysql-data.
fs-data Tink Streaming AEAD (AES128_CTR_HMAC_SHA256_1MB) encrypted .tar.gz archive of staged Looker file system directories.
fs-handle Cloud KMS envelope-encrypted Tink keyset handle for fs-data.
metadata.json Migration manifest containing the source Looker version, Cloud KMS CMEK path, encrypted root key, "source": "LOOKER_ORIGINAL", and artifact names.

Upload deliverables to Cloud Storage

Authenticate with an identity that has the required IAM permissions on your migration bucket, and then upload only the five files inside final_artifacts/. If you authenticated with a service account JSON key earlier, replace gcloud auth login with gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS":

gcloud auth login

gcloud storage cp "${BACKUP_DIR}/final_artifacts/*" "gs://YOUR_MIGRATION_BUCKET_NAME/MIGRATION_FOLDER/"
gcloud storage ls -l "gs://YOUR_MIGRATION_BUCKET_NAME/MIGRATION_FOLDER/"

Replace YOUR_MIGRATION_BUCKET_NAME and MIGRATION_FOLDER with your Cloud Storage migration bucket name and target folder path.

Import into Looker (Google Cloud core)

To review the required IAM permissions and import your uploaded deliverables into your target Looker (Google Cloud core) instance, see Importing your data from a Cloud Storage bucket to a Looker (Google Cloud core) instance.

For feedback or questions during the Public Preview, send an email to looker-migrations-eng@google.com.

What's next

  • To complete post-import tasks on your target Looker (Google Cloud core) instance, see Finalize the setup.