13 January 2022

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.

Lucky Backup
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

  1. Using the Community Apps Plugin, go ahead and search, download, and install the LuckyBackup container by ich777
  2. Once it is installed we need to make some basic configuration changes
  3. Change “Console Shell Command:” to Bash
  4. Optional Change “WebGUI:” to an unused port number
  5. Set “Run as root user:” to true

Here is my configuration as an example.

Screen Shot2022 01 03at1 19 38 PM

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.

Screen Shot2022 01 03at3 09 59 PM

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
Screen Shot2022 01 03at1 44 43 PM

     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
Screen Shot2022 01 03at1 56 21 PM
  • Type ‘exit’ and close the Console window as necessary.
  • Stop and Start the LuckyBackup container
Screen Shot2022 01 03at2 03 39 PM

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.

  1. cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
  2. exit

Done. See, not so bad, below is an example picture. After you are done you can close or exit this window.

Screen Shot2022 01 03at2 09 47 PM

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.

  1. You will want to ‘+add’ a new task, it’s a button on the right side of the GUI
  2. Fill out the following information:
    1. Name: backupISOs
    2. Type: Synchronize Source and Destination
    3. Source: /mnt/user/isos
    4. Destination: /mnt/user
  3. Click the ‘Okay’ button. This is where the bug may occur
  4. Select the task you just named, ‘backupISOs’
  5. Click the ‘modify’ button
  6. Click the ‘Advanced’ button
  7. Update the Destination path to match the source path. Destination: /mnt/user/isos
  8. Click on the ‘Remote’ tab
  9. Check the ‘Use remote host’ box
  10. Under destination specify the user. In my example, I am using root.
    1. User: root
    2. @host: 192.168.1.9 <your backup server IP Address>
  11. Check the ‘ssh’ box and fill in the following
    1. port: 22
    2. private key file: /root/.ssh/id_rsa
  12. Click the ‘Okay’ button
  13. Congratulations, you are ready to back up your server! Here is my configuration as an example.
Screen Shot2022 01 03at2 26 23 PM

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.

  1. Click the checkbox next to the task you want to run, this will enable/select the Task named ‘backupISOs’
  2. Click the ‘Run’ button
  3. 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.

Screen Shot2022 01 03at2 38 30 PM

Finally, we can also verify that our Share on our backup server is now populated with ISO’s:

Screen Shot2022 01 03at2 40 54 PM

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!