I recently had to reinstall Windows 10 as my system was getting bloated with extra stuff. I wanted to set it up like it was before the reinstall, with all the data files in the same location and my backup jobs copied back and everything set up in Duplicati the way it was (including Duplicati settings). I decided to record the process, since I wasn’t able to find a similar guide online for the next time I need to do this as well as for the benefit of anyone else needing a similar set of instructions. The general process is this: (1) Copy out your Duplicati folder, (2) Reinstall Windows, (3) Reinstall Duplicati, (4) Copy the folder back. Of course, there’s a lot of smaller details that are needed to get things to work, so follow the steps below.
On the old Windows installation (which I reproduced on the new installation)…
- Duplicati was running successfully for six months as a Windows service.
- My Duplicati install uses VSS for creating shadow copies. I love this feature.
- The DUPLICATI_HOME Windows system variable was set to
- The tempdir option in Duplicati > Settings was set to
- The usn-policy option in Duplicati > Settings was set to “Required”.
- The backup jobs have their log-file option was set to
Here are the steps I followed:
- Note the version of Duplicati you are running on the old installation and download the installer for that version to an external drive. It’s good to know in advance if you’re not going to be able to find the exact same version when you go to reinstall, so do that before doing anything else. If that version is no longer available, be sure to update your old Duplicati installation to the newest version first and ensure that it is running correctly. Download the installer for that version to an external drive.
- Change the settings of your backup jobs to start their next backup sometime in the next week. If your rebuild takes a while, changing the start date of the next backup will keep the jobs from attempting to execute the moment you fire up your new Duplicati install on the rebuilt system.
- Shut down the Duplicati service and disable automatic start.
- Copy the entire DUPLICATI_HOME directory to an external drive.
- Copy all data files to the external drive, too, noting their original location (e.g.,
D:\Photos). After the reinstall is complete, you’ll need to copy the data back from the external drives to those exact same locations (or else modify your Duplicati jobs to point to a new location).
- Format the system and reinstall Windows.
- On the freshly reinstalled system, put the data files back in the same locations that they were in before the drive was formatted. Don’t delete the data from the external drive until the new install is running well, just in case you need to repeat this process for some reason.
- Add a “DUPLICATI_HOME” System environment variable in Windows for
C:\ProgramData\Duplicati(or whatever you are deciding to use—as discussed above, I chose to use this location).
- Reinstall Duplicati from the installer you downloaded in step 1, but in the installer options do not select to launch it.
- Remove the Duplicati shortcut from the startup folder (
C:\ProgramData\Microsoft\Windows\Start Menu\Programs) and put it on your Desktop.
- Drop to DOS and navigate to the Duplicati program directory (e.g.,
C:\Program Files\Duplicati 2) and execute "duplicati.WindowsService.exe install” to install the Windows service.
- Start and stop the service, which should result in the creation of the
C:\ProgramData\Duplicatidirectory. The general structure of that new directory should match the Duplicati folder you copied out to your external drive before this process began.
- Replace the newly created
C:\ProgramData\Duplicatifolder with the Duplicati folder that you saved to the external drive before formatting the computer.
- To enable Shadow Copies, install the Microsoft Visual C++ 2019 Redistributable from https://aka.ms/vs/16/release/VC_redist.x64.exe (linked from https://www.itechtics.com/microsoft-visual-c-redistributable-versions-direct-download-links/).
- Reboot the computer.
- Ensure the Duplicati service is running upon reboot.
- Modify the Duplicati shortcut to be
"C:\Program Files\Duplicati 2\Duplicati.GUI.TrayIcon.exe" --no-hosted-server --read-config-from-db(–no-hosted-server keeps the tray icon from hosting its own instance of the Duplicati server, which is neither necessary nor desirable as you are already running Duplicati as a Windows service).
- Put the modified Duplicati shortcut back in the
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup folderand also copy it over the one that is in
- Launch Duplicati Tray Icon using this modified shortcut, click it, and chose “Open” to launch the GUI.
- In the Duplicati web GUI, the instance should be configured the way it was before the system rebuild, with your backup jobs in place and all of your Duplicati settings just as they were before the system rebuild.
- Go into each backup job and Advanced > Database… > Repair. (In my case, the Repairs took about 40 minutes for two backups of 300 GB each, one of which was backing up to a NAS on my local network and the other of which was backing up to a remote server over a 80Mbps up/30Mbps down connection–as you can tell, my local NAS is old school and is crazy slow. My Repair for the backup I was making to the remote server had to deal with a missing volume but successfully repaired it.)
- Run both backup jobs to ensure things are working normally. If you’re using USN, these backup jobs should be very quick, since the Rebuild process executes a backup. (In my case, executing backup jobs shortly after the Rebuilds resulted in job runs of only about three minutes, as no files had changed since the Rebuild was run.)
- Modify the start date for the next backup job.
- Back to work!