sp export / sp restore

Create encrypted backups of your full deployment and restore from them.

Export (backup)

bash
# Create a backup with auto-generated name (timestamp)
sp export

# Create a backup with a custom name
sp export --name pre-migration

Backups are stored at ~/sp-backups/ as an encrypted .tar.gz archive. Each backup includes:

  • All database dumps (MySQL, PostgreSQL)
  • All Docker volume data (uploaded files, configurations)
  • Your encrypted ServicePlus configuration
  • Plugin bundle state
Backups run automatically on a nightly schedule. sp export lets you create a manual backup at any time — recommended before updates, migrations, or major changes.

Restore

bash
sp restore --file ~/sp-backups/pre-migration.tar.gz

To skip the confirmation prompt (for scripted use):

bash
sp restore --file ~/sp-backups/backup.tar.gz --force
Restore is a destructive operation. It wipes your current installation and replaces everything with the backup contents. Your security answer is required to decrypt the backup.

Moving to a new server

  1. Run sp export on the old server
  2. Transfer the backup file to the new server: scp ~/sp-backups/backup.tar.gz user@new-server:~/
  3. Install the CLI on the new server: curl -fsSL https://raw.githubusercontent.com/aimaddotnet/serviceplus-cli-releases/main/install.sh | bash
  4. Run sp restore --file ~/backup.tar.gz on the new server
  5. Run sp cleanup on the old server to release your license

Best practices

  • Copy backups off-server to a second location (object storage, second VPS, local machine)
  • Test a restore on a staging server periodically to confirm backups are working
  • Always export before running sp update on major version changes