# Backup & Purge — Spectra Analyze Administration

> Spectra Analyze Backup & Purge automates database backups and scheduled sample removal to manage appliance storage and enforce data retention policies.

***Spectra Analyze > Administration > Configuration & Update > Backup & Purge***

The **Backup & Purge** features provide an automated way to manage storage space on the Spectra Analyze appliance. Backup lets users perform database backups, and restore the appliance database from previous backups. With purge, users can define which samples are considered old and have them automatically removed at scheduled times. Additionally, users can clean up the database and the samples at any time by manually running the purge task.

To access the backup and purge features, go to [**Administration > Configuration & Update > Configuration > Backup & Purge**](/SpectraAnalyze/Administration/configuration-update/configuration#backup--purge) and check **Enable Backup & Purge**. When enabled, backup and purge run automatically every day at midnight (00:00 UTC) by default, or at any other time and frequency specified by the user. 

However, users can run backup and purge manually at any time on the **Administration > Configuration & Update > Backup & Purge** page, and perform data removal according to predefined configuration criteria.

## Defining backup and purge criteria

Before running a purge manually, go to **Administration > Configuration & Update > Configuration > Backup & Purge** and select the correct classification statuses to purge. Optionally, check **Backup Database Before Purging** to ensure a backup is created before running the purge.

## Running manual backup

To run a backup manually, go to **Administration > Configuration & Update > Backup & Purge** and click **Run Backup**. This action runs a manual backup without a purge. The duration of the backup process and the size of the backup file vary depending on the appliance configuration and retention parameters. While backup is running, the appliance operates with degraded performance.

The database backup file is created in the PostgreSQL database format. The filename of the backup file contains the date and time when the backup was performed in the format `database-a1000-[date-time].dump`. By default, the database backup file is stored in the `/data/tcbase-backup` directory on the appliance. Backup files contain analysis information, including the verdict and analysis results. Configuration and original files are not backed up. Spectra Analyze does not store multiple database backup files as every new backup overwrites the previous one.

To download the database backup file, go to **Administration > Configuration & Update > Backup & Purge** and click **Download database backup**. You can store the file to a safe location or import it into a new Spectra Analyze instance. Only the latest database backup file can be downloaded using this option.

To import the database from an existing backup file, go to **Administration > Configuration & Update > Backup & Purge > Restore database backup**. Click **Choose file** to select a backup file to upload, and enter the **Password** you use to log into the Spectra Analyze appliance. Finally, click **Upload and restore**. Performing this action restarts the appliance and imports the uploaded database. The process takes several minutes, during which the maintenance page is displayed. Refresh it to return to the Spectra Analyze appliance interface.

## Running manual purge

To run a purge manually, go to **Administration > Configuration & Update > Backup & Purge** and click **Run Purge**. This action runs a manual purge. Whether or not this action also runs a backup is determined by the **Backup Database Before Purging** checkbox under **Administration > Configuration & Update > Configuration > Backup & Purge**.

It's not possible to execute a manual purge multiple times in quick succession, or while a scheduled purge is already in progress.

While a purge is running, the appliance enters maintenance mode and cannot be used until the purge completes.
