---
locale: "en"
updated_at: "2026-07-08T09:51:15.658Z"
canonical: "https://www.isdecisions.com/en/fileaudit/docs/guides/database/archive-database"
---

# Archive database

Move data out of production into a separate archive you can still query.

## Before you begin

Archiving moves data from your production database to a separate archive database. You can move everything, or keep a defined number of recent days in production and move the rest. 

Archiving keeps your data: unlike [Clean records](/fileaudit/docs/guides/database/clean-records), which permanently deletes records, an archive stays available for auditing and reporting.

Before you start, make sure you have:

- The connection details for the destination archive database (server, instance, and credentials, depending on the provider).
- Network access to the destination database from the FileAudit service.

## Archive the production database

1. On the main screen, click the **Database & audit maintenance** tile. On the **Database manager** tab, click **Archive**.
2. Click the three dots (`...`) at the end of the **Connection string** field to open the **Database connection** window.
  ![Archiving the database](https://a.storyblok.com/f/122374/1074x748/2fe761ac4c/archiving-database.png)
3. Select your archived database connector (such as SQL Server, ODBC Wizard, OLEDB Wizard, or SQLite) and click **OK**. A window opens for you to enter the connection details for that connector.
  ![Database properties](https://a.storyblok.com/f/122374/680x512/d0bb4cb8df/database-properties.png)
4. Fill in the connection details and confirm.
5. Back in the Archiving the database dialog, set the **Number of days to keep in the production database**. Enter `0` to archive the entire production database.
6. Click **Next**.
7. Click **Archive**.

> **Note**
>
> ⚠️** Important**
> Archiving empties the archived events from your production database. Records older than the number of days you keep are moved out and no longer appear when auditing the production database. They remain available in the archive.

> **💡️ Tip**
>
> You can restore an archived database to audit it again. If you only need its data, set it directly as your production database. If you want to keep your current data as well, follow the migration procedure using your production database as the source and the archived one as the destination.

## Schedule recurring archiving

The **Scheduling** panel in Database manager runs archiving automatically on a recurring basis.

1. In the **Operation** field, select **Archive all events** to archive everything, or **Archive events older than** and set the number of days to keep in production.
2. Set **Schedule task** to the frequency you want.
3. Set the **Start time**.
4. Select the **Days of week** to run the task.

To schedule record cleaning instead of archiving, see [Clean records](/fileaudit/docs/guides/database/clean-records).

## Query an archived database

As soon as you archive a database, whether from Database manager or through the scheduler, it appears in the list of archived databases available in [report filters](/fileaudit/docs/reference/filters). 

You can run reports on your older databases without moving them back to production:

1. Open the report you want.
2. Click **Filters**.
3. Select the archived database from the **Database** list.
4. Click **Apply**, then refresh the report.

![Filters list databases](https://a.storyblok.com/f/122374/914x646/62a0511fc0/filters-list-databases.png)

To work with a database **created outside FileAudit**, add it manually from **Settings**** > ****Database** so it appears in the list:

1. Open **Settings**, then the **Database** tab.
2. In the **Archives** section, click **Add**.
3. Select the database connector and enter the connection details for the archive.
4. Click **Save**.

![Settings Database Archives](https://a.storyblok.com/f/122374/1278x549/71d879d679/settings-database-archives.png)

> **Note**
>
> ⚠️** Important**
> A database can be added as an archive only if it has a FileAudit schema (the FileAudit tables). A database without this schema is not recognized and is rejected.

> **Note**
>
> Scheduled reports always run against the production database. Selecting an archive in a report filter does not change which database scheduled reports use. See [Manage scheduled reports](/fileaudit/docs/guides/operations/manage-scheduled-reports) Guide.
