Loki migration

Moving logs to Loki is a change in how logs are shipped, indexed, stored and queried, not only a new tool. This page explains what a Loki migration includes, what drives its cost and duration, and what you must provide.

On this page

When a Loki migration makes sense and who usually runs it

Most Loki migrations are run by the client's own platform or operations team, with a partner brought in when the move is large, time-bound or touches compliance evidence. The work usually comes from one of three starting points: an Elasticsearch-based stack that the team wants to replace with label-indexed storage on object storage, a hosted logging tool whose volume-based bill or data residency terms no longer fit, or an existing Loki install that has to change before a deadline. In-house teams tend to handle the first two when they already run Kubernetes or Linux hosts and have someone who owns log pipelines. A partner is more often worth considering when several log sources, retention rules and audit requirements must move together under a fixed schedule.

The clearest trigger for an existing install is the shipper. Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs users to Grafana Alloy. Every host or cluster still running Promtail therefore needs a configuration translation and a rollout plan, and the team should confirm which pipeline stages and label rules must be reproduced before cutover. The second trigger is index storage: older index stores such as DynamoDB, Bigtable and Cassandra are deprecated in favor of TSDB, which the storage documentation recommends for Loki 2.8 and newer. The third is topology. Simple scalable mode is being deprecated and will be removed with the Loki 4.0 release, so clusters on that mode should confirm their target deployment mode before choosing a version.

Before scheduling any of this, the owner should inventory three things: which shippers and sources feed Loki, which index and storage versions are live, and which teams query logs through Grafana and depend on current label names. Those answers decide whether the migration is a configuration exercise or a data-movement project, and they drive the effort estimate. Ask any partner to show how they will keep historical data queryable, how retention rules carry over, and how the cutover will be verified, since those are the points where logging migrations most often lose history or audit coverage.

What a Loki migration includes and what you receive at the end

A Loki migration moves log collection, storage and access together, so each work package depends on the one before it. The source inventory sets the volume and labels, the shipper and index work carry the data into Loki, and retention and Grafana access decide what teams can query and for how long. The deliverables below are what you keep when the work ends.

Source inventory and volume analysis

We list every log source in the current stack, including hosts, containers, applications, network devices and hosted logging exports, and record the daily volume and peak rate for each. The output is a log source inventory with owners, formats and volume estimates. Check who owns each source, which sources carry sensitive fields, and whether any source must keep its current retention for a reason outside engineering. This inventory decides the deployment mode and the object storage size.

Field to label mapping

Loki indexes labels, not the full text of each line, so the choice of labels controls query speed and index size. We map source fields to a small set of stable labels such as namespace, app and environment, and leave high-cardinality values such as user IDs or request IDs in the log body. The deliverable is a label dictionary with rules for each source. Ask who approves new labels, because an unreviewed label added later can grow the index quickly.

Loki send data docs

Shipper move to Grafana Alloy

Promtail reached end of life on March 2, 2026, so existing Promtail, Fluent Bit or Fluentd agents are moved to Grafana Alloy, or the team confirms another supported shipper for each source. We write the Alloy pipelines, keep the same labels as the mapping, and run old and new shippers side by side until counts match. The deliverables are shipper configs per host type and a parity check report. Confirm which agents must stay in place for hosted sources that cannot be re-pointed.

Promtail migration notes

Object storage and TSDB index setup

We configure Loki to keep compressed chunks and the index in object storage, using TSDB as the index store and removing old index stores such as DynamoDB, Bigtable or Cassandra from the schema. Where the stack moves from simple scalable mode, the deployment is also reworked before that mode is removed. The deliverables are the storage configuration, bucket policies and a schema change record. Confirm the bucket provider, encryption settings and the owner of access keys before the first write.

Loki storage docs

Retention and tenant mapping

Retention in Loki is off by default, so logs stay indefinitely until retention is enabled in the compactor. We set global, per tenant or per stream retention rules, map teams and systems to X-Scope-OrgID values, and confirm which streams need separate periods for compliance or privacy reasons. The deliverable is a retention policy document with each rule, its owner and its review date. Ask legal and security teams to sign off on retention periods before deletion runs.

Loki retention docs

