Migrate from ClickHouse Cloud to self-managed ClickHouse

Moving from ClickHouse Cloud to self-managed ClickHouse is mostly a schema, data copy and client cutover job. This page maps what moves cleanly, what needs rework, the sequence, and what drives effort.

On this page

Migrate from ClickHouse Cloud to self-managed ClickHouse: what it involves

Moving off ClickHouse Cloud is a database operations project with a defined cutover, not a change of database. The server you run afterward is the same open-source ClickHouse, licensed under Apache-2.0, so the SQL, table engines and most client behavior carry over. The work is in building the cluster, copying data, replaying recent writes and switching traffic at a planned moment. Platform or data engineering teams usually own it, with a DBA-minded owner who signs off on schema, replication, backup and restore decisions. Plan for that person to be the one who answers for data integrity after cutover.

The first decisions are structural. Tables that run on SharedMergeTree in ClickHouse Cloud must be recreated on ReplicatedMergeTree, with the replication path and macros set per replica, and ClickHouse Keeper deployed as the coordination layer on dedicated hosts. Confirm the cluster topology, the Keeper node count and the disk layout before any data moves. Then copy historical data with remoteSecure, and keep a window of recent inserts that you replay into the new cluster before switching writers. Users, roles, quotas and settings must be exported and recreated deliberately, since they do not follow the data. Confirm which ClickHouse release line you will run, using the production guidance and the current security policy, before you build.

The risk that matters most is a cutover that looks clean but cannot be restored. Replication protects against node failure, not against a bad delete or corrupted parts, so set up BACKUP and RESTORE to storage you control and run a restore test on a spare cluster before you retire the cloud service. Ask your implementation partner or internal team to write a rollback plan that names the point after which writes go only to the new cluster. Confirm the exact cutover steps, data volume and window length in your own environment, since these depend on your workload and cannot be assumed from this page. A ClickHouse documentation page on migrating from Snowflake shows the general export pattern, which you can adapt to a cloud-to-self-hosted move.

Which ClickHouse Cloud features map to self-managed ClickHouse, and which need rework

This table maps the ClickHouse Cloud features that matter during a move to their self-managed equivalents and marks where schemas, operations or access need rework. Read the clean rows as direct carry-overs and the rework or gap rows as work to scope before cutover. Confirm any ClickHouse Cloud feature not covered here against current vendor documentation before you rely on it.

CapabilitySelf-managed equivalentMigration note
Table enginesReplicatedMergeTree tables on each replica, coordinated by ClickHouse KeeperNeeds rework: SharedMergeTree tables on object storage must be recreated with ReplicatedMergeTree, and DDL should be checked per table
Replication and KeeperClickHouse Keeper replaces ZooKeeper; the replication guide recommends at least three Keeper nodes on dedicated hosts in productionNeeds rework: you build and operate the Keeper quorum yourself, which Cloud handles for you
Replica recoveryA recovered replica automatically syncs missing data from a healthy replicaClean: replica catch-up needs no manual step once the cluster is running
BackupsBACKUP and RESTORE to local disk, S3-compatible storage or Azure Blob Storage, with full and incremental modesNeeds rework: you define schedules, storage and retention; replication alone does not protect against human error or corruption
Restore testingRegular restores to a spare cluster, as the backup documentation recommendsGap: no equivalent is provided by default, so plan and staff restore tests before cutover
Users and access controlSQL-based users, roles and grants managed through the access control documentationNeeds rework: recreate users, roles and row policies on the new cluster and verify each grant
External authenticationLDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT authenticationNeeds rework: confirm which method your Cloud setup uses and configure the matching external authenticator
Upgrades and release channelsStable releases roughly monthly, LTS releases twice a year, and the security policy lists supported versionsGap: you choose versions, test them in a pre-production environment and read changelogs before each upgrade
ScalingAdding shards and replicas and rebalancing data by hand or with your own toolingGap: Cloud scaling is managed for you, so confirm capacity planning and the procedure for adding nodes
Other Cloud-only featuresConfirm each feature against current ClickHouse Cloud and self-managed documentationGap: features not covered by the supplied facts must be checked individually before cutover

