Skip to content

Upgrade

Jachen Duschletta edited this page Apr 19, 2022 · 9 revisions


Codefresh build status CodeQL

cLoki

Major Upgrades

1.x to 2.x

Version 2 introduces breaking changes to the samples table. CLoki will create a new samples table to support the new schema, the data that has previously been written will still be available, but with a slightly slower performance.

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 and samples 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
Clone this wiki locally