> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seekr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revert a SeekrFlow upgrade

> Roll SeekrFlow back to an earlier release revision and restore its databases.

Reverting an upgrade rolls SeekrFlow back to an earlier revision of its release. A rollback restores that revision's chart and values, but changes the upgrade made to the databases stay. To undo those, restore the backup you took before you upgraded. See [Upgrade a SeekrFlow deployment](/self-managed/flow/operate/upgrade).

Roll back the release first, then restore the databases. If you restore first, the newer release is still running, and it upgrades the restored databases again.

<Warning>
  Restoring the databases replaces them with the backup. Anything users created after the backup, such as accounts, agents, or files they uploaded, doesn't survive the restore.
</Warning>

<Tabs>
  <Tab title="With the sfe CLI">
    <Steps>
      <Step title="Find the revision">
        ```bash theme={null}
        sfe releases -p <profile-name>
        ```

        The command lists each revision with its release version. Note the last revision that ran the version you're returning to.
      </Step>

      <Step title="Roll back the release">
        ```bash theme={null}
        sfe rollback -p <profile-name> --to-revision <revision>
        ```

        `sfe` asks you to confirm.
      </Step>

      <Step title="Restore the databases">
        Check the backup and the plan first:

        ```bash theme={null}
        sfe db restore ./backup-<previous-version> -p <profile-name> -r <previous-version> --in-cluster --dry-run
        ```

        Then restore:

        ```bash theme={null}
        sfe db restore ./backup-<previous-version> -p <profile-name> -r <previous-version> --in-cluster
        ```

        `sfe` asks you to type the namespace to confirm. To skip the prompt, such as in a script, add `--yes`. It stops every SeekrFlow service, replaces each database from the backup, and starts the services again. If the restore stops partway, the services stay stopped. That keeps anything from writing to a partly restored database. Run the same command again, or start the services on the databases as they are with `sfe db restore --unquiesce -n seekrflow`.
      </Step>

      <Step title="Delete the migration jobs">
        ```bash theme={null}
        kubectl delete jobs -l component=data-migration -n seekrflow
        ```

        A finished migration job left from the upgrade makes the next upgrade skip its migration.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Without the sfe CLI">
    <Steps>
      <Step title="Find the revision">
        ```bash theme={null}
        helm history seekrflow --namespace seekrflow
        ```

        The command lists each revision with its chart version. Note the last revision that ran the version you're returning to.
      </Step>

      <Step title="Roll back the release">
        ```bash theme={null}
        helm rollback seekrflow <revision> --namespace seekrflow
        ```
      </Step>

      <Step title="Restore the databases">
        Stop SeekrFlow's services, then restore each SeekrFlow database from the backup or snapshot you took before you upgraded, with your database's restore tools. Start the services again after you restore every database.
      </Step>

      <Step title="Delete the migration jobs">
        ```bash theme={null}
        kubectl delete jobs -l component=data-migration -n seekrflow
        ```

        A finished migration job left from the upgrade makes the next upgrade skip its migration.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Check the deployment

Run the checks in [Verify the deployment](/self-managed/flow/deploy/verify).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.