Backups
All of this is in the menu too: luckybx, the "Backups" item.

Make one now#
luckybx backup run shop.example.comWithout a domain all sites are copied. A copy contains the database, files and settings. Caches and temporary files are not included.
On a schedule#
luckybx backup schedule on 03:30Every day at this time all sites are copied. The last seven copies of each are kept. Another number is set by the LBX_BACKUP_KEEP line in /etc/luckybx/luckybx.conf.
Restore a site#
luckybx backup list shop.example.com
luckybx backup restore shop.example.comWithout a copy name the latest one is taken. Before the restore the current state is saved separately, so you can go back.
Where they are#
In the backup folder of each site:
/home/bitrix/sites/shop.example.com/backup/These copies are on the same server. If the server itself is lost, they are lost too. So set up off-server copies, see below.
Get one file#
There is no need to restore the whole site for one file. Pick a copy, create an empty folder and unpack the file you need into it. The path is written from the site root:
cd /home/bitrix/sites/shop.example.com/backup/20261204-033000
mkdir /root/old
tar -I zstd -xf files.tar.zst -C /root/old ./include/header.phpThe database is next to it, in the db.sql.zst file.
Off-server copies#
Copies can be sent to another server, a cloud or a mounted disk. They are encrypted before sending, so nobody there can read them. Only what has changed since last time is sent.
To another server over SSH:
luckybx backup offsite sftp user@backup.example.com copiesThe server asks for the password once, after that it logs in with a key. If the SSH port is different, add --port 2222.
To an S3 cloud, for example Amazon S3, Yandex Cloud or Selectel:
luckybx backup offsite s3 https://storage.yandexcloud.net/my-bucketThe command asks for the access keys.
To a mounted disk or a network folder:
luckybx backup offsite dir /mnt/backupAfter setup the command shows the backup password. Save it somewhere other than this server. Without it the copies cannot be opened, and the password cannot be recovered.
If scheduled backups were off, they turn on by themselves: every day at 03:30.
What is sent and how long it is kept#
Every day after the normal copy the site is sent out too. Copies for the last 7 days, 4 weeks and 6 months are kept. Other numbers are set by the LBX_OFFSITE_KEEP="7 4 6" line in /etc/luckybx/luckybx.conf.
A 3.4 GB portal took 735 MB in the storage and was sent in two minutes. The next time one megabyte was sent.
If copies get in the way of the site, limit the speed: LBX_OFFSITE_KBPS="2000" in the same file, about 2 MB a second.
Check#
Once a week the copies are read back. It is checked that the data is intact and that each site's database downloads without errors. A small storage is read in full, one over 10 GB in parts, all of it within two months.
Check now:
luckybx backup offsite checkIf a copy was not sent or the check failed, luckybx check says so and a notification arrives.
Restore a site from an off-server copy#
luckybx backup offsite list
luckybx backup offsite restore shop.example.comFirst the copy is downloaded in full and checked, and only then the site is changed. The current state is saved separately. During the restore you need free space for a second instance of the site.
If the server is lost completely#
- Install LuckyBX on a new server.
- Connect the same storage with the same
luckybx backup offsite sftpors3command. It asks for the backup password. - Restore the sites:
luckybx backup offsite restore shop.example.com. The site is created by itself, with its own database. - Point the domain to the new server and get a certificate.
Mail through SMTP, Apache and the https redirect have to be turned on again, the command reminds you of that.
What copies will not save#
If an attacker got root rights, they can delete the copies too: the storage key is on the server. To prevent this, turn on version history or deletion protection in the storage. Almost all S3 clouds have it.
Other commands#
luckybx backup offsite what was sent and when
luckybx backup offsite run send now
luckybx backup offsite key show the backup password
luckybx backup offsite off stop sending