New install cannot find existing backup

Hi!
I have been running Duplicati on an Ubuntu 18.04 partition for about 2½ years. Now I have created a new partition where I have installed Ubuntu 20.04. And I have installed Duplicati, according to Installation - Duplicati 2 User's Manual .
I want Duplicati on 20.04 to take over all backing up, so on 18.04
I stopped all scheduled backups. I read some posts and concluded that I just need to copy the folder /home/henrik/.config/Duplicati/ from the 18.04 partition to the 20.04 partition. But when I sign in on http://localhost:8200/ngax/index.html in Firefox on 20.04, there are no backups. What have I missed?
Any help will be deeply appreciated.

How have you been starting Duplicati? Does it start at boot, do you manually start after login, or other?

Installing Duplicati on Linux looks like it sets up to start at boot, likely as root. What user was it before?

Duplicati stores its databases in the home directory of the user it starts as (i.e. ~/.config/Duplicati), so copying the config folder needs to be done with a knowledge of what was used, and what’s now used.

You can look in ~root/.config/Duplicati to see if you have a recent Duplicati-server.sqlite, and no others.
That would imply that’s the place to copy your ~henrik files. Alternatively, you don’t have to start at boot, unless you want it that way. You can disable start at boot, and run the duplicati command after login.

EDIT:

You could of course use ps or some other process tool to find which user mono is running Duplicati as.
Duplicati can also show it in a few ways. Without any backups, easiest is About --> System Info to see SpecialFolders, which are user-based. You can possibly infer the same result from source tree view.
With backup (even a test one), find <job> --> Database path.

Thank you very much!
Duplicati -> About -> System info says: UserName : root
But entering the /root folder seems quite complicated, so I would rather run Duplicati as ‘me’, and then just copy the /home/henrik/.config/Duplicati/ folder from Ubuntu 18.04 to 20.04. But how do I become the ‘UserName’ of Duplicati? Is that explained in the dcumentation on Introduction - Duplicati 2 User's Manual ?

I guess I missed the more direct way there. Maybe I didn’t browser-search well enough.

So once again, when (at boot or at login) and how (auto/manual) did you run Duplicati?

Were you happy with it before? Then the question is to replicate how you had done that.

You can check the old install, and if has ~root/.config/Duplicati, then which did you use?

Is the old partition still bootable? You never want to mix two Duplicati on one destination,
however you don’t have the new one going yet. Do they back up the same source files?

That seems too much for Introduction, but same question can be asked on Installation.

There are many things that are not 100% detailed. Again, change requests can be filed.
One problem, though, is that you’re in systemd administration, and I think it varies a bit.
A complete systemd manual is also vastly beyond the scope of what can be supplied…

As mentioned in other topic, maybe manual can offer setup hints for particular purpose.
Typically, the issue that comes up is Duplicati having no access to files, thanks to Arch.

The User= and Group= force Duplicati to start without access to anything. It’s secure…
You could edit for your own user and group, e.g. as shown by running the id command.

I don’t administer this much, so if you can find Ubuntu info, it may be the most accurate.
Search for ubuntu systemd user group finds lots of material that can help guide you.

man systemd.unit

UNIT FILE LOAD PATH talks about this some, however I’m not a great systemd expert.
My interpretation is that you want to edit your /etc/systemd/system/duplicati.service file.
This is the same file that you were either editing per manual or it was already sufficient.

man systemd.exec

 User=, Group=
           Set the UNIX user or group that the processes are executed as, respectively.

How so? You must already have been able to get to a root shell to get the steps you did.
There are security reasons why running as root is too powerful. Depends on your need.
Clearly, if you want to run as you, you can’t backup any files that you have no access to.

Hi ts678!

Thank you for your reply.

On the Ubuntu 18.04 partition Duplicati was scheduled to automatically run a backup once a day. When it worked, I didn’t need to do anything. But a few times it stopped working, so as an extra security it sends me an email every day, through Duplicati Monitor.
I can’t say that I am 100% happy with Duplicati, because I find it quite complicated to configure, as right now.
I guess that 2½ years ago I must have configured it to run as ‘me’ instead of as ‘root’. But I can’t remember how… :slight_smile:
I am quite sure that on 18.04 Duplicati used the configuration at: /home/henrik/.config/Duplicati/
I can still boot 18.04 without problems, so I deliberately stopped all scheduled backing up THERE, before copying the files to the 20.04 partition. If I had a deeper understanding of Duplicati I guess I would probably stop it in another more fundamental way on 18.04.
The actual data files that are being backed up are on a third - data - partition (NTFS). So actually - according to MY logic - the configuration files, especially the big sqlite database, should be on THAT data-partition, so I can restore drive images of the 20.04 partition without having to rebuild the Duplicati database…
I don’t remember ever having entered /root looking at the files on 18.04.
The reason I linked to the ‘intro’ of the documentation is because that seems to be the right link to that manual.
You say ‘Arch’. Is that a Linux distro or what?
You imply that I would want to edit a ‘duplicati.service’ file:

