Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All tutorials
    • Adding data to a DB
    • Migrating data to Managed Service for ClickHouse® using ClickHouse®
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Sharding tables
    • Using a hybrid storage
    • Fetching data from Managed Service for Apache Kafka®
    • Fetching data from RabbitMQ
    • Exchanging data with Yandex Data Processing
    • Configuring Yandex Cloud DNS for cluster access from other cloud networks
    • Analyzing Yandex Object Storage logs using Yandex DataLens
    • Configuring Managed Service for ClickHouse® for Graphite
    • Saving a data stream from Yandex Data Streams to Managed Service for ClickHouse®
    • Migrating a database from Google BigQuery
    • Delivering data from Managed Service for Apache Kafka® using Yandex Data Transfer
    • Migrating data from Yandex Direct using Yandex Cloud Functions, Yandex Object Storage, and Yandex Data Transfer
    • Loading data from Yandex Object Storage to Managed Service for ClickHouse® using Yandex Data Transfer
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from MySQL® to ClickHouse® using Yandex Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Loading data from Yandex Managed Service for YDB to Managed Service for ClickHouse® using Yandex Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for ClickHouse® using Yandex Data Transfer
    • Ingesting data into storage systems
    • Using parameters
    • Examples of creating QL charts
    • Web analytics with funnels and cohorts calculated based on Yandex Metrica data
    • AppMetrica: direct connection
    • AppMetrica: data export, post-processing, and visualization
    • Loading data from Yandex Metrica to a ClickHouse® data mart
    • Yandex Tracker: data export and visualization
    • Retail chain's dashboard based on a ClickHouse® DB
    • Analyzing sales and locations of pizzerias based on data from the ClickHouse® database and Marketplace
    • Geocoding with the Yandex Maps API for data visualization in DataLens
    • Importing data from Object Storage, processing, and exporting to Managed Service for ClickHouse®
    • Operations with data using Query
    • Federated data queries using Query
    • Integration with an external Microsoft SQL Server database via ClickHouse® JDBC Bridge
    • Integration with an external Oracle database via ClickHouse® JDBC Bridge
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Required paid resources
  • Getting started
  • Set up your transfer
  • Activate the transfer
  • Verify replication after reactivation
  • Delete the resources you created
  1. Tutorials
  2. Migrating a database from Greenplum® to ClickHouse®

Migrating a database from Greenplum® to ClickHouse®

Written by
Yandex Cloud
Updated at October 20, 2025
  • Required paid resources
  • Getting started
  • Set up your transfer
  • Activate the transfer
  • Verify replication after reactivation
  • Delete the resources you created

You can migrate a database from Greenplum® to ClickHouse® using Yandex Data Transfer.

To transfer a database from Greenplum® to ClickHouse®:

  1. Set up your transfer.
  2. Activate the transfer.
  3. Verify replication after reactivation.

If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

The support cost for this solution includes:

  • Yandex MPP Analytics for PostgreSQL cluster fee: Covers the use of computational resources allocated to hosts and disk storage (see Yandex MPP Analytics for PostgreSQL pricing).

  • Managed Service for ClickHouse® cluster fee: Covers the use of computational resources allocated to hosts (including ZooKeeper hosts) and disk storage (see Managed Service for ClickHouse® pricing).

  • Fee for public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).

  • Transfer fee: Based on computational resource consumption and the total number of data rows transferred (see Data Transfer pricing).

Getting startedGetting started

In our example, we will create all required resources in Yandex Cloud. Set up the infrastructure:

