Backup your Unraid Server with LuckyBackup

In this guide we will backing up Unraid to another Unraid server using LuckyBackup. While the steps to make this happen may seem daunting, they are actually very simple and mostly painless!

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.

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 it is not best practice to use the ‘root’ user to execute backups. 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.

The Setup

This is an extremely simple diagram showing how the network is 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 essentially 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.

Setup Main Server

  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 unused port number

  5. Set “Run as root user:” to true

Here is my configuration as an example.

Setup LuckyBackup Container

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.

Then we need to enter in the following commands into the Console window.

  1. ssh-keygen -t rsa
    1. Press the ‘Enter’ key three times to let the command create default paths and empty Passphrases

  2. scp /root/.ssh/id_rsa.pub 192.168.1.9:/root/.ssh/
    1. When prompted to add 192.168.1.9 to the list of known hosts, type ‘yes’

    2. Enter your servers’ password if necessary

  3. Type ‘exit’ and close the Console window as necessary.

  4. Stop and Start the luckyBackup container

Step 1: Example from above, ssh-keygen -t rsa

Step 2: Example from above, scp /root/.ssh/id_rsa.pub 192.168.1.9:/root/.ssh/

Step 3: Example from above, typing ‘exit’ into the Console window


Setup the Backup Server

Now we will need to create or edit a file called ‘authorized_keys’. This is very simple to do, the hardest part is locating the “Web Terminal” icon that looks like “>_”. By default it is in the top right corner of the WebUI. You will do this on your backup server.

First 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 if you haven’t done so already.


Configure LuckyBackup

In my example we will be only backing up individual Shares, however, you can back up all Shares at once. Just 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 backup 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.

  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” -Spiffing Brit

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.



Questions?

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.

Why are you using two Unraid Servers?

Because I like it and it feels good. Seriously though, having the same operating system on both ends just makes it easy but mostly because I want to support Limetech as much as possible.

Can this be done over a VPN, let’s say Wireguard?

Yes. I’d recommended reading this post on Unraid.net to learn more.

Where can I get additional support?

https://forums.unraid.net/topic/83786-support-ich777-application-dockers/

Why read when you can watch?