Skip to main content
The bot has no backups or snapshots, you make copies yourself. Regularly pull important data from the server to your own machine or to another server.
Reinstall wipes the disk completely, Delete wipes the server along with its data, and neither can be undone. Keep copies off the server itself, otherwise they are lost along with it.

Files

Run these on your own computer, replace IP with the Server IP from the card. A one-off copy of a directory:
For repeat copies rsync is handier: it transfers only what changed and runs faster.
  • -a – preserves permissions and structure.
  • -v – shows progress.
  • -z – compresses during transfer.

Database dump

Copying database files directly is unreliable, you need a dump. Make it on the server and pull the file as in the Files section. The first line dumps one database, the second all of them.

Archive

A directory packed into one compressed file is easy to download:
  • -c – create an archive.
  • -z – compress with gzip.
  • -f – file name.
To unpack: tar -xzf backup.tar.gz.

Schedule

  1. Cron – open the schedule on the server:
  2. Line – add it: every day at 03:00 the directory is copied to another server.
    The % sign in crontab is escaped as \%. In advance, set up SSH key login from this server to the receiving one and create the /backups directory there.
Back up a database the same way: first mysqldump or pg_dump into a file, then rsync that file.

Whole server

The bot cannot take a disk image. For a move or a full copy, the important directories are enough: sites, configs, database dumps.
To move a directory to a new server, rsync is handier: it copies directly, without an archive.
Copying the whole disk with dd on a running system is unsafe: back up directories and database dumps.

Check

Test a restore at least once: deploy the dump and the archive on a test server and make sure the data reads correctly. Next: Firewall, Server hardening.