Which data, users and integrations to move, and by which documented path

A ClickHouse Cloud move is several separate transfers, not one dump. Schemas, data, access control, settings, client connections and recent inserts each follow their own path and each needs its own check before cutover.

Table schemas and data

Recreate each table on the self-managed cluster as a ReplicatedMergeTree table, since SharedMergeTree is a Cloud-only engine, then pull rows with the remoteSecure table function from a server you control. Check engine parameters, partition keys and TTL clauses against the source, because the copy only moves rows, not the DDL that defines them. Use SHOW CREATE TABLE on the source as the reference for each table.

Replication docs

Export path for large tables

For tables that are too large to pull over a single connection, write Parquet files to your own bucket with INSERT INTO FUNCTION s3 and read them back on the new cluster. Confirm egress charges for the volume you plan to move, since this path is billed by your cloud provider and by ClickHouse Cloud. The sibling export page describes what each option preserves.

Users, roles and grants

Users, roles, row policies and quotas do not copy with table data. Recreate them with the access control statements on the self-managed cluster, and map each Cloud user to an authentication method you run, such as LDAP, Kerberos, X.509 certificates or JWT. Review grants one role at a time so that no account gets broader access than it had in the source.

Access control docs

Server settings and profiles

Query-level settings, settings profiles, and server configuration files are not part of a data copy. Compare the Cloud service settings with your own config.xml and users.xml values, including memory limits, timeouts and default database settings, and record every difference you accept. Validate these on a pre-production cluster with representative queries before the first production load.

Client endpoints and connections

Applications, BI tools and ingestion jobs point at Cloud hostnames, ports and credentials that must each be replaced. Inventory every client, switch them in groups, and confirm TLS settings and certificate trust on the new endpoints before changing DNS or connection strings. Keep the old endpoint available until each group has run cleanly.

Replaying recent inserts

Rows written after the bulk copy began are not included in it, so replaying recent inserts is a separate step. Choose a cutover window, pause or duplicate the write path, and replay the inserts from your ingestion source or the copy's end timestamp. Confirm row counts per partition on both sides before switching writes.

Materialized views and dictionaries

Materialized views and dictionaries are not safe to assume will carry over. Each materialized view has a target table and a query that must be recreated and checked, and each dictionary needs its source connection and refresh settings rebuilt. Test each one on the new cluster and confirm its output matches the source before you depend on it.

Migration sequence from inventory to decommission