Grafana queries, dashboards and alerts

Dashboards, saved queries and alert rules built on the old platform are rebuilt against Loki's LogQL, with each panel checked against the same time range in both systems. We set up the Grafana data source for each tenant and document which users can see which logs. The deliverables are a dashboard inventory, alert rule export and a cutover runbook with rollback steps. Confirm which alert channels and on-call tools must receive alerts during the parallel run.

What drives the cost and duration of a Loki migration

This table lists the factors that most change how long a Loki migration takes and what it costs internally or with a partner. Read each row as a question to answer during scoping, with the right-hand column showing where effort can be reduced. The main takeaway is that source platform, log volume and the number of teams and dashboards set most of the effort, so inventory them before asking for a quote.

DriverWhy it changes effortHow to keep it down
Source platformElasticsearch-based stacks, hosted logging tools and Promtail each need different shipper, query and dashboard work. Promtail is end of life, so its agents must move to Grafana Alloy regardless.Confirm the source platform early. Map each existing shipper to a supported Loki path, such as Alloy, Fluent Bit or OpenTelemetry.
Number of log sourcesEvery host, container, application and network device needs a configured pipeline, parsing rule and label scheme. Effort grows with each distinct log format.Group sources by format and ship the common ones first. Retire unused sources before migrating them.
Daily log volumeVolume sets the deployment mode. Monolithic mode is documented for up to about 20 GB per day, simple scalable mode approaches 1 TB per day, and microservices fit very large clusters. Moving between modes adds sizing and testing work.Measure actual ingest for a representative period and size for it. Ask whether the chosen mode fits current volume with room for growth.
Deployment mode and storageSimple scalable mode is being deprecated and removed with Loki 4.0, so a deployment built on it may need a later move. Object storage choice and index store affect configuration and testing.Plan for the target mode from the start. Use TSDB as the index store on current Loki versions and confirm the object store with the platform team.
Number of teams and tenantsEach tenant needs its own X-Scope-OrgID mapping, access rules and query checks. Multi-tenancy needs authentication in front of Loki, which adds identity work.Define the tenant model before migration. Limit tenants to real access boundaries and reuse one identity source for mapping.
Dashboards and alertsEach Kibana, hosted tool or existing Grafana dashboard must be rewritten in LogQL and checked against the old results. Alert rules need the same treatment.Inventory dashboards and alerts, retire unused ones, and convert the most used first. Compare results side by side during cutover.
Compliance retention requirementsRetention is disabled by default, so logs are kept indefinitely until configured. Per-tenant or per-stream retention rules, minimum 24-hour stream rules and evidence of deletion all add design and testing work.Document retention periods per data class before configuring the compactor. Confirm requirements with compliance and legal owners in writing.
Historical dataDeciding whether to import old logs, keep the legacy system read-only or run both in parallel changes the scope and the number of validation cycles.Set a clear cutoff. Keep legacy data in its current system for the agreed period rather than backfilling everything.

Why Loki's label model changes what gets migrated

Loki does not build a full-text index of log content. It indexes a set of labels per stream and stores the log lines themselves as compressed chunks in object storage, so a migration is less about copying data from an Elasticsearch-style index and more about deciding which fields become labels. Every label combination creates a stream, and the index grows with the number of distinct streams. Fields with unbounded values, such as request IDs, user IDs, or client IP addresses, should stay in the log line and be filtered at query time with LogQL. Before cutover, your team should list the fields each source emits, mark which ones are bounded (environment, service, cluster, level), and test the label set against a representative sample of production volume. Confirm the stream count your chosen labels will produce with the Loki documentation on label practice and your own traffic profile.

Queries written for another tool do not transfer directly. Lucene or KQL searches, Splunk search commands and hosted vendor query languages all map to LogQL in different ways, and a full-text term search becomes a label selector followed by a line filter, which costs more when the selector is broad. Field extraction that happened at index time in the old stack must be expressed as parser stages at query time or in the shipper pipeline, so each parsed field should be checked for correctness on real records. Dashboards and alerts built on the old query language, field names, and aggregations need to be rewritten and compared against known-good results, because a query that returns no data in Loki is easy to mistake for a quiet service.

