Unraid Server Backups Using LuckyBackup
This guide shows you step by step how to back up one Unraid server to another Unraid server using LuckyBackup.
This guide is a guest blog by Stefano Partida of SPXLabs
In this guide, we will be backing up one Unraid server to another Unraid server using LuckyBackup. Follow along for a relatively simple and mostly painless install process!
What is LuckyBackup?
LuckyBackup is a very user-friendly GUI backup container that uses rsync on the backend and only transfers over any changes rather than all your data, all of the time.
LuckyBackup Features
- Backup using snapshots
- Various checks to keep data safe
- Simulation mode
- Remote connections
- Easy restore procedure
- Add/remove any rsync option
- Synchronize folders
- Exclude data from tasks
- Execute other commands before or after a task
- Scheduling (cron jobs)
- Tray notification support
- e-mail reports
Security Warning
Please note that using the ‘root’ user to execute backups is not best practice. It is very common for administrators to create a specific account/non-user account to perform the backups of a system or server. Please use this guide as a learning tool and whenever possible, practice good cybersecurity techniques. Consider reading this Security Best Practices blog for a reminder of other best practices.
The Setup
Both the Main Server and Backup Server are plugged into the same 10Gigabit switch. The Main Server is where all of my files, pictures, videos, and ISO’s are; we want to copy those over to our Backup Server just in case something goes wrong. Both servers are running Unraid. The Backup Server has pre-created Shares that are named identically to my Main/Primary Server.
Guide
Unraid Version: 6.9.2
Community Apps Version: 2022.01.02a
Main Server IP Address: 192.168.1.8
Backup Server IP Address: 192.168.1.9
This guide assumes you have the Community Apps Plugin already installed.
Main Server Setup
- Using the Community Apps Plugin, go ahead and search, download, and install the LuckyBackup container by ich777
- Once it is installed we need to make some basic configuration changes
- Change “Console Shell Command:” to Bash
- Optional Change “WebGUI:” to an unused port number
- Set “Run as root user:” to true
Here is my configuration as an example.
LuckyBackup Container Setup
This will arguably be the hardest part. Take your time! We need to generate SSH Keys so we can rsync (copy data) between servers without using a password and without manual intervention.
First, in the Docker tab left-click on the luckyBackup container and open a console window. The container should be running/started at this point.
Next, we need to enter the following commands into the Console window.
ssh-keygen -t rsa
- Press the ‘Enter’ key three times to let the command create default paths and empty Passphrases
scp /root/.ssh/id_rsa.pub 192.168.1.9:/root/.ssh/
- When prompted, add 192.168.1.9 to the list of known hosts and type ‘yes’
- Enter your servers’ password if necessary
- Type ‘exit’ and close the Console window as necessary.
- Stop and Start the LuckyBackup container
Backup Server Setup
Now, we will need to create or edit a file called ‘authorized_keys’. Open a terminal on your backup server (>_ button) and enter the following commands into your Web Terminal.
- cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
- exit
Done. See, not so bad, below is an example picture. After you are done you can close or exit this window.
Configure LuckyBackup
In my example, we will be only backing up individual Shares. However, you can back up all Shares at once.
Note: Be careful not to copy your appdata directory from your primary server over top of your backup servers’ appdata directory. It can be easy to overwrite data if you aren’t careful.
In this example, I will be backing up a share called “isos”.
Warning a bug exists that will crash the container and will cause you to start all the way over, please follow directions explicitly.
- You will want to ‘+add’ a new task, it’s a button on the right side of the GUI
- Fill out the following information:
- Name: backupISOs
- Type: Synchronize Source and Destination
- Source: /mnt/user/isos
- Destination: /mnt/user
- Click the ‘Okay’ button. This is where the bug may occur
- Select the task you just named, ‘backupISOs’
- Click the ‘modify’ button
- Click the ‘Advanced’ button
- Update the Destination path to match the source path. Destination: /mnt/user/isos
- Click on the ‘Remote’ tab
- Check the ‘Use remote host’ box
- Under destination specify the user. In my example, I am using root.
- User: root
- @host: 192.168.1.9 <your backup server IP Address>
- Check the ‘ssh’ box and fill in the following
- port: 22
- private key file: /root/.ssh/id_rsa
- Click the ‘Okay’ button
- Congratulations, you are ready to back up your server! Here is my configuration as an example.
Execute a Backup
Starting a backup is simple. Assuming you did everything above correctly you can now select a single task or multiple tasks and begin running them. To do this, perform the following steps.
- Click the checkbox next to the task you want to run, this will enable/select the Task named ‘backupISOs’
- Click the ‘Run’ button
- Sit back, relax and enjoy a nice warm cup of Yorkshire Tea, coffee, beer, or tequila.
Assuming you did everything correctly, you should see output like this example.
Finally, we can also verify that our Share on our backup server is now populated with ISO’s:
FAQs
Can my backup server be a different Operating System or system, e.g QNAP, TrueNAS/FreeNAS, Synology, etc?
Yes, you can use any other Linux distribution for your backup system. The differences will more than likely be in file/directory structure. Generally, most Linux distributions have the commands we used, built into them.
Can this be done over a VPN, let’s say Wireguard?
Yes. I’d recommend reading this blog to learn more.
Where can I get additional support?
https://forums.unraid.net/topic/83786-support-ich777-application-dockers/
Prefer Videos? You are in luck:
What back up solution do you use?
Let us know in the Unraid forums!