This sequence moves a ClickHouse Cloud workload to self-managed ClickHouse in controlled stages, so each step has a checkable output and the cutover happens only after the new cluster has matched the old one on representative data and queries.

  1. Inventory tables, engines and client traffic

    Document every database, table and engine in ClickHouse Cloud, including SharedMergeTree tables, materialized views, dictionaries, users, roles, quotas and settings profiles. Pull query logs to see which applications, service accounts and endpoints generate load, how often, and at what peak times. Record the row counts, partition layout and approximate on-disk size per table, since these drive cluster sizing and copy time. The output is a written inventory that the team signs off, with each client endpoint named and mapped to an owner.

  2. Pilot on a non-production copy

    Restore a representative subset of the data into a non-production ClickHouse environment, using the schema recreation approach described in the topic guides. Replay the most important production queries against both systems and compare results, row counts and latency. Note any function, setting or table engine that behaves differently, and confirm the pilot covers the largest and most frequently queried tables. The output is a pilot report listing every mismatch and its fix, and a decision on whether the schema translation is ready for the full build.

  3. Build the self-managed cluster with Keeper

    Provision the self-managed ClickHouse cluster with ReplicatedMergeTree tables in place of SharedMergeTree, coordinated by ClickHouse Keeper. The ClickHouse replication guide recommends at least three Keeper nodes, on dedicated hosts in production, with about 4 GB of RAM each. Configure users, access control, external authentication, TLS, backups to S3-compatible or Azure Blob Storage, and monitoring before any data is loaded. Test a replica failure and confirm that the recovered replica resynchronizes. The output is a documented, tested cluster with a restore test already passed on a spare environment.

  4. Copy history and replay recent inserts

    Copy the historical data from ClickHouse Cloud into the new cluster, using the remoteSecure pull or the object storage export path that suits the data volume and egress budget. Once the bulk copy completes, run both systems in parallel and replay the inserts that arrived after the copy started, so the self-managed cluster catches up. Reconcile row counts and checksums per table and partition on a schedule until the gap is closed. The output is a reconciliation record showing that each table matches within the agreed tolerance, with the replay window documented.

  5. Run in parallel and validate results

    Keep ClickHouse Cloud as the system of record while the self-managed cluster receives the same writes and serves read-only test traffic. Compare dashboards, scheduled reports and application outputs between the two systems across a full business cycle, and confirm that materialized views and scheduled jobs produce identical results. Verify that alerting, on-call runbooks and the backup restore test work against the new cluster. The output is a signed parallel-run report that lists open defects, their owners and the criteria the team agreed for cutover.

  6. Cut over clients and decommission

    Switch client connection strings, credentials and DNS entries to the self-managed endpoints in a planned window, starting with the lowest-risk services and ending with the most critical ones. Stop writes to ClickHouse Cloud, replay any final inserts, and confirm the last reconciliation is clean before moving the remaining readers. Keep the cloud service in read-only mode for an agreed retention period, then delete it and revoke the associated keys and users. The output is a closed cutover log, a confirmed inventory of removed endpoints, and written evidence that the cloud service has been decommissioned.

How data and client traffic move during the parallel run

The run starts in the ClickHouse Cloud service, which the vendor operates in its own account. A remoteSecure copy pulls historical tables into the self-managed cluster in the client's network, where ClickHouse Keeper coordinates the replicas. Recent inserts are then replayed so the two sides converge, and clients switch to the new cluster. Check row counts and recent data on both sides before the switch, and keep ClickHouse Cloud read-only until decommission, so it can still answer questions if the copy needs to be repeated.

Data and client traffic across the vendor boundary during the parallel run.

How to run both environments in parallel without losing recent writes

The bulk copy is only the first pass. Once the historical data is in the self-managed cluster, the ClickHouse Cloud service keeps receiving inserts, so the copy is already stale when it finishes. The practical approach is to copy the bulk data while writes continue, record the point in time that the copy covers (for example, by recording a per-table maximum of a timestamp or partition key that your inserts always carry), and then replay everything newer than that mark from the source into the target. Run this replay in a loop until the gap is small enough to close during a short write pause. Your ingestion pipeline should be able to write to both clusters during this window, so the replay is a safety net and not the only path for new data.

Before cutover, verify rather than assume. Compare row counts per table and per partition between the two environments, then run a set of your most important queries on both and compare the results, including aggregates over recent time ranges, since those are where a missed replay shows up first. Confirm that users, roles, row policies and settings were recreated, because a query that returns correct numbers for an account with the wrong grants is still a failed migration. Keep the ClickHouse Cloud service running and untouched after switching clients, so that a rollback means pointing clients back to a known-good source.

Plan the rollback path in writing before cutover: who decides, which connection strings or DNS entries change back, and how writes that landed on the new cluster during the trial period would be copied back if needed. Replication on your self-managed cluster keeps copies across replicas, but the ClickHouse replication documentation notes that replication alone does not protect against human error or corruption, because a bad DROP or DELETE is replicated too. Configure backups with BACKUP to S3-compatible or other external storage, and then restore one to a spare cluster. The ClickHouse backup documentation warns that a backup never test-restored will probably not restore properly when needed, so schedule that restore test before go-live and confirm that row counts match the source.