The index store is also a migration decision. TSDB is the recommended index store for Loki 2.8 and newer, and older index stores such as DynamoDB, Bigtable and Cassandra are deprecated according to the Loki storage documentation. A new deployment should start on TSDB. If an existing Loki cluster still uses a deprecated store, the move to TSDB is a schema and index change that needs its own plan, rollback path and query verification, and it should be scheduled alongside the version upgrade rather than discovered during it. Ask your platform team which index store and schema each existing cluster uses before you set the migration timeline.

How logs flow during a parallel run and at cutover

Log sources send the same events to both the legacy stack and Grafana Alloy during the parallel run. Alloy writes to Loki, which keeps compressed chunks and its index in object storage, and an authenticating reverse proxy sits in front of Loki for every query. Grafana queries both systems during validation, and the cutover point is the moment dashboards, alerts and Alloy outputs switch to Loki only. Check that both paths return matching results for the same streams before removing the legacy shipper.

Dual-shipping during validation, with the cutover point marked where queries and alerts move to Loki.

Phases of a Loki migration from inventory to cutover

The sequence moves a team from an undocumented logging estate to a Loki environment that has been checked against the old stack, cut over, and then retired the old stack in controlled stages. Durations depend on the inventory and are set out in the written scope.

  1. Inventory sources, volumes and consumers

    List every log source, shipper, index or hosted tool, dashboard, alert and saved query that depends on the current stack. Record approximate daily volume per source, which teams query which logs, and which logs are sensitive or subject to retention obligations. The output is a written inventory that names an owner for each source and each consumer. The step is done when the platform owner and the main consumers have reviewed the list and nothing is left as unknown.

  2. Design labels, tenants, retention and deployment mode

    Decide which labels are indexed, keeping the set small and stable, and which fields stay in log content for filtering. Map teams or business units to tenants using X-Scope-OrgID, set retention globally, per tenant or per stream selector, and choose a deployment mode from the documented options against the measured volume. The output is a design record that lists labels, tenant map, retention rules and deployment mode, with the reasons for each choice. Retention stays disabled by default in Loki, so this record must state the retention setting explicitly before build starts.

  3. Build the Loki environment on object storage with TSDB

    Provision the chosen deployment mode in the client's own infrastructure, with a production object store (Amazon S3, Google Cloud Storage or Azure Blob Storage, or an S3-compatible store reviewed for production use), and configure the TSDB index store. Avoid older index stores such as DynamoDB, Bigtable and Cassandra, which are deprecated. Put an authenticating reverse proxy in front of the endpoints, since Loki has no built-in authentication. The output is a running environment with test data, tested write and read paths, and a configuration in version control.

  4. Migrate shippers to Grafana Alloy

    Replace collection agents with Grafana Alloy, which Grafana supports as the log shipper for Loki. Promtail has reached end of life, so any Promtail configuration is rewritten rather than carried over. Fluent Bit, Fluentd, the Docker logging driver and OpenTelemetry logs over HTTP are alternatives where they already fit the estate. Each source is moved in a planned batch, with labels checked against the design record. The output is a list of sources shipping to Loki through Alloy, with pipeline configuration reviewed and stored with the other code.

  5. Run in parallel and validate queries

    Send the same logs to the old stack and Loki for a agreed period. Compare event counts per source, label coverage, parsing results and the outcome of each saved query, dashboard and alert that matters to the consumers. Record differences and fix them in the pipeline or in the query. The output is a signed validation log for each consumer group. The step is done when the owners of the queries and alerts confirm that results match or that each difference is accepted in writing.

  6. Cut over consumers and sources

    Move Grafana data sources, alert routes and access for people and teams to the Loki tenants, then switch shippers so that the old stack stops receiving new logs. Confirm access through the reverse proxy and SSO for each group before the switch. Keep a rollback path documented for each source until the parallel run data has been accepted. The output is a cutover record with the time of each change, the owner who approved it and the results of post-switch checks.

  7. Decommission the old stack and retain evidence

    After the agreed hold period, shut down old indexes, collectors and dashboards that no longer receive data, and archive or delete their logs according to the retention obligations recorded in the inventory. Remove access that is no longer needed. The output is a decommissioning record that lists what was removed, where archived data is held, who approved deletion and how the old retention obligations were met. Keep this record with the compliance evidence for the new stack.

