Migrating between self-managed ClickHouse and ClickHouse Cloud
This guide will show how to migrate from a self-managed ClickHouse server to ClickHouse Cloud, and also how to migrate between ClickHouse Cloud services. The remoteSecure
function is used in SELECT
and INSERT
queries to allow access to remote ClickHouse servers, which makes migrating tables as simple as writing an INSERT INTO
query with an embedded SELECT
.
Migrating from Self-managed ClickHouse to ClickHouse Cloud
Regardless of if your source table is sharded and/or replicated, on ClickHouse Cloud you just create a destination table (you can leave out the Engine parameter for this table, it will be automatically a ReplicatedMergeTree table), and ClickHouse Cloud will automatically take care of vertical and horizontal scaling. There is no need from your side to think about how to replicate and shard the table.
In this example the self-managed ClickHouse server is the source and the ClickHouse Cloud service is the destination.
Overview
The process is:
- Add a read-only user to the source service
- Duplicate the source table structure on the destination service
- Pull the data from source to destination, or push the data from the source, depending on the network availability of the source
- Remove the source server from the IP Access List on the destination (if applicable)
- Remove the read-only user from the source service