> For the complete documentation index, see [llms.txt](https://docs.onelitefeather.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelitefeather.net/ingot/operate-and-upgrade/back-up-before-upgrading.md).

# Back up before upgrading

Create a backup of a Reposilite or Ingot installation before an upgrade, for SQLite or MariaDB, with S3 storage included.

## Prerequisites

* Shell access to the host that runs the server.
* The image reference of the release you run now. You need it for a rollback.

{% hint style="warning" %}
The upgrade rewrites the database. A rollback is only as good as the copy you kept, so do not start the upgrade before the archive is complete.
{% endhint %}

## Steps

1. Stop the server. With the Compose file of Ingot, the service is `ingot`:

   ```bash
   docker compose stop ingot
   ```

   For a container you started with `docker run`, use `docker stop <container>` with the name of your container.
2. Back up the database and the data directory, for your database:
3. If the repositories are in S3, back up the bucket as well. The data directory does not hold the artifacts of an S3 repository. Use the copy tool of your object storage, and keep the copy from the same time as the database dump.

The [back up and restore](/ingot/operate-and-upgrade/back-up-and-restore.md) page describes how to restore these copies.

## Result

The archive exists and is not empty. For SQLite, `tar -tzf ingot-backup-<date>.tar.gz` lists `reposilite.db` and `configuration.cdn`. For MariaDB, the `.sql` file exists and is not empty. For S3, the copy of the bucket is complete. Keep the copies next to the old image reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onelitefeather.net/ingot/operate-and-upgrade/back-up-before-upgrading.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
