When teams move analytical workloads to ClickHouse and who does the work
A ClickHouse migration is a data, schema and query rewrite project carried out in infrastructure you control. Most teams keep ownership of the data and the cutover decision, while a partner often carries the translation, backfill and dual-running work. The trigger is usually a log, event or analytics workload on Elasticsearch, PostgreSQL, a cloud data warehouse or ClickHouse Cloud that has outgrown its current setup or its cost profile, such as query latency that no longer meets dashboards, storage growth that makes retention expensive, or index and tuning effort that consumes more engineering time each quarter.
Start by separating two things that are easy to confuse. The ClickHouse server is licensed under Apache-2.0, and you can run it on your own hosts or cloud accounts. ClickHouse Inc. sells ClickHouse Cloud as a separate managed service. Choosing the self-hosted server means your team owns the cluster, Keeper nodes, backups and upgrades, so the migration plan has to include those operating duties from day one, not only the data load. Confirm the license terms and the current release lines against the ClickHouse GitHub repository before you write the business case.
The source system usually keeps running until cutover. Elasticsearch, PostgreSQL or the warehouse continues to serve current users while ClickHouse receives a historical backfill and a live feed of new events. Ask your team to name the consumers of the source system, including dashboards, alerting rules, scheduled exports and ad hoc analyst queries, because each one must be rewritten, validated or retired. Agree in writing who signs off on query parity, who owns the rollback path, and how long both systems run in parallel.
What a ClickHouse migration project includes
A migration moves working reporting, alerting and log search onto a new engine without breaking the people who depend on them. The six components below run in sequence, but they overlap: the inventory defines what the schema must support, and dual running is what gives the team evidence to cut over.
Source inventory and workload mapping
Catalogue every table, index, dashboard, alert, scheduled job and downstream consumer that reads from the current system, along with its volume, freshness needs and owner. Separate append-only event data from data that is updated or deleted in place, because that split decides the table engine choice. The deliverable is a source inventory with a workload map that assigns each item to migrate, rewrite, retire or keep where it is.
Target schema in MergeTree tables
Translate source mappings into MergeTree-family tables, choosing sort keys around the filters your queries actually use rather than copying source indexes one for one. Decide partitioning, TTL retention and data types, and check how the design maps to ReplicatedMergeTree when replication is required. The deliverable is a target schema document with the reasoning behind each sort key and retention rule.
Replication docsIngestion and backfill pipelines
Build the feeds that carry new events into ClickHouse and the one-time jobs that load historical data. Backfill needs its own batch sizing, ordering and idempotency rules so that a rerun does not duplicate rows, and it must not starve live ingestion. Ask who owns the source connectors after handover. The deliverable is a backfill runbook covering sequencing, checkpoints, row count checks and rollback steps.
Query rewrites for dashboards and alerts
Dashboards, saved searches and alert rules are written in the source dialect and often depend on behavior that differs in ClickHouse, such as null handling, time bucketing, full-text matching and joins. Each query is rewritten, tested against the new schema and marked by its outcome. Alert thresholds need extra attention because a small change in result shape can silently stop an alert from firing. The deliverable is a query compatibility list with status and owner for each item.
Dual running with result comparison
Run the old and new systems side by side on the same live input for an agreed period. Compare aggregates, row counts and sampled records for each migrated workload, and record every difference with its cause. Differences that come from the source being wrong should be documented and signed off, not hidden. The deliverable is a parity report with the agreed tolerances and the sign-off owner for each workload.
Cutover with rollback
Move each workload to ClickHouse in a controlled order, with a named change window, a rollback path to the source system and a clear point after which the old data is no longer the record. Confirm that restores from ClickHouse backups have been tested before the old system is decommissioned, since a backup that was never restored may not restore when needed. The deliverable is a cutover record per workload, including the decision, the time and the rollback test result.
Backup and restore docsWhat drives ClickHouse migration cost and duration
This table lists the factors that move migration effort from Elasticsearch, PostgreSQL or a cloud warehouse to self-hosted ClickHouse, with the reason each one matters and a practical way to keep it down. Read it before requesting a quote, because the drivers that dominate your estimate depend on your source systems and the queries your teams rely on. No durations are given here, since none were supplied; confirm them against your own inventory.
| Driver | Why it moves effort | How to keep it down |
|---|---|---|
| Source systems and indexes or tables | Each Elasticsearch index, PostgreSQL schema or warehouse dataset needs its own mapping to a ClickHouse table design, sort key and partitioning plan. Effort grows with the number of distinct shapes, not just the count of objects. | Group sources by shape, migrate one representative table per group first, and retire tables nobody reads before mapping them. |
| Data volume and history to backfill | Backfill runs through ingestion and validation, so total history drives load time, verification effort and the storage tiers you must size before cutover. | Agree a backfill window with data owners, such as the retention period actually queried, and backfill older data only where a regulation or audit requires it. |
| Query count and complexity | Full-text search, joins, window functions and nested JSON access often need rewrites because ClickHouse does not behave like Elasticsearch or PostgreSQL. Each rewritten query needs result comparison. | Rank queries by business use and frequency, then migrate the top group and drop dashboards and saved searches that no one has opened recently. |
| Ingestion sources | Each producer (agents, Kafka topics, batch exports, change data capture) has its own format, delivery guarantees and failure modes that must be matched during dual running. | Move one ingestion path at a time and keep the source format unchanged where possible, adding a transformation layer only where needed. |
| Dashboard and alert integrations | Dashboards, alert rules and downstream exports reference the old query language and field names, so each one needs a reconnect and a check that alerts fire the same way. | Inventory alerts first, since they carry the highest operational risk, and consolidate duplicate dashboards before reconnecting them. |
| Number of environments | Development, pre-production and production each need the schema, ingestion and access controls applied and verified. The ClickHouse production guidance recommends a pre-production environment with representative data and queries. | Build infrastructure as code once and promote it across environments, and confirm early whether pre-production can hold a representative data sample rather than a full copy. |
| Compliance evidence needed | Assessors may ask for access control configuration, backup restore test records, audit logging and data handling evidence. Each item adds documentation and test work beyond the data move itself. | Define the evidence list in the scope before work starts, and map each item to the control that produces it so it is collected during the build. |
| Target edition and deployment model | Self-hosting the open-source server means your team or the partner handles Keeper nodes, backups, upgrades and monitoring. Managed options shift some of that work but change the commercial and data residency questions. | Confirm the deployment model early, state the Keeper and backup responsibilities in writing, and ask each quote to list which items are included. |
How a ClickHouse migration runs, phase by phase
The sequence moves a workload from its current system to ClickHouse in controlled stages, with a written output at each gate so that the cutover decision rests on reconciled data and verified queries. Each phase ends with a record the client can review, and the old system stays in service until the final go decision.
Inventory sources, queries and consumers
The team lists every data source, ingestion path, retention rule, dashboard, alert, scheduled report and downstream consumer that touches the current Elasticsearch, PostgreSQL or warehouse workload. The client's data owners and platform engineers confirm each entry, including who depends on which query and how often it runs. The output is a signed inventory. The phase is complete when the client's owners have signed it and no consumer is unassigned.
Record the target schema and key design
Engineers translate each source structure into ClickHouse table definitions, choosing sort keys, partitioning, data types and the ReplicatedMergeTree layout that matches the expected query patterns and replication topology. Decisions about Keeper nodes, retention and storage tiers are recorded alongside the schema, with the reasons for each choice. The output is a schema and key design record. The phase closes when the client's architects accept the record and the open questions are resolved or assigned.
Build pre-production on a representative sample
The team deploys a pre-production ClickHouse environment with a representative data sample and the real query set, not synthetic benchmarks alone. The ClickHouse production FAQ recommends this kind of pre-production environment before production use. Ingestion pipelines, access controls and backup jobs are exercised here so that problems surface before any production traffic is involved. The phase is complete when the sample loads, the target queries run, and the results are reviewed with the client.
Backfill history and reconcile counts
Historical data is loaded from the source in batches, and each batch is reconciled against the source by row counts, key ranges, aggregates and checksums agreed in the design phase. Discrepancies are traced to type conversion, timestamp handling, deduplication or ingestion gaps and fixed before the next batch. The output is a backfill reconciliation report listing each table, its checks and any accepted differences. The phase closes when the client signs off the differences.
Rewrite queries and validate parity
Each query from the inventory is rewritten for ClickHouse syntax and functions, then run against both the old and new systems over the same time window. Results are compared for correctness, and latency and resource use are measured against the expectations set by the client. Queries that cannot match exactly are flagged for a decision by the consumer. The output is a query parity list with a status for every query. The phase is complete when every query is matched, approved as changed, or retired.
Run old and new systems in parallel
Live ingestion is sent to both the existing system and ClickHouse, and consumers can read from either side while the team compares results daily or on a schedule the client sets. Alerting on ingestion lag, failed inserts, replica health and backup jobs is active on the new cluster. Any mismatch is logged and fixed at its source. The phase ends once the client's owners agree the results have been stable across the agreed window, and the length of this window depends on the effort drivers in the design, not on a fixed period.
Cut over and decommission the old system
Consumers are switched to ClickHouse in an agreed order, and a cutover go or no-go record is completed beforehand, listing the checks passed, the rollback path and the named approvers. After cutover the old ingestion is stopped, but the source remains readable for a retention period the client sets. Decommissioning removes the old system only after backups are restore-tested on the new cluster, as the ClickHouse backup documentation advises. The output is a closed cutover record and a decommissioning checklist.
Backfill and dual running sit beside the old system until cutover
The diagram starts at the source system, which stays live throughout. One path carries historical data into self-hosted ClickHouse as a backfill, while a second path forwards new changes in parallel so both stores stay current. A comparison step runs the same dashboards and queries against both sides, and only when results match does the cutover decision switch consumers. The dashed boundary marks any external export location, which sits outside the client's infrastructure and should be reviewed before data leaves it.
Backfill, live change path and comparison gate around the source system.
How the migration changes by source system
Elasticsearch workloads are usually log and search workloads built around full-text queries, relevance scoring, and index lifecycle policies that delete or roll over indices by age. ClickHouse handles the analytical side of this well, but it does not have an inverted-index search model that maps one to one onto Elasticsearch queries. The main translation problem is turning search-style queries (match, phrase, fuzzy, scored results) into SQL filters, token indexes or pattern searches, and deciding which of those behaviors the business actually depends on.
- Query semantics: Full-text relevance scoring and fuzzy matching need a different approach in ClickHouse. Inventory every saved query, dashboard and alert before deciding what must be reproduced.
- Index-based retention: ILM policies map to table TTL and partition drops, but the rules must be re-derived and tested, not copied.
- Mapping and types: Dynamic fields and nested JSON need an explicit schema decision, including which fields become columns and which stay in a JSON or string column.
- Ingestion path: Beats, Logstash or agents writing to Elasticsearch need a new sink, with a tested backfill for historical indices.
- Dual running: Run both systems against the same events long enough to compare result counts for representative searches.
Confirm with your team which Elasticsearch features are in use (scoring, aggregations, alerting, Kibana saved objects) and with the ClickHouse documentation which functions cover each one in the version you plan to run.
PostgreSQL usually holds relational tables that were not designed for analytics, and teams move analytical reporting to ClickHouse when row-level queries over large append-only tables become slow. The translation problem is mostly about what the data model assumes. Foreign keys, unique constraints, transactions and row-level updates do not carry over, and ClickHouse is built for append-heavy workloads with a sort key that defines how data is stored on disk. Joins also behave differently at scale, so queries that depended on the planner handling small lookup tables need to be rewritten and measured.
- Constraints and updates: Enforced uniqueness and frequent in-place updates must be redesigned, often as insert-only event tables with versioned or replacing logic.
- Sort key design: The primary key in ClickHouse should follow the most common filter patterns, which is a different decision from PostgreSQL indexes.
- Join rewrites: Large joins and correlated subqueries need review, and dimension tables may be better denormalized or loaded as dictionaries, depending on the query.
- Change capture: Logical replication, Debezium or batch extracts each have different ordering and deletion behaviors that the backfill must respect.
- Dual running: Compare aggregates from both systems over the same window, including late-arriving rows.
Confirm with your application owners which PostgreSQL queries are truly analytical and which are transactional, since transactional workloads often should stay in PostgreSQL.
Moving from a cloud data warehouse usually means a SQL dialect change, a data export path and a cost question about moving data out of the provider. SQL differences cover function names, date and time handling, array and struct types, window function syntax and how NULLs and casts behave. Export paths vary by provider and format, and egress charges can be a material part of the project, so the export route should be priced before the cutover plan is fixed. Warehouse-specific features such as materialized views, scheduled tasks and access policies also need separate treatment.
- Dialect translation: Automated SQL conversion helps with the mechanical parts, but every converted query needs a result comparison against the source.
- Export and egress: Check the provider's export formats and any charges for reading data out, and estimate volumes from your own storage reports.
- Semantic differences: Rounding, timestamp time zones and integer overflow can change results silently, so compare checksums on sample partitions.
- Scheduled transformations: Pipelines built on warehouse tasks or dbt models need to be rebuilt against ClickHouse targets.
- Access controls: Row-level security and masking policies must be mapped to ClickHouse row policies and roles, not assumed to carry over.
Confirm with your provider the export formats and egress terms that apply to your contract, and confirm with your data team which warehouse features your models depend on.
Moving from ClickHouse Cloud to a self-hosted deployment, or the reverse, is mostly a question of operations, licensing and data location rather than SQL. ClickHouse server is open source under the Apache License 2.0, and ClickHouse Inc. sells ClickHouse Cloud as a managed service. Schema and queries usually transfer with little change, but the features around the server (managed backups, scaling, access integration, networking and billing) differ by deployment model. Teams moving in either direction should not assume feature parity between the managed service and their own cluster without checking each item.
- Version alignment: Match the server version used in the source deployment, or plan an upgrade and test it in pre-production, since settings and defaults can change between releases.
- Backup and restore: Native BACKUP and RESTORE can move data between environments, but test-restore into the target before relying on it.
- Identity and access: Managed SSO, users and API keys do not transfer automatically, so map them to the authentication methods you run.
- Data location: Confirm where data is stored and processed in the managed service and in your target, since residency terms drive the design.
- Licensing terms: Review the license and service agreements for both paths before committing, and confirm what the managed service includes that your own cluster would need to supply.
Confirm with ClickHouse Inc. or your account contact which managed features and terms apply to your contract, and confirm with your platform team which of those features you will need to build yourselves.
Which migration work teams keep in-house and which they outsource
This table compares eight migration steps from source inventory to post-cutover operations, naming who usually owns each one, the skill it needs and whether an internal team or a partner is the better fit. Read it to decide where to keep people on your side, especially for query rewrites and dashboard ownership, which stay with internal owners even when a partner runs the pipelines.
| Migration step | Usual owner and skill needed | Better fit |
|---|---|---|
| Source inventory | Data platform lead with knowledge of which Elasticsearch indices, PostgreSQL tables or warehouse models are live, and who consumes them | Internal team, since only your staff know which consumers depend on which data |
| Schema translation | Data modeling and SQL dialect knowledge to map fields, types and sort keys into MergeTree tables | Partner for the first design, with internal review of query patterns that drive the sort key |
| Pipeline and backfill engineering | Pipeline engineering to move events, handle retries and load historical data without duplicates | Partner, provided the pipeline runs inside your infrastructure and your team can operate it afterward |
| Query rewrites | SQL dialect knowledge for ClickHouse, or Elasticsearch query DSL and PostgreSQL SQL as the source language | Internal query owners, because they know the business meaning of each query and its results |
| Dashboard and alert owners | Observability and reporting skills to repoint dashboards, alert rules and thresholds | Internal team, since alert behavior and thresholds are business decisions |
| Dual-running validation | Data validation and observability to compare row counts, aggregates and query results between old and new systems | Shared, with a partner building the comparison and internal owners signing off on differences |
| Cutover approval | Accountable business and technical owners who accept the validation results and the rollback plan | Internal team only, because approval carries business and compliance accountability |
| Post-cutover operations | Platform operations for replicas, Keeper, backups, restore tests and version upgrades | Partner under a support agreement, or internal team if the staff and runbooks are in place |
Where ClickHouse migrations usually go wrong and how to prevent it
Most failed ClickHouse migrations fail in the same few places: the data model, the data load, the query behavior, and the recovery path. Each card below names one of these failure points and the control that prevents it before cutover.
Sort key chosen without real queries
Teams often copy the old system's index or partition layout into ClickHouse without checking how queries will actually filter and group data. A sort key built from ingestion order rather than the dominant filter columns can make common queries scan far more data than expected. Before cutover, capture the top queries from the source system and run them against a pre-production table loaded with representative data. Compare scanned rows and latency, then adjust the sort key and partitioning until the hot queries behave as expected.
Production FAQBackfill never reconciled to source
A backfill that finishes without errors is not the same as a complete one. Batches can be skipped, retried twice, or filtered by timezone or null handling, and the gap stays invisible until a report disagrees. Reconcile row counts per partition, per day and per key range against the source, and compare a sample of checksums on the highest-value columns. Keep the reconciliation queries in version control so they can be rerun after every catch-up load and before dual running ends.
Rewritten queries without parity checks
Translating SQL from Elasticsearch query DSL, PostgreSQL or a cloud warehouse changes how nulls, time zones, aggregation order and string matching behave. A query can return plausible numbers that are subtly different from the original. Run old and new queries side by side on the same time window, and compare results for each dashboard, alert and report. Treat any mismatch as a defect in the rewrite until the difference is explained and signed off by the team that owns the figure.
Untested backup at cutover
A backup that has never been restored is an assumption, not a recovery plan. The ClickHouse backup documentation warns that a backup never test-restored will probably not restore properly when it is needed. Before cutover, restore the backup to a spare cluster, run row count and query checks against the restored tables, and time the restore so the recovery window is known. Repeat the restore test on a schedule after go-live, not only once.
Backup and restore docsReplication mistaken for backup
Replicas protect against a node failing, but they also copy a bad delete, a faulty ingestion job or a dropped table to every replica. The ClickHouse replication documentation is clear that replication alone does not protect against human error or corruption. Keep separate backups in storage outside the cluster, with retention periods agreed with the data owners, and confirm that a restore can be done without the original cluster still running.
Default user left fully privileged
A new ClickHouse environment starts with a default user that has all permissions, and migration tooling often reuses it for convenience. That account then ends up in scripts, dashboards and service configurations, and it bypasses the access model the team designed. Before any production data arrives, restrict or disable the default user, create named service accounts with only the grants each pipeline needs, and use roles and row policies for analysts. Review grants again at cutover.
Access control docsWhat you need to provide before a ClickHouse migration starts
The most useful thing you can provide before a migration starts is read access to the source systems and an honest inventory of what runs against them. That means read access to the Elasticsearch indices, PostgreSQL schemas or cloud warehouse datasets being moved, the schema definitions for each, and a sample of representative data large enough to show skew in timestamps, tenant identifiers and high-cardinality fields. Alongside that, supply the full query and dashboard inventory, including scheduled jobs, alerting rules and any saved searches. Queries that exist only in someone's notebook are the ones most often missed in a rewrite, and they are usually the ones the business notices first after cutover.
Each consuming application needs a named owner who can confirm expected results, latency targets and acceptable differences during dual running. Decisions on retention periods and data location also belong to you, not to the implementation team: how long each dataset must be kept, whether any of it is subject to residency or legal hold rules, and which infrastructure may hold copies during backfill. The target environment must be decided too, including the Keeper host plan. The ClickHouse replication guide recommends at least three Keeper nodes on dedicated hosts in production, each with about 4 GB of RAM, so confirm early that those hosts exist or can be procured.
Finally, set aside a window for dual running and a pre-production environment with representative data and queries. Cutover should not be decided until the same queries have been compared against both systems on that data. Confirm with your platform team how long the old and new systems can run in parallel, who signs off on result differences, and what rollback looks like if a discrepancy appears. Your auditors and security reviewers will also ask where the copies live during backfill, so agree those locations in writing before the first load.
Questions buyers ask before hiring help for a ClickHouse migration
How much does a ClickHouse migration cost?
The cost depends on the effort drivers in your written scope, and DeployOpen does not publish a price list, so a quote follows from that scope. The main drivers are how many source tables, pipelines and dashboards need to move, how much history must be backfilled, how much your queries need rewriting from Elasticsearch query DSL, PostgreSQL SQL or warehouse-specific SQL, and whether you need replication, backups and access control in place at go-live. Ask for the quote to split one-time work (schema translation, backfill, validation, cutover) from recurring items (retainers, upgrades, retests) and to name who performs each part. Your own infrastructure and cloud costs are separate from the services fee.
How long does a ClickHouse migration take?
No fixed duration is promised, because the timeline follows from the same drivers as cost: data volume to backfill, number of workloads, query complexity, the number of ingestion pipelines to repoint, and how many environments you run for dual running. Ask for the timeline as phases with exit criteria, such as a pre-production environment with representative data and queries that matches your production query patterns. Your change windows, approval cycles and the availability of source-system owners often affect elapsed time as much as the technical work.
Can our internal team migrate to ClickHouse without a partner?
Yes, if your team has strong SQL skills, experience operating data pipelines and the time to run a pre-production environment. Schema translation and query rewrites are often within reach of an experienced data engineer, especially for log and event data. A partner is most useful for the parts that are easy to underestimate: large historical backfills, reconciliation between source and target row counts and aggregates, dual-running comparisons, and cutover rehearsals. Decide early which of these your team will own, because validation is where migrations usually stall.
What do we have to provide for a ClickHouse migration?
Expect to provide access to the source systems, a representative sample or copy of the data, a current inventory of queries, dashboards, alerts and ingestion pipelines, retention requirements, and named owners for each downstream consumer. You also need cloud or data center capacity for the target cluster, decisions on replicas and Keeper nodes, and a pre-production environment. Security requirements such as identity integration, network rules and audit expectations should be written down before the build starts. Missing inventory is the most common reason scope changes after the quote.
Does our data leave our infrastructure during the migration?
Under a DeployOpen engagement, work is done inside your own infrastructure: your cloud accounts, data centers or air-gapped networks, so your data stays there. The exact data path depends on your design. If you move data through object storage, a backup location or a staging bucket, that location must be inside your control and approved by your security team. If you are migrating from ClickHouse Cloud or another managed warehouse, the export step is governed by that provider's terms and your own network path, so confirm it in writing before the first transfer.
Can we switch off the old system at cutover?
Switch-off should happen only after a defined dual-running period in which both systems receive the same ingestion and the outputs are compared. The decision rests on evidence: matching row counts, aggregates and sampled query results, dashboards and alerts verified against agreed thresholds, and a tested rollback path. Restoring the old system is far easier while it still holds data, so keep it read-only for a retention window you agree in advance. Keep backups of the old data before decommissioning, and confirm that your retention and compliance rules allow deletion.
How does a migration differ from installing ClickHouse fresh?
A fresh install starts from empty tables and new pipelines. A migration adds the work of mapping existing data and behavior: translating schemas and types, choosing sort keys based on real query patterns, backfilling history without disrupting live ingestion, rewriting queries that relied on the old engine's semantics, and proving equivalence through dual running. It also carries over operational duties such as retention, replication and tested backups from day one. Ask any provider to show how it will validate results against the source, because that step separates a migration from a deployment.
How DeployOpen scopes, delivers and hands over a ClickHouse migration
DeployOpen plans and runs ClickHouse migrations from Elasticsearch, PostgreSQL, a cloud data warehouse or ClickHouse Cloud inside your own infrastructure. Each engagement starts with a written, fixed scope that covers schema translation, backfill, query rewrites and dual running, so your team knows what gets built, tested and handed over before work begins.
How we scope
- Inventory source tables, indexes, event volumes, query patterns and retention rules before any schema is written.
- Agree in writing which workloads, dashboards and queries move, and which stay on the source system.
- Define the pre-production environment with representative data and queries, and the cutover criteria each side must meet.
How we build
- Translate source schemas into ClickHouse table designs, including sort keys and partitioning chosen for your query shapes.
- Backfill historical data in controlled batches, then reconcile row counts and key aggregates against the source.
- Rewrite queries for ClickHouse semantics and run dual running with output comparison before any cutover decision.
How we hand over
- Deliver schema definitions, ingestion pipeline configuration, query translation notes and reconciliation results as documentation.
- Test a backup restore on a spare cluster and record the procedure, since an untested backup may not restore when needed.
- Walk your platform, data and security teams through runbooks for replication, Keeper, retention and access control.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, agreed separately from the migration scope.
- Upgrade planning follows the ClickHouse changelog and supported version list, with pre-production testing before each change.
- Confirm with us during scoping which support hours, response expectations and upgrade responsibilities the retainer would cover.

