Skip to content

Backup and Restore ​

FlashPanel backs up your website source code and databases to external storage on the schedule you set, and lets you restore them when needed. Supported storage: Google Drive, OneDrive, Dropbox, SFTP, FTP and S3 (Amazon S3 or any S3-compatible service). Data is transferred with Rclone, which FlashPanel installs on the server automatically when you create your first backup configuration.

Backup management page ​

Open the server and click the Backup menu to go to the Backup & Restore page. It has 2 sections.

Backup List ​

Each row is a backup configuration: what to back up, where to, and on which schedule.

ColumnMeaning
IDThe configuration number
MemoThe description you gave the configuration
DriveThe storage (Google Drive, OneDrive, Dropbox, SFTP, FTP, S3)
SuccessWhether the configuration was set up successfully on the server
ActiveWhether scheduled backups are on or off
ActionAction buttons (see Manage backup configurations)

Above the table are the Import from rclone.conf and Add New buttons. Tick the checkbox at the start of rows to select several configurations, then click Delete Selected to delete them at once.

Backup Histories ​

Each row is one backup run, showing the file Name, Size, run Time, Status (green dot for success, red dot for failure) and Date. Click View Log in the Log column to see the details of that run, which is useful when a backup fails.

Create a backup configuration ​

  1. On the Backup & Restore page, click Add New → Add from Preset.
  2. In Choose Drive, pick the storage.
  3. Fill in Memo (a note to recognize the configuration, e.g. "Daily backup to Google Drive").
  4. Fill in the storage connection details (see below).
  5. Choose the schedule and the data to back up (see Schedule and backup data).
  6. Click Save. Watch the setup event on the Events page; when it finishes, the Success column turns to yes.

TIP

If you are familiar with Rclone, you can create configurations with Interactive Setup or Import from rclone.conf instead of the form.

Connection details by storage ​

Google Drive, OneDrive, Dropbox

Paste the authorization code into Backup Google Drive Code (or Backup OneDrive Code, Backup Dropbox Code). You get this code on your own computer, see Get an authorization code. Using a dedicated account for backups is recommended.

SFTP (back up to another server over SSH)

  • Host: the IP address or domain of the destination server.
  • User: the SSH user. Leave it empty to use root.
  • Port: the SSH port, 22 by default.
  • Choose how to authenticate: Password (enter the password) or Private Key (upload the SSH Private Key file and enter the Passphrase if the key has one).

FTP

  • Host, User and Password of the FTP account.
  • Port: 21 by default.

S3 (Amazon S3, DigitalOcean Spaces, Wasabi, MinIO…)

  • S3 Provider: choose S3 for Amazon S3, or Other for any other S3-compatible service.
  • Access Key ID and Secret Access Key: the access keys issued by your provider.
  • Region: the service region, e.g. us-east-1, ap-southeast-1.
  • Endpoint (only with Other): the service API address, found in your provider's dashboard.

Schedule and backup data ​

  • Cron Expression: when scheduled backups run, 0 0 * * * (every day at midnight) by default. Click Template to pick a preset; see Cron Job for the syntax.
  • Backup Cycle: how many days to keep backups, 14 by default. Backups older than this are deleted automatically.
  • Backup all sites: backs up every website on the server. Fill in Exclude folders to skip folders you do not need (such as cache folders). If unchecked, tick each website to back up; each one has its own exclude field.
  • Backup all databases: backs up every database. If unchecked, pick the databases to back up in Select databases.

Get an authorization code for Google Drive, OneDrive, Dropbox ​

Google Drive, OneDrive and Dropbox require you to sign in through a browser to grant access. Since the server has no browser, do this step on your own computer with Rclone, then paste the code into FlashPanel.

Install Rclone on your computer ​

bash
brew install rclone
bash
curl https://rclone.org/install.sh | sudo bash
powershell
winget install Rclone.Rclone

On Windows, you can also download the zip file from rclone.org/downloads, extract it (for example to C:\rclone\) and run it with the full path C:\rclone\rclone.exe in Command Prompt.

