Skip to content

Commit

Permalink
Docs for MT convertation
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgarbar committed Dec 15, 2023
1 parent e000e0b commit 0f60259
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/en/engines/table-engines/mergetree-family/replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ We use the term `MergeTree` to refer to all table engines in the `MergeTree fami

If you had a `MergeTree` table that was manually replicated, you can convert it to a replicated table. You might need to do this if you have already collected a large amount of data in a `MergeTree` table and now you want to enable replication.

`MergeTree` table can be automatically converted on server restart if `convert_to_replicated` flag is set at the table's flags directory (`/var/lib/clickhouse/data/db_name/table_name/flags/`).
This directory is not created by default, so you need to create it first.
Then simply create empty `convert_to_replicated` file and the table will be loaded as replicated on next server restart.

There is also a manual way to do this without server restart.

If the data differs on various replicas, first sync it, or delete this data on all the replicas except one.

Rename the existing MergeTree table, then create a `ReplicatedMergeTree` table with the old name.
Expand Down

0 comments on commit 0f60259

Please sign in to comment.