How the migration differs by starting point and cluster size

A single large table with a small number of queries is the simplest starting point. The main work is recreating one table with a ReplicatedMergeTree engine in place of SharedMergeTree, choosing a sorting key and partitioning that match the queries you already run, and confirming that the copy is complete before you point readers at it. Because there are few objects to move, most of the effort goes into verifying row counts and query results rather than into dependency mapping.

  • Engine and keys: Confirm the table definition, sorting key and TTL rules in the new cluster, since these do not transfer automatically from the Cloud service.
  • Copy method: Pull the table with remoteSecure or export it to Parquet in your own bucket, then compare counts and aggregates on both sides.
  • Recent inserts: Replay the rows written during the copy window so the target is current at cutover.
  • Query parity: Run your top queries against both systems and compare results, not just timings.
  • Single replica risk: A lone table on one node is easy to move but easy to lose, so plan replicas and backups before cutover.

Before you start, check whether the table uses any Cloud-only settings, and confirm with ClickHouse documentation which engine options apply to your target version.

What drives the cost and duration of the move

This table lists the factors that change how long a ClickHouse Cloud exit takes and what it costs to run afterward. Read each row as a lever: the driver explains why it matters, and the last column shows how teams usually keep it under control. Most of the one-time effort sits in copying data and rebuilding clients, while most of the recurring cost sits in servers, storage, Keeper and the people who respond to alerts.

DriverWhy it mattersHow to keep it down
Data volume and copy bandwidthTotal bytes to move set the copy window, and egress from ClickHouse Cloud is billed separately, so the cost of the first copy grows with table size.Measure compressed size per table, copy the largest and oldest partitions first, and confirm egress terms with the provider before starting.
Number of schemas and materialized viewsEach table, view and dependent materialized view needs its DDL rewritten for ReplicatedMergeTree and tested against the copied data.Export schema DDL into version control, group tables by dependency, and retire unused objects before the move.
Client integrationsEvery application, BI tool, ingestion job and scheduled query that points at the ClickHouse Cloud endpoint needs a new connection setting and a verified test.Inventory connection strings and service accounts early, and switch clients in waves with a rollback path for each.
Authentication modelUsers, roles, quotas and external authenticators such as LDAP, Kerberos or JWT must be rebuilt on the self-managed cluster, and mistakes here block access for entire teams.Export user and role definitions, map each external identity provider to the new cluster, and test logins with every role before cutover.
Kubernetes or VM platform choiceRunning on Kubernetes adds cluster, operator and storage class work on top of ClickHouse itself, while VMs add provisioning and configuration management work.Choose the platform your team already operates, and confirm with your platform owner which costs and skills it adds before sizing the cluster.
Backup and restore testingReplication does not protect against human error or corruption, so a backup that has never been restored is an unknown until a test proves it. Restore tests consume spare capacity and staff time.Schedule restore tests on a spare cluster from the first week, record restore duration, and keep backup storage costs in the recurring budget.
On-call readinessSelf-managed ClickHouse, Keeper and disks generate alerts that someone must answer, and a team without runbooks will absorb the cost in incident hours.Write runbooks for replica recovery and Keeper quorum loss, define an on-call rota before cutover, and ask your vendor or partner to confirm the support hours they offer.

What usually goes wrong and how to prevent it

Most failed ClickHouse Cloud exits do not fail in the database itself. They fail at the edges: data that arrived after the last copy, schemas that behave differently, accounts that were never recreated, and applications still pointing at the old host. The cards below pair each risk with a check you can run before and after cutover.

Missed recent inserts at cutover

Bulk copies finish while producers are still writing, so rows inserted after the copy started never reach the new cluster. Before cutover, stop or pause writers where you can, then replay the window of inserts that landed during the copy. Compare row counts and max timestamps per table between source and target. Ask your team which pipelines can write during the switch and which must be paused, and record the exact cutover timestamp.

Engine and schema differences break queries

