<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Migrate on Grafana Labs</title><link>https://grafana.com/docs/loki/v2.9.x/setup/migrate/</link><description>Recent content in Migrate on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/loki/v2.9.x/setup/migrate/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrate to TSDB</title><link>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-to-tsdb/</link><pubDate>Thu, 10 Apr 2025 12:15:54 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-to-tsdb/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-to-tsdb&#34;&gt;Migrate to TSDB&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;../../../operations/storage/tsdb/&#34;&gt;TSDB&lt;/a&gt; is the recommended index type for Loki and is where the current development lies.
If you are running Loki with &lt;a href=&#34;../../../operations/storage/boltdb-shipper/&#34;&gt;boltb-shipper&lt;/a&gt; or any of the 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/storage/#index-storage&#34;&gt;legacy index types&lt;/a&gt; that have been deprecated,
we strongly recommend migrating to TSDB.&lt;/p&gt;
&lt;h3 id=&#34;configure-tsdb-index-for-an-upcoming-period&#34;&gt;Configure TSDB index for an upcoming period&lt;/h3&gt;
&lt;p&gt;To begin the migration, add a new 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/#period_config&#34;&gt;period_config&lt;/a&gt; entry in your 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/#schema_config&#34;&gt;schema_config&lt;/a&gt;.
You can read more about schema config 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/storage/#schema-config&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You must roll out the new &lt;code&gt;period_config&lt;/code&gt; change to all Loki components in order for it to take effect.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This example adds a new &lt;code&gt;period_config&lt;/code&gt; which configures Loki to start using the TSDB index for the data ingested starting from &lt;code&gt;2023-10-20&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;schema_config:
  configs:
    - from: 2023-01-01
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h
    - from: 2023-10-20 ①
      store: tsdb ②
      object_store: filesystem ③
      schema: v13 ④
      index:
        prefix: index_
        period: 24h&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You must set the new period &lt;code&gt;from&lt;/code&gt; to a date in the future.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the new period to use TSDB as the index type by setting &lt;code&gt;store: tsdb&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This sample configuration uses filesystem as the storage in both the periods. If you want to use a different storage for the TSDB index and chunks, you can specify a different &lt;code&gt;object_store&lt;/code&gt; in the new period.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the schema to v13 which is the recommended version at the time of writing. Please refer to the 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/#period_config&#34;&gt;configure page&lt;/a&gt; for the current recommend version.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-tsdb-shipper&#34;&gt;Configure TSDB shipper&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s also important that you configure the &lt;code&gt;tsdb_shipper&lt;/code&gt; block in 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/#storage_config&#34;&gt;storage_config&lt;/a&gt;. Specifically the following options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;active_index_directory&lt;/code&gt;: directory where ingesters would write index files which will then be uploaded by shipper to configured storage.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cache_location&lt;/code&gt;: cache location for downloading index files from the storage for use in query path.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;storage_config:
  tsdb_shipper:
    active_index_directory: /data/tsdb-index
    cache_location: /data/tsdb-cache&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;run-compactor&#34;&gt;Run compactor&lt;/h3&gt;
