-
-
Notifications
You must be signed in to change notification settings - Fork 69
Upgrade
Jachen Duschletta edited this page Feb 18, 2022
·
9 revisions
Version 2 introduces breaking changes to the samples table. CLoki will create a new samples table to support the new schema, however data that has previously been written will not be available via the API until the data is updated.
To migrate the data after cloki v2.x has been installed and run, please follow below steps:
- Log into clickhouse via it's client cli
clickhouse-client --host 127.0.0.1 --user=default --password=yourClickhousePassword
- Navigate to your cloki database, via the
USE
command (default database name is cloki)
USE cloki;
- Migrate past data from
samples_v2
andsamples
tables with the below commands
INSERT INTO samples_v3 (fingerprint, timestamp_ns, value, string) SELECT fingerprint, timestamp_ms * 1000000 as timestamp_ms, value, string from samples_v2
INSERT INTO samples_v3 (fingerprint, timestamp_ns, value, string) SELECT fingerprint, timestamp_ms * 1000000 as timestamp_ms, value, string from samples
- After successful completion of the INSERT into samples_v3, you delete the old tables via
DROP TABLE samples
DROP TABLE samples_v2