ClickHouse Cloud tables use SharedMergeTree on object storage, while self-managed clusters need ReplicatedMergeTree tables coordinated by ClickHouse Keeper. Replicated tables need explicit ZooKeeper paths and replica names, so a schema exported unchanged can fail or behave differently. Recreate each table with the engine you intend to run, then run your top queries against both systems and compare results. Check materialized views and dictionaries individually.

Replication docs

Users and grants not carried over

Cloud users, roles and row policies do not move automatically with table data. Applications may connect successfully to the old host and then fail on the new one with access errors, or worse, run with broader privileges than intended. Inventory every service account and grant from the Cloud console, recreate them with the access control SQL, and test each application login. If you plan to use LDAP, Kerberos, X.509 or JWT authentication, confirm each external authenticator works before cutover.

Access control docs

Backups never test-restored

A backup that has never been restored is an assumption, not a recovery plan. ClickHouse BACKUP and RESTORE can write to local disk, S3-compatible storage or Azure Blob Storage, and replication alone does not protect against human error or corruption. Restore a backup into a spare cluster, check row counts and sample queries, and repeat on a schedule. Document who owns restores and how long a restore takes in your environment.

Backup docs

Client endpoints hardcoded to the old host

Applications, BI tools, ETL jobs and dashboards often store the ClickHouse Cloud hostname in configuration, environment variables or secrets. After cutover, some of these keep querying the old service or fail silently when it is retired. Inventory every connection string across services, move them to a single configurable endpoint such as a DNS name or load balancer, and keep the old host readable until every client has switched. Confirm secure connections on port 8443 or the protocol your clients use.

Version drift between old and new

A self-managed cluster can run a different ClickHouse version from the one your data and queries were tested on, and version choice has its own lifecycle. The production guidance recommends stable releases for most production use, a pre-production environment with representative data, and reading the changelog before upgrading because minor backward-incompatible changes can occur. The security policy lists which versions still receive security updates, so pick a supported line and schedule upgrades before it ends.

Latest stable line
26.9
Production FAQ

Questions teams ask before moving off ClickHouse Cloud

How long does moving off ClickHouse Cloud take?

The duration depends mainly on data volume, the number of tables and materialized views, how many client applications connect, and how much downtime the business will accept. Copying historical data over the network is often the longest step, while schema recreation and client switching are usually shorter. Build the estimate from your own measurements: total compressed size per table, the throughput you can sustain between the two environments, and the number of services that must change their connection settings. Ask any partner to show how they arrived at a timeline from those inputs, and to state the assumptions in writing before work starts.

Can our in-house team run self-managed ClickHouse without outside help?

Many teams with experienced database and platform engineers can, but the work is broader than installing a server. You need to operate ClickHouse Keeper, replicated tables, backups, monitoring, certificate and user management, and an upgrade process that follows the release channels. Check whether at least two people can handle an incident on the cluster, whether someone owns on-call coverage, and whether there is a tested restore procedure. If those gaps exist, an implementation partner can close them through a fixed-scope engagement or an ongoing support retainer, and your team keeps the skills after handover.

What does our team need to provide during the migration?

The migration needs access and decisions more than large amounts of time. Expect to provide a list of databases, tables, materialized views, dictionaries and users, read access to the ClickHouse Cloud service and query logs, a target environment in your own cloud account or data center, network routes between the two environments, and a named owner for cutover approval. Your application owners must confirm which queries and insert paths matter and which can be retired. Agree these inputs in the written scope so that the work does not stall while access requests are pending.

How do we keep data consistent between the old and new clusters during cutover?

The usual pattern is to copy historical data first, then replay or re-ingest the inserts that arrived after the copy started, and finally switch writes. Before cutover, compare row counts and aggregate checksums for each table and partition, and run your key dashboards and queries against both systems. Pause or dual-write producers during the final window so that no insert is lost or duplicated. Confirm with your engineers how your ingestion pipeline records offsets or timestamps, because that determines how precisely you can replay recent data. Keep the old cluster read-only for a rollback period you define in advance.