&lt;p&gt;We strongly recommended running the &lt;a href=&#34;../../../operations/storage/retention/#compactor&#34;&gt;compactor&lt;/a&gt; when using TSDB index. It is responsible for running compaction and retention on TSDB index.
Not running index compaction will result in sub-optimal query performance.&lt;/p&gt;
&lt;p&gt;Please refer to the &lt;a href=&#34;../../../operations/storage/retention/#compactor&#34;&gt;compactor section&lt;/a&gt; for more information and configuration examples.&lt;/p&gt;
]]></content><description>&lt;h1 id="migrate-to-tsdb">Migrate to TSDB&lt;/h1>
&lt;p>&lt;a href="../../../operations/storage/tsdb/">TSDB&lt;/a> is the recommended index type for Loki and is where the current development lies.
If you are running Loki with &lt;a href="../../../operations/storage/boltdb-shipper/">boltb-shipper&lt;/a> or any of the
&lt;a href="/docs/loki/v2.9.x/configure/storage/#index-storage">legacy index types&lt;/a> that have been deprecated,
we strongly recommend migrating to TSDB.&lt;/p></description></item><item><title>Migrate from `loki-distributed` Helm chart</title><link>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-from-distributed/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-from-distributed/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-loki-distributed-helm-chart&#34;&gt;Migrate from &lt;code&gt;loki-distributed&lt;/code&gt; Helm chart&lt;/h1&gt;
&lt;p&gt;This guide will walk you through migrating to the &lt;code&gt;loki&lt;/code&gt; Helm Chart, v3.0 or higher, from the &lt;code&gt;loki-distributed&lt;/code&gt; Helm Chart (v0.63.2 at time of writing). The process consists of deploying the new &lt;code&gt;loki&lt;/code&gt; Helm Chart alongside the existing &lt;code&gt;loki-distributed&lt;/code&gt; installation. By joining the new cluster to the exsiting cluster&amp;rsquo;s ring, you will create one large cluster. This will allow you to manually bring down the &lt;code&gt;loki-distributed&lt;/code&gt; components in a safe way to avoid any data loss.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before you begin:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We recommend having a Grafana instance available to monitor both the existing and new clusters, to make sure there is no data loss during the migration process. The &lt;code&gt;loki&lt;/code&gt; chart ships with self-monitoring features, including dashboards. These are useful for monitoring the health of the new cluster as it spins up.&lt;/p&gt;
&lt;p&gt;Start by updating your existing Grafana Agent or Promtail config (whatever is scraping logs from your environment) to &lt;em&gt;exclude&lt;/em&gt; the new deployment. The new &lt;code&gt;loki&lt;/code&gt; chart ships with its own self-monitoring mechanisms, and we want to make sure it&amp;rsquo;s not scraped twice, which would produce duplicate logs. The best way to do this is via a relabel config that will drop logs from the new deployment, for example something like:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;- source_labels:
    - &amp;#34;__meta_kubernetes_pod_label_app_kubernetes_io_component&amp;#34;
  regex: &amp;#34;(canary|read|write)&amp;#34;
  action: &amp;#34;drop&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This leverages the fact that the new deployment adds a &lt;code&gt;app.kubernetes.io/component&lt;/code&gt; label of either &lt;code&gt;read&lt;/code&gt; for the Read pods, &lt;code&gt;write&lt;/code&gt; for the Write pods, and &lt;code&gt;canary&lt;/code&gt; for the Loki Canary pods. These annotations are not present in the &lt;code&gt;loki-distributed&lt;/code&gt; deployment, so this should only match logs from the new deployment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To Migrate from &lt;code&gt;loki-distributed&lt;/code&gt; to &lt;code&gt;loki&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Deploy new Loki Cluster&lt;/p&gt;
&lt;p&gt;Next you will deploy the new &lt;code&gt;loki&lt;/code&gt; chart in the same namespace as your existing &lt;code&gt;loki-distributed&lt;/code&gt; installation. Make sure to use the same buckets and storage configuration as your existing installation. You will need to set some special &lt;code&gt;migrate&lt;/code&gt; values as well:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;migrate:
  fromDistributed:
    enabled: true
    memberlistService: loki-loki-distributed-memberlist&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The value of &lt;code&gt;memberlistService&lt;/code&gt; must be the kubernetes service created for the purpose of Memberlist DNS in the &lt;code&gt;loki-distributed&lt;/code&gt; deployment. It should match the value of &lt;code&gt;memberlist.join_members&lt;/code&gt; in the config of the &lt;code&gt;loki-distributed&lt;/code&gt; deployment. This is what will make the new cluster join the existing clusters ring. It is important to join all existing rings, if you are using different memberlist DNS for different rings, you must manually set the value of each applicable &lt;code&gt;join_members&lt;/code&gt; configuration for each ring. If using the same memberlist DNS for all rings, as is the default in the &lt;code&gt;loki-distributed&lt;/code&gt; chart, setting &lt;code&gt;migrate.memberlistService&lt;/code&gt; should be enough.&lt;/p&gt;
