Skip to content

Upgrade

Jachen Duschletta edited this page Feb 18, 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, 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 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