Do ClickHouse Cloud features like scaling and idling have direct equivalents?

Some have equivalents and some do not. Self-managed clusters scale by adding or resizing nodes and shards, which requires capacity planning and data rebalancing rather than a settings change. Idling has no automatic equivalent: you either keep nodes running and pay for them, or build your own start and stop procedures. Automatic storage separation on object storage is not the same as ClickHouse Cloud's SharedMergeTree, so storage layout and recovery behavior differ. Review the ClickHouse documentation for the version you plan to run and test each feature your workload depends on in a pre-production environment before you commit.

How should we choose a ClickHouse version and plan upgrades?

Choose a version from the supported list in the ClickHouse security policy, and check which lines the project currently supports with security updates. The production FAQ recommends stable releases for most production use and an LTS line where you need a longer support window, so decide which channel fits your change tolerance. Run every candidate version against a pre-production environment with representative data and queries, and read the changelog before each upgrade because minor backward-incompatible changes can occur. Write down who approves upgrades, how often you review the release list, and how you will roll back a failed upgrade.

Does self-hosting ClickHouse change our security and access controls?

It shifts responsibility to you. ClickHouse supports external authenticators such as LDAP, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT, and you configure access control and network exposure yourself. Confirm which authentication method your identity provider can serve, how user and role changes are audited, and how TLS certificates are issued and rotated. Ask your security team to review the cluster against your internal baseline before production data arrives, and to decide who can read backups, since those contain the same data as the live tables.

Are backups and restores handled by the self-hosted platform?

You own backups and restores. ClickHouse BACKUP and RESTORE can write full and incremental backups to local disk, S3-compatible storage or Azure Blob Storage, but replication alone does not protect against human error or corruption. Set a retention policy, store copies outside the cluster, and schedule restore tests on a spare cluster, because a backup that has never been restored may not work when you need it. Ask your team or partner to document the recovery time they can meet and to show a completed restore test before the old service is shut down.

How DeployOpen scopes and runs the migration

DeployOpen starts every ClickHouse migration with a written, fixed scope that names the databases and tables being moved, the ReplicatedMergeTree layout that replaces each SharedMergeTree table, the ClickHouse Keeper nodes and their hosts, the backup target, the users and roles to be recreated, and the client applications that will switch connections. Deliverables and timelines are agreed in writing before work begins, and the scope states what is out of bounds, such as dashboards or pipelines owned by other teams. Work runs in your own cloud accounts, data center or air-gapped network, so the cluster, its Keeper quorum, its backup storage and its access logs stay under your control. Ask for the list of deliverables to name each artifact you will receive, including configuration files, access-control definitions and test results.

Restore testing is the part of the scope most worth negotiating. The ClickHouse backup documentation warns that a backup that has never been test-restored will probably not restore properly when it is needed, and that replication does not protect against human error or corruption. DeployOpen plans restore tests of full and incremental BACKUP and RESTORE runs on a spare cluster, compares row counts and sample query results against ClickHouse Cloud, and records the time each step takes so the cutover window is based on measured numbers. The cutover runbook is written from those tests: the freeze point, the final replay of recent inserts, the switch of client connection strings, the rollback trigger and the owner of each step. Confirm with the provider who approves the runbook and who holds the decision to roll back.

After cutover, the work can continue under an optional retainer that covers version upgrades, backup restore drills and scheduled testing. Upgrades follow the ClickHouse production FAQ, which recommends a pre-production environment with representative data and reading the changelog first, and the security policy lists the versions that still receive security updates. A retainer is recurring, so ask for its scope, response expectations and what happens when a new stable or LTS line ships. DeployOpen prepares systems, controls and evidence for compliance reviews, but it does not issue audit reports, attestations or certifications, and independent auditors or certification bodies make those determinations. DeployOpen does not publish a price list; a quote follows from the written scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.