&lt;p&gt;Once the new cluster is up, add the appropriate data source in Grafana for the new cluster. Check that the following queries return results:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Confirm new and old logs are in the new deployment. Using the new deployment&amp;rsquo;s Loki data source in Grafana, look for:
&lt;ul&gt;
&lt;li&gt;Logs with a job that is unqiue to your existing Promtail or Grafana Agent, the one we adjusted above to exclude logs from the new deployment which is not yet pushing logs to the new deployment. If you can query those via the new deployment in shows we have not lost historical logs.&lt;/li&gt;
&lt;li&gt;Logs with the label &lt;code&gt;job=&amp;quot;loki/loki-read&amp;quot;&lt;/code&gt;. The read component does not exist in &lt;code&gt;loki-distributed&lt;/code&gt;, so this show the new Loki cluster&amp;rsquo;s self monitoring is working correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Confirm new logs are in the old deployment. Using the old deployment&amp;rsquo;s Loki data source in Grafana, look for:
&lt;ul&gt;
&lt;li&gt;Logs with the label &lt;code&gt;job=&amp;quot;loki/loki-read&amp;quot;&lt;/code&gt;. Since you have excluded logs from the new deployment from going to the &lt;code&gt;loki-distributed&lt;/code&gt; deployment, if you can query them through the &lt;code&gt;loki-distributed&lt;/code&gt; Loki data source that show the ingesters have joined the same ring, and are queryable from the &lt;code&gt;loki-distributed&lt;/code&gt; queriers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Convert all Clients to Push Logs to New &lt;code&gt;loki&lt;/code&gt; Deployment&lt;/p&gt;
&lt;p&gt;Assuming everything is working as expected, you can now modify the &lt;code&gt;clients&lt;/code&gt; section of your Grafana Agent or Promtail configuration to push logs to the new deployment. After this change is made, the &lt;code&gt;loki-distributed&lt;/code&gt; cluster will no longer recieve new logs and can be carefully scaled down.&lt;/p&gt;
&lt;p&gt;Once this has deployed, query the new &lt;code&gt;loki&lt;/code&gt; cluster&amp;rsquo;s Loki data source for new logs to make sure they&amp;rsquo;re still being ingested.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tear Down the Old Loki Canary&lt;/p&gt;
&lt;p&gt;If you had previously deployed the canary via the &lt;code&gt;loki-canary&lt;/code&gt; Helm Chart, you can now tear it down. The new chart ships the canary by default and is automatically configured to scrape it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update Flush Config On &lt;code&gt;loki-distributed&lt;/code&gt; Deployment&lt;/p&gt;
&lt;p&gt;You are almost ready to start scaling down the old &lt;code&gt;loki-distributed&lt;/code&gt; cluster. Before you start, however, it is important to make sure the &lt;code&gt;loki-distributed&lt;/code&gt; ingesters are configured to flush on shutdown. Since these ingesters will not be coming back, there will be no opportunity for them to replay their WALs, so they need to flush all in-memory logs before shutting down to prevent data loss.&lt;/p&gt;
&lt;p&gt;The easiest way to do this is via the &lt;code&gt;extraArgs&lt;/code&gt; argument in the &lt;code&gt;ingester&lt;/code&gt; section of the &lt;code&gt;loki-distributed&lt;/code&gt; chart. You may also want to set the ingester&amp;rsquo;s log level to &lt;code&gt;debug&lt;/code&gt; to see messages about the flushing process.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;ingester:
  replicas: 3
  extraArgs:
    - &amp;#39;-ingester.flush-on-shutdown=true&amp;#39;
    - &amp;#39;-log.level=debug&amp;#39;
    ```

Deploy this change, and make sure all ingesters restart and are running the latest configuration.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scale Down Ingesters One at a Time&lt;/p&gt;
&lt;p&gt;It is now time to start scaling down &lt;code&gt;loki-distributed&lt;/code&gt;. Scale down the ingester StatefulSet or Deployment (depending on how your &lt;code&gt;loki-distributed&lt;/code&gt; chart is deployed) 1 replica at a time. If &lt;code&gt;debug&lt;/code&gt; logs were enabled, you can monitor the logs of each ingester as it&amp;rsquo;s terminating to make sure the flushing process was successful. Once the ingester pod is fully terminated, continue decrementing by another 1 replica. Continue until there are 0 instances of the ingester running.&lt;/p&gt;
&lt;p&gt;You can use the following command to edit the ingester StatefulSet in order to change the number of replicas (making sure to replace &lt;em&gt;&amp;lt;NAMESPACE&amp;gt;&lt;/em&gt; with the correct namespace):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;kubectl -n &amp;lt;NAMESPACE&amp;gt; edit statefulsets.apps loki-distributed-ingester&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove &lt;code&gt;loki-distributed&lt;/code&gt; cluster&lt;/p&gt;
&lt;p&gt;Double check that logs are still coming in to the new cluster. If something is wrong, it will be much easier to quickly scale back up &lt;code&gt;loki-distributed&lt;/code&gt; ingesters before tearing down the whole cluster so you can investigate. If everything looks good, you can tear down &lt;code&gt;loki-distributed&lt;/code&gt; using &lt;code&gt;helm uninstall&lt;/code&gt;. For example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;helm uninstall -n loki loki-distributed&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now edit the new &lt;code&gt;loki&lt;/code&gt; cluster to remove the &lt;code&gt;migrate&lt;/code&gt; options you added when first installing. Remove all of the following from your &lt;code&gt;values.yaml&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;migrate:
  fromDistributed:
    enabled: true
    memberlistService: loki-loki-distributed-memberlist&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To apply the new configuration (assuming you installed the new chart as &lt;code&gt;loki&lt;/code&gt; in the &lt;em&gt;loki&lt;/em&gt; namespace):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;helm upgrade -n loki loki grafana/loki --values values.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;migrate.fromDistributed.memberlistService&lt;/code&gt; was added as an &lt;em&gt;additional&lt;/em&gt; memberlist join member, so once this new config is pushed, the components should roll without interruption.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check the Dashboards&lt;/p&gt;
&lt;p&gt;Now that the migration is finished, you can check the dashboards included with the new &lt;code&gt;loki&lt;/code&gt; chart to make sure everything is working as expected. You can also check the loki canary metrics to make sure nothing was lost during the migration. Assuming everything was in the &lt;code&gt;loki&lt;/code&gt; namespace, the following query, if run over a time period that starts before the migration, and ends after it was complete, should clearly illustrate when metrics started coming from the new canary, and if and when there was data detected by either during the process:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;logql&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-logql&#34;&gt;(
  sum(increase(loki_canary_missing_entries_total{namespace=&amp;#34;loki&amp;#34;}[$__range])) by (job)
  /
  sum(increase(loki_canary_entries_total{namespace=&amp;#34;loki&amp;#34;}[$__range])) by (job)
)*100&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="migrate-from-loki-distributed-helm-chart">Migrate from &lt;code>loki-distributed&lt;/code> Helm chart&lt;/h1>
&lt;p>This guide will walk you through migrating to the &lt;code>loki&lt;/code> Helm Chart, v3.0 or higher, from the &lt;code>loki-distributed&lt;/code> Helm Chart (v0.63.2 at time of writing). The process consists of deploying the new &lt;code>loki&lt;/code> Helm Chart alongside the existing &lt;code>loki-distributed&lt;/code> installation. By joining the new cluster to the exsiting cluster&amp;rsquo;s ring, you will create one large cluster. This will allow you to manually bring down the &lt;code>loki-distributed&lt;/code> components in a safe way to avoid any data loss.&lt;/p></description></item><item><title>Migrate to three scalable targets</title><link>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-to-three-scalable-targets/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/migrate/migrate-to-three-scalable-targets/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-to-three-scalable-targets&#34;&gt;Migrate to three scalable targets&lt;/h1&gt;
&lt;p&gt;This guide will walk you through migrating from the old, two target, scalable configuration to the new, three target, scalable configuration. This new configuration introduces a &lt;code&gt;backend&lt;/code&gt; component, and reduces the &lt;code&gt;read&lt;/code&gt; component to running just a &lt;code&gt;Querier&lt;/code&gt; and &lt;code&gt;QueryFrontend&lt;/code&gt;, allowing it to be run as a kubernetes &lt;code&gt;Deployment&lt;/code&gt; rather than a &lt;code&gt;StatefulSet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before you begin:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We recommend having a Grafana instance available to monitor both the existing and new clusters, to make sure there is no data loss during the migration process. The &lt;code&gt;loki&lt;/code&gt; chart ships with self-monitoring features, including dashboards. These are useful for monitoring the health of the cluster during migration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To Migrate from a &amp;ldquo;read &amp;amp; write&amp;rdquo; to a &amp;ldquo;backend, read &amp;amp; write&amp;rdquo; deployment&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure your deployment is using a new enough version of loki&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This feature landed as an option in the helm chart while still in the &lt;code&gt;main&lt;/code&gt; branch of Loki. As a result, depending on when you run this migration, you may neeed to manually override the Loki or GEL image being used to one that has the third, &lt;code&gt;backend&lt;/code&gt; target available. For loki, add the following to your &lt;code&gt;values.yaml&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;loki:
  image:
    repository: &amp;#34;grafana/loki&amp;#34;
    tag: &amp;#34;main-f5fbfab-amd64&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For GEL, you&amp;rsquo;ll need to add:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;enterprise:
  image:
    repository: &amp;#34;grafana/enterprise-logs&amp;#34;
    tag: &amp;#34;main-96f32b9f&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Set the &lt;code&gt;legacyReadTarget&lt;/code&gt; flag to false&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the value &lt;code&gt;read.legacyReadTarget&lt;/code&gt; to false. In your &lt;code&gt;values.yaml&lt;/code&gt;, add:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;read:
  legacyReadTarget: false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Upgrade the helm installation&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Run &lt;code&gt;helm upgrade&lt;/code&gt; on your installation with your updated &lt;code&gt;values.yaml&lt;/code&gt; file.&lt;/p&gt;
]]></content><description>&lt;h1 id="migrate-to-three-scalable-targets">Migrate to three scalable targets&lt;/h1>
&lt;p>This guide will walk you through migrating from the old, two target, scalable configuration to the new, three target, scalable configuration. This new configuration introduces a &lt;code>backend&lt;/code> component, and reduces the &lt;code>read&lt;/code> component to running just a &lt;code>Querier&lt;/code> and &lt;code>QueryFrontend&lt;/code>, allowing it to be run as a kubernetes &lt;code>Deployment&lt;/code> rather than a &lt;code>StatefulSet&lt;/code>.&lt;/p></description></item></channel></rss>