Which parts teams keep in-house and which they outsource

Your team should keep ownership of the things that define what your logs mean and who uses them. That means the log sources, the labels you choose, the queries and dashboards your engineers rely on, and the retention decisions that come from your legal and compliance obligations. These decisions shape cost and risk long after a migration ends, so they should not depend on an outside party.

  • Log sources and labels: Decide which applications, hosts and network devices ship logs, and which labels identify them. Label choices drive query speed and cardinality.
  • Queries and dashboards: Keep LogQL queries, Grafana dashboards and alert rules in version control under your own review process.
  • Retention and deletion rules: Set per-tenant and per-stream retention with your compliance and legal teams, since retention is disabled by default in Loki.
  • Access and tenant mapping: Decide which teams map to which tenants and who approves changes to that mapping.
  • Operations and on-call: Run daily health checks, capacity reviews and incident response for the stack.

Before handover, confirm that named staff can read the shipper configuration, explain the label scheme and justify each retention rule.

What goes wrong in Loki migrations and how to prevent it

Most Loki migration problems come from defaults that favor fast startup over long-term control: logs kept forever, labels chosen without limits, an unauthenticated endpoint, and a parallel run that ends before anyone trusts the results. Each risk below names the check that prevents it, so the team can settle these decisions before cutover.

Retention left disabled

Loki keeps logs indefinitely until retention is switched on, so a migration that copies the old retention policy without setting one in Loki can grow object storage without limit. Before go-live, set retention explicitly on the compactor, decide whether it applies globally, per tenant or per stream selector, and confirm each rule is at least 24 hours. Then verify the first deletion cycle removes what the policy says it should.

Loki retention docs

High-cardinality labels

Loki indexes labels, not log content, so labels built from request IDs, user IDs or pod names create huge numbers of streams and slow every query. Migrations from Elasticsearch often carry over fields as labels by habit. Keep labels to a small, bounded set such as cluster, namespace, app and level, and move everything else into the log line for filtering at query time. Review stream counts in the first week of ingestion.

No authentication in front of Loki

Loki has no built-in authentication layer, so an exposed push or query endpoint accepts requests from anyone who can reach it. Place an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of every endpoint, and make sure ingestion agents and Grafana both pass through it. Test from outside the network that unauthenticated requests are refused, and confirm the tenant header cannot be set by end users.

Loki authentication docs

Simple scalable mode before Loki 4.0

The Loki documentation states that simple scalable deployment mode is being deprecated and will be removed in Loki 4.0. A cluster built on it during migration will need a later move to monolithic or microservices mode. Choose the deployment mode against daily volume and growth, record the planned path for the next major version, and include that move in the upgrade plan rather than leaving it to a later team.

Promtail end of life

Promtail reached end of life on March 2, 2026, with no further updates or commercial support. Teams moving from Elasticsearch-based shippers often inherit Promtail configs from older Loki guides. Inventory every host and cluster still running Promtail, convert pipelines to Grafana Alloy, and confirm labels and parsing match the old output before removing Promtail. Keep the old agent running only until the Alloy output has been checked.

Promtail docs

Parallel run too short

A parallel run ends too early when it covers only a few days of traffic or skips the queries people use during incidents. Compare the same questions in the old and new systems, including rare searches, alert queries and dashboards with long time ranges. Agree the exit criteria in writing with the teams that depend on logs, and keep the old system read-only until they sign off. The length should follow the incident and audit cycles of the business, which the team must confirm.

Recurring costs after a Loki migration goes live

This table lists the costs that continue after cutover, who typically pays for each, and what makes them grow or shrink. Read it alongside the one-time migration costs, because several items (Alloy rollout tuning, dashboard rebuilds) look recurring but front-load into the first months. Loki itself is licensed under AGPLv3, so software licensing is not a recurring line item, while Grafana Enterprise Logs is a commercial alternative you would price separately.

