How to change the local database file location?

Hi,

Thanks to the Duplicati team for developing such a great product and publishing it under a free software license, that’s very cool guys !

  • Context :

I would like to use Duplicati under Windows to automatically perform regular backups on an external hard disk, a bit like Time Machine for Mac users. I would like to use it in case of severe computer failure (main disk dead, laptop broken or lost, whatever) to be able to restore my work environment and files as soon as possible.

TL;DR : On Windows, I try to use Duplicati to automatically backup all the system on an external disk.

  • Problem :

I have created a backup configuration to save all the stuff every day on the local external hard drive G:\duplicati\backup\. But my main disk C:, where Windows is installed, has not much free space.

When I start the backup process, Duplicati’s first action is to create a database on all the files to back up and to store it in a file named dub[SOMETHING] and located in C:\Users\myname\AppData\Local\Temp. This file is growing bigger and bigger until all the space on the C: disk is out and the process exits, failing but not removing the file of dozens of gigabytes in the Temp folder.

I attempted to play with the options, in particular I have tried to set dbpath to point to another path also in the G:external disk (G:\duplicati\db\localdb.sqlite), but it does not seem to do the job and I still have this file growing in C: and eventually using all the free space.

TL:DR : I cannot find how to change the default path of the file that Duplicati creates in C:\Users\myname\AppData\Local\Temp.

  • Questions :
  1. Is there a way to change the default path of the file created by Duplicati in C:\Users\myname\AppData\Local\Temp ?
  2. Any other advice on how to proceed ?

Thank you by advance !

There are a number of options to change default locations in Duplicati, depending on your needs:

  • Start Duplicati.Server.exe of the Tray Icon with command line option --server-datafolder. Duplicati will stora all local databases and configuration files in the specified folder.
  • Use advanced option --dbpath if you want to use a local database that is not stored in the default folder.
  • Use advanced option --tempdir to change the location for storing temporary files. However, this is only for temporary files used by Duplicati. SQLite will keep using the default %temp% folder. If you want to change the location for SQLite also, change the TEMP environment variable to the location of your choice.
2 Likes

I must admit, I’ve wondered if it might not make sense to offer a “move database” option in the GUI.

I assume it would simply need to move the file and add / update the --dbpath parameter in the backup job config…

I’m an idiot and totally forgot about the “Move existing database” button in “Advanced: Database”!!!

Just edit the destination path (or file name, as I’ve done here) and the “Reset”, “Save”, “Save and repair”, and “Move existing database” buttons will activate (turn blue) and be clickable.

For those that might care, the potential “normal” Windows locations for these sqlite files include the following (varying based on windows setup and Duplicati run type / parameters):

  • C:\Users\[user]\AppData\Local\Duplicati (Windows normal install)
  • C:\Users\[user]\AppData\Roaming\Duplicati (Windows with roaming enabled)
  • C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati (service running as Local System Account)
  • C:\Program Files\Duplicati 2\data (portable mode)

On Linux & MacOS “normal” locations would include:

  • /[user]/.config/Duplicati aka ~/.config/Duplicati (user / tray-icon mode)
  • /root/.config/Duplicati (service / daemon mode)
4 Likes

Seems the path I was looking for was --tempdir indeed !

It was configured to C:\Users\myname\AppData\Local\Temp and I could change it to a folder on G:. It is now running and things seem to go fine as far as I can tell.

Thanks for the answer @kees-z ! And +1 @JonMikelV, I at least would have found it very useful to be able to access to (and modify more easily) these 2 paths (dbpath and tempdir) in the GUI.

1 Like

I went to the UI database menu and check that the ‘move database’ option is disabled while a backup job is running. I guess I will have to wait 20days for this backup to finish before I can think on speed improvements…:roll_eyes:

You should be able to pause or stop the backup, move the database file, then continue the backup without causing any issues.

pausing didn’t help. will keep waiting…