Get the code ​

  1. Open Terminal (macOS/Linux) or Command Prompt (Windows) and run the command for your storage:

    bash
    rclone authorize "drive"      # Google Drive
    rclone authorize "onedrive"   # OneDrive
    rclone authorize "dropbox"    # Dropbox

    If you use the .exe file on Windows, replace rclone with C:\rclone\rclone.exe.

  2. A browser opens. Sign in with the account used for backups and allow access.

  3. Go back to the command window. Copy the code between Paste the following into your remote machine ---> and <---End paste.

  4. Paste the code into the Backup … Code field when you create a backup configuration.

Interactive Setup ​

Interactive Setup opens a terminal window on the server running rclone config, so you can configure any storage that Rclone supports.

  1. Click Add New → Interactive Setup.
  2. In the terminal, follow Rclone's prompts: type n to create a new remote, name it, choose the storage type and enter the connection details.
    • For Google Drive, OneDrive, Dropbox: when Rclone asks whether to use a web browser to authenticate automatically, answer no and paste the code obtained on your computer.
  3. Finish and close the terminal window. FlashPanel automatically runs Import from rclone.conf to add the new remotes to the Backup List.

TIP

If the server has never had a backup configuration (Rclone is not installed yet), click Import from rclone.conf once first so FlashPanel installs Rclone, then use Interactive Setup.

Import from rclone.conf ​

If you have already configured Rclone on the server (for example by running rclone config over SSH as root), click Import from rclone.conf. FlashPanel reads the Rclone configuration on the server and creates a backup configuration for each remote it can connect to (remotes already in the list are skipped). The result for each remote is shown in the Output of the Import Backup from rclone.conf event.

Imported configurations are active immediately with default settings: run every day at midnight, keep backups for 14 days, back up all websites and databases. Click Backup Configuration on a row if you need to change them.

Manage backup configurations ​

Buttons in the Action column of the Backup List:

  • Restore: restore data from a backup (see Restore data).
  • Clone: copy this configuration to one or more of your other servers. Pick the servers in Servers, choose whether to back up all websites/databases, then click Clone.
  • View Backup Script: view the script that runs during a backup.
  • Run: open a terminal window and run the backup right away, without waiting for the schedule.
  • Backup Configuration (pencil icon): reopen the form to change the Memo, schedule, cycle and backup data. The Active switch turns scheduled backups on or off. The storage and connection details cannot be changed; create a new configuration if you need to.
  • Trash icon: delete the backup configuration.

All of these buttons except Restore and delete only appear once the configuration has been set up successfully.

Restore data from a backup ​

Click Restore on the backup configuration row. The restore window has 3 steps.

Step 1: Select the backup file ​

  1. Wait while FlashPanel loads the list of backup files from the storage. Click Refresh if the latest backup is missing.
  2. Filter by type with All, Sites, Databases, or pick a date in Filter by Date.
  3. Choose a file in Backup File, then click Continue.

Step 2: Choose where to restore ​

FlashPanel detects whether the file is a website or a database backup:

  • Website: choose the target website in Select Website.
  • Database: choose the target database in Select Database. Only databases of the same type as the backup (MySQL or PostgreSQL) are listed.

Click Continue.

Step 3: Confirm and restore ​

Review the summary (backup file, restore type, target website or database), then click Restore Backup. Follow the progress on the Events page; the restore runs in the background, so you can leave the page.

Before you restore

  • Website: files in the backup overwrite files with the same name in the target website folder. Before overwriting, FlashPanel copies the current website folder to /root/backup_before_restore_<timestamp> on the server so you can get it back if needed.
  • Database: you can only restore into an empty database. If the target database already has tables, the restore is cancelled to prevent data loss. Create a new database to restore into.

View backups of all servers ​

The Backups menu in the main navigation shows the backup configurations of every server in one list, with an extra Server column and a selector to filter by server. Here you can create a configuration with Add New → Add from Preset (the form has an extra server selector) and use the Action buttons just like on each server's page. Backup history, Interactive Setup and Import from rclone.conf are only available on each server's Backup page.