On 18.04 there is such a file here:

/etc/systemd/system/multi-user.target.wants/
/lib/systemd/system/
/usr/lib/duplicati/debian/

On 20.04 there is such a file here:

/etc/systemd/system/
/etc/systemd/system/multi-user.target.wants/
/run/systemd/units/
/usr/lib/duplicati/debian/
/usr/lib/systemd/system/

Can anyone tell me what to do, or where to find the information. Thank you!

Look at any old duplicati.service files that you can find. Maybe you will find the User= Group= there.

If you think it was starting at boot before (still unclear), then this is just Linux systemd administration.

systemctl disable duplicati will keep it from starting at boot, or just uninstall duplicati package.

How to Manage Systemd Services on a Linux System

Use the systemctl enable command to have systemd automatically start a service (or other type of unit) at bootup. The systemctl disable command disables a services and stops it from starting automatically with your computer.

You can use:

Duplicati.Server.exe option

--server-datafolder
Duplicati needs to store a small database with all settings. Use this option to choose where the settings are stored. This option can also be set with the environment variable DUPLICATI_HOME .

This would be an example of something you could add to server start in DAEMON_OPTS as here,
if all backups (maybe just one?) go there, otherwise you might want each job DB on its destination.
The easiest way to do that is probably on the Database screen to alter the Local database path.

Yes, per the linked article or web search for arch linux. Manjaro from the article is based on Arch.

I’ve been doing that. Anyone who is a systemd expert, please join.

I think you can find the systemd file to edit both from the systemd.unit man page I cited, or

# systemctl status duplicati
● duplicati.service - Duplicati web-server
   Loaded: loaded (/etc/systemd/system/duplicati.service; enabled; vendor preset: enabled)

So if yours also says /etc/systemd/system/duplicati.service, then edit that file and add lines for User= and Group= similar to what "Installing Duplicati on Linux (Arch / Manajaro) had, but with your ids.
You can reboot, or use systemctl (systemctl stop duplicati then systemctl start duplicati).

According to man systemd.unit (linked above or available using man command), .wants has symlinks.
Possibly you were running /lib/systemd/system/duplicati.service, and had edited it. You can look at file.

I think the problem with editing Duplicati-installed files directly is that the next install will overwrite yours.

How can I make a modification to a .service and keep it persistent? [duplicate]
Where to place user created systemd unit files [duplicate]

Running Google search for systemd "different user" led me to some top hits matching my advice:

How do I create a service on CentOS running as a different user than root? is basicaly the same recipe.
How to change service user in CentOS 7? suggests systemctl daemon-reload also. Sounds proper.

man systemctl talks about what that does, and finding it also led me to systemctl edit which does it automatically after you edit the configuration. You could maybe systemctl edit --full duplicati, pulling up the old file and letting you add the User= and Group= lines that give your own user and group.

There seems to be a fancier way to override settings, if you omit --full. It looks like you still need section.
Or at least the forum post here explicitly gave it. You could test omitting that, but probably safer to give it.

Editing a Unit File
How To Use Systemctl to Manage Systemd Services and Units Especially look at Editing Unit Files

If you look at your duplicati.service files, you’ll probably see some lines looking like below:

[Service]
Nice=19
IOSchedulingClass=idle
EnvironmentFile=-/etc/default/duplicati
ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS
Restart=always

That’s your Service section. You want to add lines like below:

User=<your user>
Group=<your group>

but I have no idea if that’s what your 18.04 does. You can look. There are other ways to get what you got.
The lack of comment on manual start implies start at boot, but systemctl status duplicati willl say.
You can also use ps to see what user it is. If it’s root, you might have used –server-datafolder to set that durectory to your home directory, then accessed it as root (and put up with lower security to run as root).

Hi ts678

Thank you for the HUGE amount of information!
I will try to ‘decipher’ it… :wink:
But this complexity is exactly why I hate computers, Linux AND Duplicati!
The problem is that I hate Microsoft, Windows and Bill Gates even more…
But online data backups seems to be one of the things Windows does much easier - but it also costs a bit more.
There are so many other things I would rather spend my time on, instead of spending days on trying to get Duplicati to work! Sigh!

I very much regret ever having started using Duplicati 2½ years ago!
If this is the easy way to backup your data files automatically daily to a B2 Backblaze Bucket cloud server, from Ubuntu Linux, then mankind is in dire straits…

So I did the following, but there is still something wrong:

Booting on Ubuntu 18.04, I did the following in Terminal, to stop Duplicati, so it doesn’t interfer with 20.04:

