---
title: "MySQL snapshots and rollbacks"
date: "2016-08-28"
category: "mysql"
slug: "mysql-snapshots-and-rollbacks"
---

ApisCP supports MySQL database snapshots for preserving your data before software updates or other risky operations. Snapshots perform a full database export, stored uncompressed in your backup directory, and are automatically removed after 5 days.

![Database restore interface. Camera icon indicates a snapshot.](kb-image:db-restore-final.png)
*Database restore interface. Camera icon indicates a snapshot.*

## Creating a Snapshot

1. Open the [[logging-into-the-control-panel]] and navigate to **Databases** > **MySQL Manager** > _List Users and Databases_
2. Select the database to snapshot
3. Select **Snapshot** from the actions dropdown
4. Wait for the snapshot to complete (may take a few minutes depending on size). A confirmation dialog will appear when finished.

Snapshots are available for 5 days before automatic deletion. For long-term backups, use **Databases** > **MySQL Backups** to configure automatic backups with rollout.

Snapshots are stored uncompressed in your [[home-directory-location]] under `mysql_backups/`, following the format: _DBNAME_\-_YYYYMMDDHHMMSS_\-snapshot.sql

## Restoring from a Snapshot or Backup

1. Navigate to **Databases** > **MySQL Manager** > _List Users and Databases_
2. Select the database to restore
3. Select **Restore from Backup** from the actions dropdown
4. Choose which backup to restore from
    - Backups are sorted most recent first. Snapshots are marked with a camera icon.
5. Check the confirmation box to acknowledge that all current data in the database will be replaced
    - Backup tasks and user privileges are preserved
6. Click **Import**

### Using Custom Exports as Restore Points

You can use your own backup files (such as an older snapshot or phpMyAdmin export) by uploading them to `mysql_backups/` within your [[home-directory-location]] via [[accessing-ftp-server]] or the control panel (**Files** > **File Manager**).

The file must meet these requirements:

- Filename format: _DBNAME_\-20 followed by exactly 6 digits (YYMMDD), optionally followed by additional digits and "-snapshot"
- File extension: `.sql`, `.zip`, `.tar`, or `.gz`

Once uploaded, the backup will appear as a restore option in the control panel.

## See Also

- [[creating-database]]
