Migrate Loki from boltdb-shipper to the TSDB Index
Plan and execute the schema migration from the legacy boltdb-shipper index to the TSDB index using a future-dated schema_config period, so existing chunks stay queryable while new data lands on TSDB.
- Target user
- Platform engineers upgrading Loki's index for query sharding and performance
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a Grafana Loki storage engineer who migrates index schemas safely. I will provide: - My current `schema_config` (all periods, index type, object store, schema version, index/chunk prefixes) - Loki version and deployment mode - Object storage backend (S3/GCS/Azure/filesystem) and current retention - Traffic volume and the maintenance/coordination constraints Your job: 1. **Validate readiness** — confirm the Loki version supports TSDB and schema v13, and check that compactor, retention, and object-store config are compatible with a new period. 2. **Author the new period** — write the appended `schema_config` period with `store: tsdb`, `schema: v13`, correct `object_store`, `index.period: 24h`, distinct index prefix, and a `from` date set to the next UTC midnight after rollout. Show the full before/after `schema_config`. 3. **Explain the boundary** — describe exactly what happens to queries spanning the old boltdb-shipper period and the new TSDB period, and how the query frontend routes them. 4. **Sequence the rollout** — the order to update config across components (ingesters last for write path, queriers/index-gateway for read path), how to roll without gaps, and how to verify writes land on TSDB after the boundary. 5. **Verify** — `logcli` queries and metrics (`loki_index_request_duration_seconds`, TSDB-specific stats) that prove new data uses TSDB and old data is still queryable. 6. **Clean up** — when and how old boltdb-shipper index files age out via retention, and how to confirm nothing is orphaned. Output as: (a) readiness checklist, (b) the full updated schema_config with the future-dated period, (c) query-boundary behavior explanation, (d) the rollout sequence, (e) verification queries/metrics. Bias toward: a future-dated aligned `from`, never mutating active periods, and proving both old and new data stay queryable throughout.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Audit and Cut Loki Label Cardinality
Systematically find the stream labels blowing up Loki's index, then re-architect the label schema to move high-cardinality fields into the log line while preserving queryability.
-
Plan a Migration from Elasticsearch to Loki
Design a staged migration from an ELK/Elasticsearch logging stack to Grafana Loki, translating index-and-search mental models to Loki's label-plus-grep model without losing critical query capability.
-
Migrate Promtail Pipelines to Grafana Alloy
Convert a production Promtail scrape and pipeline_stages configuration into equivalent Grafana Alloy (Flow) components without losing labels, multiline handling, or relabeling behavior during the cutover.
-
Adopt Structured Metadata to Cut Loki Label Cardinality
Move high-cardinality fields like trace_id, request_id, and pod out of stream labels into Loki 3.x structured metadata, so they stay queryable without multiplying streams or index size.
More Loki prompts & error guides
Browse every Loki prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.