henrik@Henrik-L570 : ~ $ systemctl disable duplicati
Removed /etc/systemd/system/multi-user.target.wants/duplicati.service.
henrik@Henrik-L570 : ~ $ systemctl status duplicati
● duplicati.service - Duplicati web-server
Loaded: loaded (/lib/systemd/system/duplicati.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2020-09-12 18:08:08 CEST; 31min ago
Main PID: 1093 (mono)
Tasks: 17 (limit: 4915)
CGroup: /system.slice/duplicati.service
├─1093 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
└─1837 /usr/bin/mono-sgen
/home/henrik/.config/Duplicati/updates/2.0.5.1/Duplicati.Server.exe

sep 12 18:08:08 Henrik-L570 systemd[1]: Started Duplicati web-server.
henrik@Henrik-L570 : ~ $ systemctl stop duplicati
henrik@Henrik-L570 : ~ $ systemctl status duplicati
● duplicati.service - Duplicati web-server
Loaded: loaded (/lib/systemd/system/duplicati.service; disabled; vendor preset: enabled)
Active: inactive (dead)

sep 12 18:08:08 Henrik-L570 systemd[1]: Started Duplicati web-server.
sep 12 19:06:45 Henrik-L570 systemd[1]: Stopping Duplicati web-server…
sep 12 19:06:45 Henrik-L570 systemd[1]: Stopped Duplicati web-server.
henrik@Henrik-L570 : ~ $

Then I booted Ubuntu 20.04:

I opened Terminal and did this:

henrik@henrik-thinkpad-20-04:~$ systemctl enable duplicati
henrik@henrik-thinkpad-20-04:~$ systemctl status duplicati
● duplicati.service - Duplicati web-server
Loaded: loaded (/etc/systemd/system/duplicati.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-09-12 19:14:19 CEST; 27min ago
Main PID: 740 (mono)
Tasks: 13 (limit: 9338)
Memory: 56.3M
CGroup: /system.slice/duplicati.service
├─740 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
└─823 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe

Sep 12 19:14:19 henrik-thinkpad-20-04 systemd[1]: Started Duplicati web-server.
henrik@henrik-thinkpad-20-04:~$ systemctl stop duplicati

Then, outside Terminal, in the file /etc/systemd/system/duplicati.service I added the only line missing, compared to 18.04:
User=henrik

Then, back in Terminal:

henrik@henrik-thinkpad-20-04 : ~ $ systemctl start duplicati
Warning: The unit file, source configuration file or drop-ins of duplicati.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
henrik@henrik-thinkpad-20-04 : ~ $ systemctl daemon-reload
henrik@henrik-thinkpad-20-04 : ~ $ systemctl start duplicati
henrik@henrik-thinkpad-20-04 : ~ $ systemctl enable duplicati
henrik@henrik-thinkpad-20-04 : ~ $ systemctl status duplicati
● duplicati.service - Duplicati web-server
Loaded: loaded (/etc/systemd/system/duplicati.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-09-12 20:27:57 CEST; 1min 17s ago
Main PID: 15356 (mono)
Tasks: 15 (limit: 9338)
Memory: 65.2M
CGroup: /system.slice/duplicati.service
├─15356 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
└─15374 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe

Sep 12 20:27:57 henrik-thinkpad-20-04 systemd[1]: Started Duplicati web-server.
henrik@henrik-thinkpad-20-04 : ~ $ /usr/lib/duplicati/Duplicati.GUI.TrayIcon.exe --server-datafolder=/mnt/4AF15A0435E762B4/Duplicati/
Gtk- Message : 20:51:54.671: Failed to load module “canberra-gtk-module”

But that last command isn’t right. It makes it impossible to close the Terminal without killing the process…

So how do I make Duplicati use the configuration folder (containing the sqlite backup-database) I have copied from the 18.04 partition to the data-partition?

So try this:

DAEMON_OPTS="–server-datafolder=/mnt/4AF15A0435E762B4/Duplicati/"

Have you previously also launched /usr/lib/duplicati/Duplicati.GUI.TrayIcon.exe?
That would get you a second copy of Duplicati, as well as tying up your window.

OK. That seems to work. Thank you!

I edited this line:

DAEMON_OPTS="–server-datafolder=/mnt/4AF15A0435E762B4/Duplicati/"

in the file /etc/default/duplicati with this command in Terminal:

sudo nano /etc/default/duplicati

and restarted Ubuntu.

But the first time it didn’t work, because “–” (2 dash) had become “–” (1 dash)…

THEN I could login and Edit the configuration (turning on scheduled backups again) and under “Database” I had to change the database location too.

So again: Thank you!

PS: It’s a bit confusing that when you start a “repair” it says “Starting backup”…

1 Like

I would like to mark this as solved. Apparently you can only choose ONE message as the solution, but the solution came little by little… :slight_smile: