Explorations with UrBackup

I thought I was going to use Duplicati for my backups, but my explorations didn’t go so well. I looked around for alternatives, and I found UrBackup. So, let’s do a little experiment to see how it works. Below are my notes as I tried it out.

The Setup

I have 2 virtual machines to test this out. It’s basically the same machines that I used in my Duplicati explorations. The test server is where I want UrBackup to run. The other machine is my test desktop. That will have the files that i want backed up to the test server.

Installation

I followed the installation instructions in the documentation. The Ubuntu instructions have me add a repository and then install the server backup. So, I ran this on the “server” machine:

sudo add-apt-repository ppa:uroni/urbackup  
sudo apt-get update  
sudo apt-get install urbackup-server

For some reason, the repository isn’t good. It doesn’t have a release file.

E: The repository 'https://ppa.launchpadcontent.net/uroni/urbackup/ubuntu kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
...
Err:6 https://ppa.launchpadcontent.net/uroni/urbackup/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.52 443]
Reading package lists... Done                              
E: The repository 'https://ppa.launchpadcontent.net/uroni/urbackup/ubuntu kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
...
E: Unable to locate package urbackup-server

So, I dropped back to the Debian instructions. I used the Downloads page to go to the Bullseye folder. I installed that deb package.

wget https://hndl.urbackup.org/Server/2.5.30/debian/bullseye/urbackup-server_2.5.30_amd64.deb
sudo apt install ./urbackup-server_2.5.30_amd64.deb

During the install, it asked about the directory where it should save the data. I picked /opt/urbackup for my test.

Once installed, I went to the web interface. The default port is 55414, so I when to http://192.168.56.103:55414/

Next step is to create a user. I went to the Settings link and clicked Create user.

I just had to enter a password.

Installing the Client

Over on the “desktop” virtual machine, I ran this client install script:

TF=$(mktemp) && wget "https://hndl.urbackup.org/Client/2.5.23/UrBackup%20Client%20Linux%202.5.23.sh" -O $TF && sudo sh $TF; rm -f $TF

It asked me to select the snapshot mechanism. I picked “4) Linux device mapper based snapshots”. I also said “yes” to this question: “Convert root device into device mapper device on boot (initramfs)? This is required for root device/filesystem backup. [Y/n]”

After installation, the client just showed up in the status list on the server’s web inteface.

I went to the settings and selected my desktop as the client. Then, I could add a path to backup.

With the test desktop working, I went back to the server. I want to backup files on the server itself. So, let’s give that a try. I ran the same client installation script. This time, I picked option 2 for the snapshot mechanism, the LVM option. Right after I installed it, the server client showed up in the list.

Security Concerns

So, my thought at this point is that this client setup is really easy, but it could cause major problems. What if I get on a network where someone has a server. Can they backup my computer without my permission?

I found the answer in the FAQ. It’s not a problem because it only connects to the first server it ever sees. After that, it won’t work with any other server good or bad.

For security reasons the UrBackup Client only allows the backup server it first sees to download files. This is even the case if you update the Client. To select a different backup server you have to edit server_idents.txt in the directory where you installed UrBackup Client. 

I found that file at /usr/local/var/urbackup/server_idents.txt

It seemed to have a key in it.

$ sudo cat /usr/local/var/urbackup/server_idents.txt
Bx4aGgfvJwURZnyo1wIH#fingerprint=19:91:01:F5:51:1E:17:D2:86:20:8B:84:0A:03:E6:58:FD:CB:9D:88:13:EF:7F:C9:8F:9E:48:6C:8A:AF:74:42&pubkey=MIIBtjCCASsGByqGSM44BAEwggEeAoGBAKthxZNBx1S5cIilvoOI9iAvVxNV5Uliwbn30yvRfk5Zb1d+n3ypzrMp2hyNet/P3xnkmRn2xTKumr5Ebr+WCMMNkTjZQPHgPmjpNY+rCvCmq4mIwCYNZmoXSErRISb0MViM4lZJt8gksFYl1z8bgwDRr6jByB8MinlrH1jsZGlFAhUAsvqt+ffAdx5pdT7k/GVuafy1RekCgYBL5+0XBGC4c292uwQbKAGg8YOjSooDNBb4prDDJpEow2ZQg+xVtUuVLZPPj+yc6wl1G+ZZZrAkfCln8GEmaz6xy0ixFPUAjMPLWpRKF/KO0zdQQLAMFhH+txOVMS0aUADsPQY7Q/H0WVU7pfK8pAoKqfNPwp/aNA83IWVnFovTywOBhAACgYA2t+YbdbnMH/T5uzIv+mg+7HmzRRbinozxvFLFWZsXfDgmo4343kUUS2xRvMtoKhCETFxb54CFLh1jbSVrJGToq9FLPeVoS9pzbzv2mk5yrC7hup8hRvtppmf0c8LAbgQEBL2DOxHgt6wW2cOLKo1LCw4xjF2akafOC2Zy4zmvzA--&pubkey_ecdsa409k1=MH4wEAYHKoZIzj0CAQYFK4EEACQDagAEATkoH8CcEnOe3Ok+Z6Rjos1hVn1IGB16bd1KyxfkvWR/Lt+lGDM2jptlXQufXPUEMykceADFnCTnd5U2rJ8Z9on2ASiMQ8ACmbZT/vjsoosJWM8poxu/MTa01rMgn6WUszUuS7taGk0-

Seems secure to me.

Running a Backup

Next step is to run a backup. Actually, I found one had already run. I guess it triggered automatically before I got around to running it. I checked the backup size, and it matches the size of the files. I guess that means it’s not compressing.

$ sudo du -hs /opt/urbackup/
124M	/opt/urbackup/

I found I could kick off a backup manually from the Status page using the drop down for the server.

I can see it running on the Activities page:

Just for testing, the files on the server are exactly the same. It does some dedpulication, but it also adds a little space for the backup.

$ sudo du -hs /opt/urbackup/
140M	/opt/urbackup/

Out of curiosity, I renamed the files. I would expect that since the contents were the same it wouldn’t add to the storage space used.

$ for f in *; do
> mv "$f" "renamed-$f"
> done; ls
 renamed-February2023_8933.qfx              renamed-PXL_20230224_140417679.MP.jpg
'renamed-Fiery Serpents.pptx'               renamed-PXL_20230224_192040851.jpg
'renamed-Google Fi Summary.xlsx'            renamed-PXL_20230227_004318122.jpg
 renamed-IMG_20230227_184723916_HDR.jpg     renamed-PXL_20230301_175831837.MP
 renamed-IMG_20230301_105021853.jpg         renamed-PXL_20230301_175831837.MP.jpg
 renamed-IMG_20230301_111744010.jpg         renamed-PXL_20230301_175845815.MP
 renamed-matthew_backup.sql                 renamed-PXL_20230301_175845815.MP.jpg
 renamed-Online_Security_SQL_problem.docx   renamed-PXL_20230302_005003487.jpg
 renamed-Photos-001.zip                    "renamed-Refiner's Fire - How is Silver Refined.webm"
 renamed-PXL_20230224_140417679.MP

Sure enough, it takes no extra space.

$ sudo du -hs /opt/urbackup/
140M	/opt/urbackup/

Now, what about if I delete a backup. Would it free the space? I added one backup with this almost 1GB of files (A couple of GitHub repositories and a lecture that I found).

I was amazed at how quickly it backed up, but it all backed up just fine. I checked the space before and after. The space used on the server went from 282Mb to 1.1Gb.

$ sudo du -hs /opt/urbackup/
282M	/opt/urbackup/
$ sudo du -hs /opt/urbackup/
1.1G	/opt/urbackup/

The challenge at this point is that I can’t delete the back up since it is the latest one. I’ll have to do another one.

So, I deleted the “extra-data” folder and ran another backup. Now, when I visit the backups page, I can delete the 900Mb backup.

When I click the button, it does give me a warning. I went ahead and pressed Delete.

I checked the before and after sizes on the server. It did drop from 1.1Gb to 283Mb, so it did free the space used.

$ sudo du -hs /opt/urbackup/
1.1G	/opt/urbackup/
$ sudo du -hs /opt/urbackup/
283M	/opt/urbackup/

Snapshot Errors

One thing I’d like to figure out is these snapshot errors. As far as I can tell, it is backing up okay, but it kept showing that it completed with errors. When I look at the log, I keep seeing that creating the snapshot failed.

For the time being, I think I’m going to ignore these errors. I’m thinking maybe it has to do with my selections on the install.

Restoring from the Backup

Now, for this to be effective, it has to be able to restore the files. I didn’t find an option to restore the files back to their original location. But, it was quite easy to download the file and then I can put it where it needs to go.

Under the backups section, I found I could drill down into the Desktop client. Then, I can pick the date from which to restore.

I can download the whole backup as a single folder if I want to.

So, what about just restoring a directory of files. Do I have to download each individually? To test that, I created another directory in my test data.

So, once that was backed up, I could drill down to it in the backups. Then, there is an option to download the whole folder as a zip file:

Saving Old Backups

My last big question to figure out is how I can store my previous backups. I like to keep my snapshots of my old Linux systems. So, I backup my laptop to a portable drive. Then, I copy that backup into an Attic repository for long term storage. How can I do the same thing using URBackup instead of Attic?

To mimic, how I might set this up, I created an “old-backups” folder on the server. Then, I added some files in there that might be like an Ubuntu 22.10 backup. Here’s what it looks like:

$ find old-backups 
old-backups
old-backups/ubuntu-22.10-kinetic-kudu
old-backups/ubuntu-22.10-kinetic-kudu/etc
old-backups/ubuntu-22.10-kinetic-kudu/etc/passwd
old-backups/ubuntu-22.10-kinetic-kudu/etc/hosts
old-backups/ubuntu-22.10-kinetic-kudu/home
old-backups/ubuntu-22.10-kinetic-kudu/home/Documents
old-backups/ubuntu-22.10-kinetic-kudu/home/Downloads

On the server settings, I entered the path to my “old-backups” folder. You can separate multiple paths with a semicolon(;).

The one part that I don’t like about this setup is that I don’t get separate settings for the folders. I’d like to have my daily backups archive weekly or something like that. Then, the old-backups, I’d like to never archive unless I manually do it. I don’t see that option.

After running the backup, I know have my old-backups folder in the server backup page.

In the old backups, I have my Ubuntu 22.10 folder:

Then, my next step would be to delete the 22.10 folder and put in my 22.04 folder pulled from Attic. Here’s what the old-backups looks like now when I run my next backup.

$ find old-backups 
old-backups
old-backups/ubuntu-22.04-jammy-jellyfish
old-backups/ubuntu-22.04-jammy-jellyfish/etc
old-backups/ubuntu-22.04-jammy-jellyfish/etc/passwd
old-backups/ubuntu-22.04-jammy-jellyfish/etc/hosts
old-backups/ubuntu-22.04-jammy-jellyfish/home
old-backups/ubuntu-22.04-jammy-jellyfish/home/Documents
old-backups/ubuntu-22.04-jammy-jellyfish/home/Downloads

Once I do that backup, I can see the Ubuntu 22.04 folder on the backups page. The only problem is that I can’t see Ubuntu 22.10 folder. I have to know the date that it was backed up before I can see it.

Now, if I at least include the empty directory for Ubuntu 22.10, like this:

$ find old-backups 
old-backups
old-backups/ubuntu-22.04-jammy-jellyfish
old-backups/ubuntu-22.04-jammy-jellyfish/etc
old-backups/ubuntu-22.04-jammy-jellyfish/etc/passwd
old-backups/ubuntu-22.04-jammy-jellyfish/etc/hosts
old-backups/ubuntu-22.04-jammy-jellyfish/home
old-backups/ubuntu-22.04-jammy-jellyfish/home/Documents
old-backups/ubuntu-22.04-jammy-jellyfish/home/Downloads
old-backups/ubuntu-22.10-kinetic-kudu

Then, in the backup, I can see both, and I can use the List button to view the versions:

On the list page, I can see the version that’s empty and the one that has files:

Groups

The settings page has an interesting feature called groups. I’m curious if I setup a group, will I be able to configure different settings for the same client? So, I created a group called old-backups and added my test server to it.

I also renamed my backup directory with a “2” in it so that I would know for sure when it was backed up:

$ find old-backups2/
old-backups2/
old-backups2/ubuntu-22.04-jammy-jellyfish
old-backups2/ubuntu-22.04-jammy-jellyfish/etc
old-backups2/ubuntu-22.04-jammy-jellyfish/etc/passwd
old-backups2/ubuntu-22.04-jammy-jellyfish/etc/hosts
old-backups2/ubuntu-22.04-jammy-jellyfish/home
old-backups2/ubuntu-22.04-jammy-jellyfish/home/Documents
old-backups2/ubuntu-22.04-jammy-jellyfish/home/Downloads
old-backups2/ubuntu-22.10-kinetic-kudu

Then, I added that path to the group directory setting:

I’m finding that I can’t have the same client in multiple groups. When I add it to a new one, it removes it from the old group. I think these groups are just to group it in the client drop down:

On the actual client settings for the test server, I removed the old-backups path:

Apparently, the client settings override the group settings. So, I can’t have two different settings for the same client. It didn’t backup my “old-backups2” folder.

Multiple Virtual Sub Clients

When all else fails, search for a solution on the web. I found this article in the URBackups Forum. It pointed to the manual: 8.3.5 Virtual sub client names. The setting is under the client tab of the test server client. The manual says you can create multiple by using the pipe (|).

Now, I have a separate set of settings, and I can put the old-backups path for that virtual sub-client.

After setting that up, I could see the virtual sub-clients in the backup section

Resource

Leave a Comment

Your email address will not be published. Required fields are marked *