CostWhat drives itWho pays
Object storage for chunks and indexRetained daily volume multiplied by retention periods, plus compaction and request activity. Retention is off by default, so logs accumulate until retention_enabled is set. Ask your provider for current storage and request pricing.Your organization, through your cloud account, data center budget or storage contract
Compute for each Loki componentDeployment mode (monolithic, simple scalable or microservices), ingest rate, query load and the number of replicas for high availability. Confirm sizing against your chosen mode before budgeting.Your organization, through cloud instances, Kubernetes nodes or on-premises hardware
Loki upgrades and Helm or config changesMinor and major version moves, index and schema changes, Helm chart updates and retesting queries and retention after each upgrade. Simple scalable mode is being removed in Loki 4.0, so a planned mode change may recur as a larger project.Internal platform team, or a support retainer if you buy one
Alloy and log shipper maintenanceAlloy version updates, pipeline and label changes as new applications onboard, and retirement of any leftover Promtail agents, which reached end of life on March 2, 2026. Cost rises with the number of hosts and teams sending logs.Platform team for pipelines, application teams for their own log labels and formats
Reverse proxy and identity operationOperating the authenticating proxy in front of Loki, certificate rotation, SSO group mapping to X-Scope-OrgID tenants and access reviews. Loki has no built-in authentication, so this layer is always yours to run.Identity or security team, with platform team support
Monitoring, backup and alert tuningMonitoring Loki's own health, verifying object storage backups and tuning alerts as log volume changes. Ingestion spikes and noisy sources drive most of the effort.Internal platform or SRE team
Internal platform timeHours spent on on-call, capacity reviews, cost reporting and answering tenant questions. This is usually the largest recurring item and is often underestimated when the migration is budgeted as a project.Your internal teams, measured as staff time rather than invoices
Grafana Enterprise Logs (optional)A commercial product based on Loki that adds token authorization, label-based access control and cross-tenant queries, in long-term support until February 1, 2029. Request a written quote if you consider it, since it replaces parts of the proxy and access layer.Your organization, through a Grafana Labs subscription, if you choose it

What you need to provide before the migration starts

Start by giving the implementation team read access to the current logging platform and every log source that will move. That means the Elasticsearch cluster or hosted tool, its index and retention settings, the list of hosts, containers and applications shipping logs, and the agents already in place. Without this inventory, nobody can tell which sources need a Grafana Alloy configuration, which ones send through Fluent Bit, Fluentd or the Docker logging driver, and which can be dropped. Also provide a log volume estimate per source, in gigabytes per day, measured from the current platform's ingest figures rather than from memory. That number decides the deployment mode. Loki's documentation places monolithic mode at up to about 20 GB per day and simple scalable mode near 1 TB per day, so a rough estimate is enough to choose a starting point, but the team must confirm the figure with a measured sample before sizing object storage and compute.

Next, provide retention and compliance requirements in writing. Loki keeps logs indefinitely until the compactor's retention is explicitly enabled, so the migration cannot set a retention period until someone with authority states how long each log class must be kept, which logs are sensitive, and which must be deleted on a schedule. Ask your compliance or legal owner to confirm these periods and any deletion obligations, and whether historical data must be carried over or can stay in the old platform for a read-only window. Also supply the cloud or data center accounts that will hold the data: the object storage bucket or equivalent, the region or site, the encryption and key management policy, and the network path between shippers and Loki. The production stores named in Loki's storage documentation are Amazon S3, Google Cloud Storage and Azure Blob Storage, so confirm early whether your platform falls in that list or needs an alternative your team has validated.

Two decisions remain before the team can build. First, the identity provider details for the authenticating reverse proxy: the issuer, client registration, group claims and the mapping from users and teams to tenants, because Loki has no built-in login and identifies tenants only through the X-Scope-OrgID header. Second, name one accountable owner for each tenant who approves which sources and retention apply to it. Finally, agree a deployment mode and a cutover window with the business owners who depend on the logs. Confirm the target deployment mode against the current Loki documentation, since the Loki deployment modes page notes that simple scalable mode is being deprecated, which affects any choice you make now.

Questions buyers ask before a Loki migration

What drives the cost of a Loki migration?

