Skip to main content

Upgrade to v0.9 from earlier versions

v0.9 is a breaking release which requires data migration, if you are upgrading from an older version then you have to run the data migration scripts to be able to see past data.

First upgrade to v0.9

Follow the platform specific instructions to upgrade to 0.9 and above.

Steps to run migration script:

For Docker

Change the directory to SigNoz repo and run following commands:

cd deploy/docker/clickhouse-setup

For ClickHouse

docker run --name signoz-migrate-clickhouse --network clickhouse-setup_default -it signoz/migrate:0.9-clickhouse -host=clickhouse -port=9000

For SQLite Database

docker run --name signoz-migrate-sqlite --network clickhouse-setup_default -it -v $PWD/data/signoz/:/var/lib/signoz/ signoz/migrate:0.9-sqlite -dataSource /var/lib/signoz/signoz.db

For Kubernetes

ClickHouse

kubectl -n platform run -i -t signoz-migrate-clickhouse --image=signoz/migrate:0.9-clickhouse --restart='Never' \
-- -host=my-release-clickhouse -port=9000 -userName=admin -password=27ff0399-0d3a-4bd8-919d-17c2181e6fb9

Steps to check logs:

kubectl -n platform logs -f signoz-migrate-clickhouse

In case of failure and have to run again, make sure to cleanup the pod before running the migration script again.

kubectl -n platform delete pod signoz-migrate-clickhouse

There are some custom flags which can be enabled based on different usecases.

All the flags below are optional

Flags:

  • -port : Specify port of clickhouse. default=9000
  • -host : Specify host of clickhouse. default=127.0.0.1
  • -userName : Specify user name of clickhouse. default=default
  • -password : Specify password of clickhouse. default=""
  • -dropOldTable : If it is set to true then the old tables will be dropped after data migration is successful default=true

SQLite

wget https://github.com/SigNoz/migration-0.9/releases/download/v0.9/migration-sqlite-v0.9-linux-amd64

chmod +x migration-sqlite-v0.9-linux-amd64

To copy the binary in persistent volume path /var/lib/signoz in query-service:

kubectl cp -n platform ./migration-sqlite-v0.9-linux-amd64 my-release-signoz-query-service-0:/var/lib/signoz/migration-0.9

To exec into the query-service container:

kubectl -n platform exec -it pod/my-release-signoz-query-service-0 -- sh

Now, change directory to the /var/lib/signoz and run the migration script:

cd /var/lib/signoz

./migration-0.9

You should see output similar to this:

2022/06/30 14:41:27 Total Dashboard found: 1
2022/06/30 14:41:27 a8763330-3828-4aa1-853d-b32a021117be
2022/06/30 14:41:27 Dashboard a8763330-3828-4aa1-853d-b32a021117be updated
2022/06/30 14:41:27 Dashboards migrated

At last, clean up the binary:

rm migration-0.9