Manually
Terraform
  1. Create a Yandex MPP Analytics for PostgreSQL source cluster with any suitable configuration.

  2. Create a Yandex Managed Service for ClickHouse® target cluster with a database named db1 using any suitable configuration.

  3. If using security groups, make sure they are configured correctly and allow inbound connections to the clusters.

    • Managed Service for ClickHouse®.
    • Yandex MPP Analytics for PostgreSQL.
  4. Create a ClickHouse® target endpoint. In the endpoint settings, specify Drop or Truncate as the cleanup policy to prevent duplication of copied data.

  1. If you do not have Terraform yet, install it.

  2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

  3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

  4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

  5. Download the greenplum-clickhouse.tf configuration file to your current working directory.

    This file describes:

    • Networks and subnets where your clusters will be hosted.

    • Security groups for cluster access.

    • Yandex MPP Analytics for PostgreSQL source cluster.

    • Managed Service for ClickHouse® target cluster.

    • Target endpoint.

  6. In the greenplum-clickhouse.tf file, specify the following:

    • mgp_password: Greenplum® admin password.
    • mch_db: ClickHouse® database name.
    • mch_user: ClickHouse® database user name.
    • mch_password: ClickHouse® database user password.
  7. Validate your Terraform configuration files using this command:

    terraform validate
    

    Terraform will display any configuration errors detected in your files.

  8. Create the required infrastructure:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

Set up your transferSet up your transfer

  1. Create a Greenplum® source endpoint and specify its cluster connection settings.

  2. Create a Snapshot transfer that uses endpoints for the source and target.

    While real-time replication is not supported for this endpoint pair, you can configure regular copying while creating the transfer. To do this, in the Transfer parameters field under Snapshot, select Regular and specify the copy interval. The transfer will automatically activate after the specified interval.

Activate the transferActivate the transfer

  1. Connect to the Yandex MPP Analytics for PostgreSQL cluster, create a table named x_tab, and populate it with data:

    CREATE TABLE x_tab
    (
        id NUMERIC,
        name CHARACTER(5)
    );
    CREATE INDEX ON x_tab (id);
    INSERT INTO x_tab (id, name) VALUES
    (40, 'User1'),
    (41, 'User2'),
    (42, 'User3'),
    (43, 'User4'),
    (44, 'User5');
    
  2. Activate the transfer and wait for its status to change to Completed.

  3. To verify the data transfer, connect to the Managed Service for ClickHouse® target cluster and check whether the columns of the x_tab table in the db1 database match those of the x_tab table in the source database:

    SELECT id, name FROM db1.x_tab;
    
    ┌─id─┬─name──┐
    │ 40 │ User1 │
    │ 41 │ User2 │
    │ 42 │ User3 │
    │ 43 │ User4 │
    │ 44 │ User5 │
    └────┴───────┘
    

Verify replication after reactivationVerify replication after reactivation

  1. Connect to the Yandex MPP Analytics for PostgreSQL cluster. Then, in the x_tab table, delete one row and update another:

    DELETE FROM x_tab WHERE id = 41;
    UPDATE x_tab SET name = 'Key3' WHERE id = 42;
    
  2. Reactivate the transfer and wait for its status to change to Completed.

  3. Make sure the changes have been applied to the x_tab table on the ClickHouse® target:

    SELECT id, name FROM db1.x_tab;
    
    ┌─id─┬─name──┐
    │ 42 │ Key3  │
    │ 40 │ User1 │
    │ 43 │ User4 │
    │ 44 │ User5 │
    └────┴───────┘
    

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. To avoid paying for them, delete the resources you no longer need:

  1. Make sure the transfer status is Completed, upon which you can delete the transfer.

  2. Delete the source endpoint.

  3. Delete other resources using the same method used for their creation:

    Manually
    Terraform
    1. Delete the Managed Service for ClickHouse® cluster.
    2. Delete the Yandex MPP Analytics for PostgreSQL cluster.
    3. Delete the target endpoint.
    1. In the terminal window, go to the directory containing the infrastructure plan.

      Warning

      Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

    2. Delete resources:

      1. Run this command:

        terraform destroy
        
      2. Confirm deleting the resources and wait for the operation to complete.

      All the resources described in the Terraform manifests will be deleted.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Loading data from Yandex Object Storage to Managed Service for ClickHouse® using Yandex Data Transfer
Next
Migrating a database from MySQL® to ClickHouse® using Yandex Data Transfer
© 2025 Direct Cursus Technology L.L.C.