The cost follows the scope you agree in writing: how many log sources move, how much log volume you ingest per day, which deployment mode you run, the object storage you choose, how much retention history must be carried over, and how many Grafana dashboards, alerts and saved queries need rebuilding. The one-time costs are design, pipeline rework, dashboard translation, parallel running and cutover. The recurring costs are object storage, compute, and the internal platform time to operate the stack. Ask any quote to split these two groups and to state which sources and dashboards are included.

How long does a Loki migration take?

The duration depends on scope, not on a fixed template. A team moving one application's logs to a single monolithic Loki instance has a much smaller job than a team moving dozens of services, several Elasticsearch indices, and alerting rules into a simple scalable deployment. Parallel running, where both stacks ingest logs while teams verify queries, usually adds time that is worth planning for. Ask for a phased timeline tied to named deliverables, and confirm which phases depend on your change approval windows.

Can our team run a Loki migration without outside help?

Yes, many platform teams do, provided they have engineers who understand object storage, Kubernetes or Linux service management, and LogQL. The harder parts are usually not the install but the cutover: shipper changes on every host, query and alert translation, and proving that retention and access controls match what the old stack enforced. Assess your team's capacity honestly against those tasks. A fixed-scope engagement can cover some of them while your staff keep ownership of the platform afterward.

What do we need to provide during a Loki migration?

You provide access to the environments where logs are produced and stored, a named owner for log sources and tenants, a list of dashboards, alerts and saved searches in use, and decisions on retention periods and who may read which logs. You also provide object storage accounts, identity provider details for Grafana access, and change windows for cutover. Gaps in any of these usually surface as delays, so collect them before the work starts.

How do Elasticsearch queries translate to LogQL?

Elasticsearch indexes the full content of documents, while Loki indexes only labels and stores log lines compressed in chunks. A typical Elasticsearch query that filters by field and text becomes a LogQL stream selector followed by line filters and parsers, such as {app="checkout"} |= "timeout" with a parser stage for structured fields. Queries that depend on arbitrary field search across unindexed content will be slower or need redesign. Plan for label design early, because high-cardinality labels cause the most trouble. Translation should be tested against real questions your responders ask.

Do we have to replace Promtail, and when?

Yes, if you use Promtail. Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs users to Grafana Alloy. Shipper migration is usually one of the first steps because it affects every host that sends logs. Confirm which hosts run Promtail, whether any run Fluent Bit, Fluentd or the Docker logging driver, and how label sets will map between them so that existing dashboards keep working.

What happens to our existing log history and retention?

Historical logs in Elasticsearch do not move into Loki automatically, so you decide whether to keep the old stack read-only for its retention window, export selected history, or accept a gap. Loki retention is disabled by default, so logs are kept indefinitely until retention_enabled is set. Retention can apply globally, per tenant, or per stream selector, with each stream rule at least 24 hours. Set these values deliberately, since compliance obligations for the old data may still apply during the overlap.

How DeployOpen scopes, delivers and hands over a Loki migration

DeployOpen plans and implements Loki migrations inside your own infrastructure, from the log sources you already run through to the Loki deployment your teams query. Each engagement starts from a written scope, so the cutover plan, the tooling changes and the evidence your teams need are agreed before work begins.

How we scope

  • Inventory current log sources, shippers and the Elasticsearch or hosted tool being replaced, with daily volume estimates.
  • Confirm the target deployment mode, object store and retention periods for each tenant or log stream.
  • Agree in writing which Promtail configs move to Grafana Alloy and which index stores need TSDB conversion.

How we build

  • Stand up Loki in your cloud account or data center with object storage, the TSDB index and compactor-based retention.
  • Move collection to Grafana Alloy or other supported shippers, running old and new pipelines in parallel for comparison.
  • Test queries, dashboards and retention behavior against agreed acceptance checks before any source is cut over.

How we hand over

  • Deliver configuration, deployment code and runbooks covering shipper changes, tenant setup and retention settings.
  • Document the cutover sequence, rollback steps and the decommissioning plan for the old logging stack.
  • Walk your platform and security teams through the running system and the evidence produced during migration.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, version upgrades and continuous testing are available as a retainer after handover.
  • Ask for a quote that separates one-time migration work from recurring support so budgets can be compared.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.