Help | Backup - markbaaijens/rpmusicserver GitHub Wiki
You can make a backup of all the data contained in your RPMS-server. You have the choice for a full, server-based backup. Or a remote backup, where your backup contains basically the data/user-part of RPMS. A proper backup is the basis for Disaster Recovery.
Server-based backup
The advantage of the server-based (local) backup is that the resulting backup is an identical copy of the data-disk, making it very easy to switch in case of a disaster. The disadvantage is that you have to have local access to the server (Pi) for attaching the backup-disk.
This backup will be done to a dedicated backup-disk, connected to the Pi itself, thus a server-based backup.
Note. Backups will be made automatically at night once the backup-disk is attached to the Pi.
Steps to create a server-based backup
- format a disk dedicated for RPMS-backups (you only have to do this once):
- connect your (empty) backup-disk to your PC
wget https://github.com/markbaaijens/rpmusicserver/raw/master/scripts/format-usbdisk.sh -O /tmp/format-usbdisk.sh && chmod +x /tmp/format-usbdisk.sh && sudo /tmp/format-usbdisk.sh- enter your (personal) password of the client-machine
- follow the instructions to format as a BACKUP-disk
- connect your backup-disk to the Pi
- engage the backup:
- this is done automatically for you, at night
Forcing a manual backup
- in the web-interface, on the Backup-page, click Backup
Viewing backup-data on the usbbackup-disk
In case of a server-based backup, your backup will be made to a separate backup-disk. You can view the data on this disk, either online or offline:
- for viewing online, the backup-disk has to be attached to the Pi. Simply point your file explorer to
smb://rpms/backupand then you can view all the files on that disk; note that these are read-only. - for viewing offline, the backup-disk has to be attached to your own PC or laptop. The backup-disk is formatted as ext4 so this format is natively supported on Linux, thus being plug-and-play. Windows however requires additional drivers for viewing ext-drives. And worse, MacOS does NOT support ext4 at all! (despite extX being open-source/open-standard).
Disk-upgrade
If you want to upgrade your disk to a larger one without any loss of your user-data, but also without any loss of system-data/configuration.
Create a backup on the new (larger) disk. After creating the new backup, you can use the backup-mechanism. Because the backup is an exact mirror of de data-disk, exchanging these two by renaming some labels, should do the trick. See Data-disk crash under Disaster Recovery.
Remote backup
The advantage of the remote backup is that you can use a protocol at wish, be it ssh/rsync or syncthing (which is built-in in RPMS) or SMB. The disadvantage of a remote backup is that in case of a disaster, it is a lot more work to get up-and-running again.
Note that system-data is also present on the Public-share of RPMS in the form of a file rpms-system.zip. Thus, as you backup the user-data, you also backup the system-files resulting in a full backup.
For a backup using rsync over SSH, here is an example-script:
#!/bin/bash
rsync --progress --delete -rtv --max-size=4GB --modify-window=2
pi@rpms:/media/usbdata/user/*
/media/$USER/<disklabel of backup-disk>/backup/user
sync