External Backups (SFTP SQL) - MaxMaeder/DriveBackupV2 GitHub Wiki

You can configure DriveBackupV2 to include files or MySQL databases from external servers in the backup.

external-backup-list

The list of things to include in the backup from external servers.

An entry consists of:

  • the hostname of the external server
  • the port
  • the username
  • the password (leave blank if no password)
  • the file name format of the zip file to create
  • the type of external source
  • settings specific to an external source type

hostname

The hostname or IP address of the server.

port

The port of the server.

For FTP and FTPS servers, this is usually 21. For SFTP, this is usually 22. For MySQL, this is usually 3306.

username

The username to use to connect to the server.

password

The password to be used to authenticate with the server. Leave blank if no password required.

format

The file name format is the naming scheme of the zip file that will be created, this should contain a timestamp. You can include a timestamp using date and time pattern letters. You can learn more about date and time pattern letters here.

type

The type of external server.

The types of external servers currently supported are:

  • ftpServer
  • ftpsServer
  • sftpServer
  • mysqlDatabase

Settings specific to FTP(S) and SFTP servers

base-dir

The base file path should be the path to the folder which all the paths to files/folders to make backups of are relative to.

backup-list

Each entry in the list of files/folders to make a backup of should contain:

  • the path to the file/folder
  • files to not include in the backup (optional)
path

Each path in the list of paths to files/folders to back up should be relative to the base file path

blacklist

Excluding files in the backup is the same as described in Specifying What to Backup.

Settings specific to SFTP servers

sftp-public-key

The path to the key to be used to authenticate with the server. The path should be relative to the DriveBackupV2 folder. Leave blank if not using public-key authentication.

DriveBackupV2 can connect to SFTP servers that use both basic and public-key authentication.

sftp-passphrase

The passphrase to be used in conjunction with the key to authenticate with the server. Leave blank if not using public-key authentication or no passphrase required.

Settings specific to MySQL servers

Since v1.3.0

ssl

Whether to connect to databases over a secure connection.

databases

Each entry in the list of databases to make a backup of should contain:

  • The name of the database
  • Tables to not include in the backup (optional)
name

The name of the database.

blacklist

A list table names you don't want to include in the backup from this database.

An example of including files from an external FTP server in the backup:

- hostname: "ftp.example.com"
  port: 21
  username: "Username"
  password: ""
  format: "Backup-ftp-server-%FORMAT.zip"
  type: "ftpServer"
  base-dir: "server"
  backup-list: 
  - path: "folder1"
  - path: "folder2/folder3"
  - path: "folder2/folder4"
    blacklist:
    - "folder5/**"

An example of including a database from an external MySQL server in the backup:

- hostname: "databases.example.com"
  port: 3306
  username: "Username"
  password: ""
  format: "Backup-mysql-database-%FORMAT.zip"
  type: "mysqlDatabase"
  ssl: true
  databases: 
  - name: "myDatabase"
    blacklist:
    - "myTable"