|
| 1 | +--- |
| 2 | +title: How to migrate data from Google BigQuery |
| 3 | +description: Learn how to migrate data from Google BigQuery to your Scaleway Data Warehouse for ClickHouse® deployment. |
| 4 | +tags: connect migration transfer copy data alternative migrate ClickHouse® integrate integration |
| 5 | +dates: |
| 6 | + validation: 2025-08-18 |
| 7 | + posted: 2025-08-18 |
| 8 | +--- |
| 9 | +import Requirements from '@macros/iam/requirements.mdx' |
| 10 | + |
| 11 | +This page explains how to migrate anaytical datasets from Google BigQuery to a Scaleway Data Warehouse for ClickHouse® deployment. THe instructions are based on the [official ClickHouse® guide](https://clickhouse.com/docs/migrations/bigquery/migrating-to-clickhouse-cloud) to migrate from Google BigQuery. |
| 12 | + |
| 13 | +This documentation exemplifies the migration procedure using the [New York Taxi Data](https://clickhouse.com/docs/getting-started/example-datasets/nyc-taxi) provided by ClickHouse®. |
| 14 | + |
| 15 | +<Requirements /> |
| 16 | + |
| 17 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 18 | +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 19 | +- A working Google Cloud Provider account with access to BigQuery. |
| 20 | +- [Created a Data Warehouse for ClickHouse® deployment](/data-warehouse/how-to/create-deployment/). |
| 21 | + |
| 22 | +## How to export data from Google BigQuery |
| 23 | + |
| 24 | +Google BigQuery can only export data to Google CLoud Storage (GCS), so you must copy your data to GCS first, then transfer it from GCS to Scaleway Object Storage before ingesting it to your Data Warehouse for ClickHouse® deployment. |
| 25 | + |
| 26 | +### Exporting BigQuery data to GCS |
| 27 | + |
| 28 | +1. Log in to your Google Cloud account, then open BigQuery. |
| 29 | + |
| 30 | +2. Use the `EXPORT DATA` statement to export tables to GCS in the `Parquet` format. Make sure to replace `your-bucket-name` with your GCS bucket name: |
| 31 | + |
| 32 | + ```sql |
| 33 | + EXPORT DATA OPTIONS ( |
| 34 | + uri='gs://your-bucket-name/nyc_taxi_data/*.parquet', |
| 35 | + format='PARQUET', |
| 36 | + overwrite=true |
| 37 | + ) AS |
| 38 | + |
| 39 | + SELECT * FROM `bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2016`; |
| 40 | + ``` |
| 41 | + |
| 42 | +<Message type="note"> |
| 43 | +- The `*` in the bucket URI allows Google BigQuery to shard the export into multiple parts if necessary. |
| 44 | +- You must have write access to the specified GCS bucket to perform this action. |
| 45 | +</Message> |
| 46 | + |
| 47 | +### Transfering data to Scaleway Object Storage |
| 48 | + |
| 49 | +To copy data from Google Cloud Storage (GCS) to Scaleway Object Storage, we recommend using [Rclone](https://rclone.org/), as it is compatible with both Google Cloud Storage and Scaleway Object storage, and allows you to easily copy data from a cloud provider to another. |
| 50 | + |
| 51 | +1. Run the command below to install Rclone, or refer to the [official documentation](https://rclone.org/downloads/) for alternative methods: |
| 52 | + |
| 53 | + ```sh |
| 54 | + curl https://rclone.org/install.sh | sudo bash |
| 55 | + ``` |
| 56 | + |
| 57 | +2. Run the command below to start configuring your GCS remote: |
| 58 | + ```sh |
| 59 | + rclone config |
| 60 | + ``` |
| 61 | + |
| 62 | +3. Enter the following parameters when prompted: |
| 63 | + - Enter `n` to create a new remote. |
| 64 | + - Name: `gcs` |
| 65 | + - Storage type: `Google Cloud Storage` |
| 66 | + - ID and secret (service account JSON recommended) |
| 67 | + |
| 68 | + Your GCS remote for Rclone is now configured. |
| 69 | + |
| 70 | +4. Run the command below to start configuring your Scaleway Object Storage remote: |
| 71 | + ```sh |
| 72 | + rclone config |
| 73 | + ``` |
| 74 | + |
| 75 | +5. Enter the following parameters when prompted: |
| 76 | + - Enter `n` to create a new remote. |
| 77 | + - Name: `scw` |
| 78 | + - Storage type: `s3` |
| 79 | + - Provider: `Scaleway` |
| 80 | + - Endpoint: `s3.fr-par.scw.cloud` (update according to the selected region) |
| 81 | + - API access key and secret key |
| 82 | + |
| 83 | +6. Run the command below to copy the cotntent of your GCS bucket to your Scaleway Object Storage bucket. Make sure to replace the placeholders with the correct values: |
| 84 | + ```sh |
| 85 | + rclone copy gcs:your-gcs-bucket scw:your-scw-bucket --progress |
| 86 | + ``` |
| 87 | + |
| 88 | +Your Scaleway Object Storage now contains data exported from Google BigQuery in Parquet format, which can now be ingested into your Data Warehouse for ClickHouse® deployment. |
| 89 | + |
| 90 | + |
0 commit comments