canonical / loki-k8s-operator

https://charmhub.io/loki-k8s
Apache License 2.0
10 stars 16 forks source link

Write a Loki data migration HOW-TO #430

Closed Abuelodelanada closed 5 months ago

Abuelodelanada commented 5 months ago

Enhancement Proposal

Would be very useful to have a HOW-TO that explains how to migrate the data stored in a working Loki instance (Loki-old) into a fresh new Loki deployment (Loki-new).

With @sed-i @selcem-artan came up with a tentative workflow:

  1. Stop loki-old: $ juju ssh --container loki loki-old/0 /charm/bin/pebble stop loki
  2. Stop loki-new: $ juju ssh --container loki loki-new/0 /charm/bin/pebble stop loki
  3. In loki-new remove files and directories in /loki/
  4. Copy from loki-old to loki-new the contents of /loki/
  5. Fix the content's owners in /loki/: chown -R root:root /loki/*
  6. Start loki-new: $ juju ssh --container loki loki-new/0 /charm/bin/pebble start loki

Another approach is to use Loki API:

Abuelodelanada commented 5 months ago

Fixed with this post: https://discourse.charmhub.io/t/how-to-migrate-the-logs-stored-in-loki-to-another-instance/14561