# Migrating from User to Service install on Windows

**URL:** https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660
**Category:** How-To
**Created:** [September 16, 2017, 4:18am UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660 "2017-09-16T04:18:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 16, 2017, 4:18am UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/1 "2017-09-16T04:18:54Z")

</div>

Thanks to @martijnsmith for giving me the boost needed to “how-to” this!

> [@Migrating to Windows Service Installation](https://forum.duplicati.com/t/migrating-to-windows-service-installation/433):
>
> So i started with a standard install of Duplicati on a Windows machine, and then decided i wanted to run it as a service instead. So i did the “Duplicati.WindowService.exe install” and made the tray icon “Duplicati.GUI.TrayIcon.exe --no-hosted-server”. Opened Duplicati and previous completed backup wasn’t there. So i imported the backup from a saved Config file. Is this the correct process or do i need to do something else with the Database? I decided to start another Backup and now its showing …

If you want to run Duplicati as a Windows service instead of under a specific user account OR maybe you find that you keep getting errors such as the following, it could be that you’re running Duplicati under a user install for a non-administrator user.

`System.UnauthorizedAccessException: Access to the path '<path>' is denied.`

* * *

Firstly, congratulations on not doing everyday work as an administrator! 🙂

* * *

Secondly, disclaimers - running Duplicati under an elevated account (such as “Run as administrator” or as a system account service) gives it access to parts of the system most users can’t normally get to - including other user’s folders!

This means that anybody with access to the backup could be able to see AND RESTORE folder & file listings of other users. If that’s not an issue for you, then great - forge ahead!

* * *

Thirdly, you can likely resolve this issue in a few different ways, including:

1. Run Duplicati as a service (the official way)
2. Install and run Duplicati under an administrator account
3. Update the Duplicati.GUI.TrayIcon.exe shortcut in your Startup folder to “Run this program as an administrator” (under the Compatibility tab of Properties)

* * *

See also

- [v2](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/38) - uses “Move existing database”
- [v3](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/46) - solves the windows update/upgrade problem of deleting `C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati`

(I, @johnvk, am hesitant to just update these instructions, so I provided links to other versions.)

**Here we’re going to go over method #1.**

1. Stop the tray icon if you currently have it running
2. Move the following from the “Src:” folder to the “Dst:” folder as shown bellow (use the “Prt:” folder if currently running in `--portable-mode`). Note that you may be prompted to give yourself access to the second folder:  
Src: `C:\Users\ [your user name]\AppData\Roaming\Duplicati` (Alternatively replace Roaming with Local.)  
Dst: `C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati`  
(Prt: `C:\Program Files\Duplicati 2\Data`)
3. Open a command prompt as an administrator (right click and select “Run as administrator”) and run `Duplicati.WindowService.exe install` in your Duplicati install folder (likely `"C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" install`)
4. If you get the “Installation has completed” message, you can start the service with `sc start Duplicati` (or use a Windows Service GUI, your choice)  
But if you get an error such as the following then you probably didn’t open your command prompt as an authorized administrator, try again  
`System.UnauthorizedAccessException: Access to the path 'C:\Program Files\Duplicati 2\Duplicati.WindowsService.InstallState' is denied.`
5. Once the service has been started go ahead and close the command prompt window (we’re done with it now)
6. Open a browser window and go to [http://localhost:8200](http://localhost:8200) to make sure the service is working and found your existing settings (if that fails but [http://localhost:8300](http://localhost:8300) works, then you may have forgotten to stop the tray icon)
7. The Tray icon is no longer needed so you can remove Duplicati from your Startup programs. However, if you like having the icon around then be sure to update the properties of any shortcuts to it (such as in the Startup folder) to include `--no-hosted-server` parameter as part of the Target field (this tells the Tray Icon to connect to the service instead of starting it’s own instance).

There you’re done! Duplicati should now run when the machine starts up whether or not a user is actually logged on.

A few final notes:

1. If you are using “User data” folders (or %my\_documents%, %desktop%, etc.) in your Source note that these are dynamic and will change depending on the user account under which Duplicati is running, so if you set up these sources while logged in as “you” then change to the service you’ll get backups of the SERVICE account “My Documents”, “Desktop”, etc. To get around this, use full “Computer” paths (they should start with drive letters, “//”, or “\”).

2. An issue was found with the service based Duplicati with Minio:  
[Launch every night - #3](https://forum.duplicati.com/t/windows-service-minio-with-ssl-error/52/4)

3. To REMOVE the Duplicati service (not just turn it off) you run `Duplicati.WindowsService.exe uninstall` in your Duplicati install folder (so most likely something like `"C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" uninstall`.

4. If you experience errors like this one: [Found 240 remote files that are not recorded in local storage, please run repair](https://forum.duplicati.com/t/found-240-remote-files-that-are-not-recorded-in-local-storage-please-run-repair/818) it is likely that your backup databases are not moved properly. To fix this go to the “Database …” menu under Advanced settings per backup job. There you will find an option to change the “Local database path” to your new Duplicati folder, the Dst-folder from step 2. Be careful if you have already moved the backup database files, so that you do not overwrite the proper ones.

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 19, 2017, 4:19am UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/2 "2017-09-19T04:19:16Z")

</div>

See also this video (which is about installing rather than migrating):

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 25, 2017, 10:53pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/4 "2017-09-25T22:53:51Z")

</div>

> [@JonMikelV](#):
>
> The Tray icon is no longer needed so you can remove Duplicati from your Startup programs. However, if you like having the icon around then update the properties of any shortcuts to it (such as in the Startup folder) to include --no-hosted-server parameter as part of the Target field  
> If you like having the tray icon around then update the properties of any shortcuts (such as in the Startup folder) to it to include the --no-hosted-server parameter as part of the Target field, however the tray is no longer needed for backups to run so feel free to remove it from the Startup list

This is double, isn’t it?

I was going to ask: what exactly does `--no-hosted-server` do, but diligent a user that I am I first tried to find the answer myself and found it [here](https://www.duplicati.com/articles/Way-To-Make-A-Backup/):

`--no-hosted-server` to instructs `Duplicati.GUI.TrayIcon.exe` that it should not start the server itself, but connect to an already running instance.

In any case, your instructions worked perfectly for me. Thanks for putting them together. Probably saved me tons of time!

The only two points where I had to think twice was in step 2 where I initially wondered: “move _what_ from src to dst?” And the other one was in step 7 where I wondered whether the attribute should be inside or outside the `""`, but I tried outside and it seems to work fine. 😄

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 25, 2017, 11:08pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/5 "2017-09-25T23:08:59Z")

</div>

Glad it worked for you!

And thanks for the tips - I’ve removed the duplicate step and tried to add some clarification to steps 2 and 3.

I have a feeling step 2 may get a little more complicated as I think there might be yet another potential location where the files could be, but I haven’t confirmed it yet (it might only be used in the latest canary).

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 25, 2017, 11:42pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/6 "2017-09-25T23:42:01Z")

</div>

Is it normal that duplicati still creates `.sqlite` and `.backup` files in `C:\Users\Username\AppData\Roaming\Duplicati` even when I switched to service? Cause that is what I’m seeing right now.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 25, 2017, 11:50pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/7 "2017-09-25T23:50:00Z")

</div>

I haven’t checked that yet but I suspect it might be “normal” if not “desired”.

If you look at “Advanced options” on the “Commandline…” page does your `dbpath` setting show the tray based or service based location?

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 26, 2017, 7:08am UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/8 "2017-09-26T07:08:03Z")

</div>

> [@JonMikelV](#):
>
> does your dbpath setting show the tray based or service based location?

Well spotted! It’s still the old path there. I suppose changing that path should be step 3 of the tutorial?

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 26, 2017, 2:56pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/9 "2017-09-26T14:56:56Z")

</div>

> [@tophee](#):
>
> I suppose changing that path should be step 3 of the tutorial?

Erm, well - I tried that but in my testing it didn’t “take”. For what I was doing it didn’t cause me any issues so just ignored it.

Here’s what was said about it in a few other topics…

> [@Changed dbpath not reflected in Commandline?](https://forum.duplicati.com/t/changed-dbpath-not-reflected-in-commandline/662/2):
>
> Since you mention “Commandline GUI under Advanced Options”, I should mention that the value in “Advanced Options” is ignored

> [@Stuck on "Starting …"](https://forum.duplicati.com/t/stuck-on-starting/429/13):
>
> Internally, the database path is stored in one place, and options in another. As many operations from the WebUI needs access to the database, it made sense to just hide the database things from the users.
> 
> I have been planning to fix this a bit by adding some logic that checks if the user has changed the --dbpath option and ask them how to handle it, but for now it is a bit obscure.

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 26, 2017, 3:34pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/10 "2017-09-26T15:34:57Z")

</div>

Okay, I see. I guess this one is quite relevant:

> [@Changed dbpath not reflected in Commandline?](https://forum.duplicati.com/t/changed-dbpath-not-reflected-in-commandline/662/2):
>
> Since you mention “Commandline GUI under Advanced Options”, I should mention that the value in “Advanced Options” is ignored:

Which explains why

> [@JonMikelV](#):
>
> Erm, well - I tried that but in my testing it didn’t “take”.

But, in if the database path stays the same after moving to duplicati as a service, why are you telling people to move the database?

> [@Found 240 remote files that are not recorded in local storage, please run repair](https://forum.duplicati.com/t/found-240-remote-files-that-are-not-recorded-in-local-storage-please-run-repair/818/5):
>
> when I moved to duplicati as a service, it could no longer find the database file because it was still looking for it in the old location (under %appdata%). It’s as simple as that!

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 26, 2017, 3:40pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/11 "2017-09-26T15:40:22Z")

</div>

> [@tophee](#):
>
> why are you telling people to move the database

Good question - I put it in there because that’s where the database landed for me on a straight up service install, so rather than having a half-here-half-there setup I was hope to replicate what would have happened if they installed as a service from the start.

Secondarily, leaving the dbpath under a particular user’s account MIGHT end up running into permissions issues depending what credentials the service ends up running under.

But it is perfectly valid to leave the “Duplicati” folder where it is and add the appropriate parameter (I think there is one but I forget what it is) to the service startup so that it knows where to find the dbconfig.json and .sqlite files.

---

<div class="post-metadata">

### Author: ![sanderson](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanderson](https://forum.duplicati.com/u/sanderson)
#### Post date: [September 26, 2017, 11:47pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/12 "2017-09-26T23:47:00Z")

</div>

My first install I did a normal install and later converted it to a service (running as SYSTEM). I had to move the .sqlite database files manually from under my user profile AppData directory to C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati. Starting up without moving the config database acted like a clean install with zero knowledge of my existing settings or backup jobs.

Since then I’ve just been installing as a service initially without performing a normal install first.

I personally would prefer Duplicati to use c:\ProgramData\Duplicati when running as a service instead of …systemprofile\AppData. It seems a little cleaner in my mind and more in line with what I see most applications doing, but it doesn’t really matter. I could always move it if it really bugged me 🙂

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 26, 2017, 11:59pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/13 "2017-09-26T23:59:14Z")

</div>

> [@sanderson](#):
>
> I personally would prefer Duplicati to use c:\ProgramData\Duplicati when running as a service

I haven’t tested this yet but I believe if you add `--protable-mode` to the service startup parameters it will indeed use the folder you mentioned.

---

<div class="post-metadata">

### Author: ![kees-z](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kees-z/32/29_2.png) [@kees-z](https://forum.duplicati.com/u/kees-z)
#### Post date: [September 27, 2017, 7:55am UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/14 "2017-09-27T07:55:32Z")

</div>

> [@JonMikelV](#):
>
> I haven’t tested this yet but I believe if you add `--protable-mode` to the service startup parameters it will indeed use the folder you mentioned.

`--portable-mode` stores all settings, backup configurations and local databases in a folder Data, located under the program folder.  
If Duplicati is installed in C:\Program Files\Duplicati 2, `--portable-mode` will store everything in C:\Program Files\Duplicati 2\Data.

> [@sanderson](#):
>
> I personally would prefer Duplicati to use c:\ProgramData\Duplicati when running as a service instead of …systemprofile\AppData

There’s a discussion about something similar here:

> <https://github.com/duplicati/duplicati/issues/2222>
>
> I have:
> \- \[x\] searched open and closed issues for duplicates
> 
> \---------------…-------------------------
> 
> \### Version info
> 
> \*\*Duplicati Version:\*\* 2.0.1.32\_canary\_2016-11-12
> \*\*Operating System:\*\* Windows 7 64
> \*\*Backend:\*\* file
> 
> \### Bug description
> Windows roaming profile becomes large after longer usage of Duplicati. Login on computers that are part of a domain takes a long time due to the large profile. This is caused due to the files \`BIMOMVVWCK.sqlite\` (400 MB) and \`GBGIAIXHXI.sqlite\` (100 MB) in the folder \`C:\\Users\\username\\AppData\\Roaming\\Duplicati\`.
> 
> 
> \### Steps to reproduce
> \- use current version of Duplicati on a Windows computer that is part of a domain network
> \- backup files for several weeks
> 
> \*\*Actual result:\*\* Roaming profile increases in size, increased network traffic, long login delays
> \*\*Expected result:\*\* Duplicati SQL database should not be part of the roaming profile. It belongs to the local machine. It should therefore be stored in \`C:\\Users\\username\\AppData\\Local\\Duplicati\` instead.
> 
> 
> 
> \<bountysource-plugin\>
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/40561569-duplicati-creates-large-files-in-the-roaming-part-of-the-user-profile-on-windows?utm\_campaign=plugin&utm\_content=tracker%2F4870652&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F4870652&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [September 27, 2017, 8:03pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/15 "2017-09-27T20:03:19Z")

</div>

> [@sanderson](#):
>
> I personally would prefer Duplicati to use c:\ProgramData\Duplicati when running as a service instead of …systemprofile\AppData. It seems a little cleaner in my mind and more in line with what I see most applications doing, but it doesn’t really matter. I could always move it if it really bugged me 🙂

You can set the environment variable `DUPLICATI_HOME=C:\ProgramData\Duplicati` and it will stop using `%LOCALAPPDATA%Duplicati`.

---

<div class="post-metadata">

### Author: ![teknolai](https://forum.duplicati.com/user_avatar/forum.duplicati.com/teknolai/32/137_2.png) [@teknolai](https://forum.duplicati.com/u/teknolai)
#### Post date: [February 12, 2018, 9:31pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/16 "2018-02-12T21:31:59Z")

</div>

> [@tophee](#):
>
> But, in if the database path stays the same after moving to duplicati as a service, why are you telling people to move the database?
> 
> Found 240 remote files that are not recorded in local storage, please run repair
> 
> when I moved to duplicati as a service, it could no longer find the database file because it was still looking for it in the old location (under %appdata%). It’s as simple as that!

Thanks for a great migration guide. Unfortunately I’m stuck with the same error as @tophee is describing.

Is there a way to migrate my backup-db to the “systemprofile”-folder, so that I don’t have to start my backup over again?

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [February 13, 2018, 1:23pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/17 "2018-02-13T13:23:24Z")

</div>

> [@teknolai](#):
>
> Is there a way to migrate my backup-db to the “systemprofile”-folder

Sure, but I’m not sure which error (“remote files” or “missing database”) you mean when you say you have the same error as tophee.

---

<div class="post-metadata">

### Author: ![teknolai](https://forum.duplicati.com/user_avatar/forum.duplicati.com/teknolai/32/137_2.png) [@teknolai](https://forum.duplicati.com/u/teknolai)
#### Post date: [February 13, 2018, 3:09pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/18 "2018-02-13T15:09:34Z")

</div>

Sorry for not being more precise.

I get the “Found xx remote files that are not recorded, please run repair” error, because the backup-job database is not moved. So instead of reading the sqlite file per backup-job from “systemprofile”-folder, it continues to read from my local user folder instead. (And when I moved the sqlite-files, it recreates empty ones.)

So my question is what steps are necessary to migrate the backup-sqlite files? 🙂

Thanks!

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [February 13, 2018, 3:22pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/19 "2018-02-13T15:22:31Z")

</div>

> [@teknolai](#):
>
> what steps are necessary to migrate the backup-sqlite files

Got it!

You options at this point include:

1. Run the repair which will rebuild the database based on what’s in those “xx remote files” (though this can take a while depending on your backup size)
2. Point your service job to the existing database location (not recommended as it could be lead to confusion as to what’s stored where)
3. Move (or copy) the existing database to the new location and point the service job to it
4. Move (or copy) the existing database to the new location and rename it to match what the service job is already looking for

For 2-3 you’d want to use the job “Database …” menu. In there you can put the actual path to your database in the the “Local database path” field.

Most likely, the folder you want the database to live in will be:

- `C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati` (unless you’re using the portable mode parameter)

---

<div class="post-metadata">

### Author: ![teknolai](https://forum.duplicati.com/user_avatar/forum.duplicati.com/teknolai/32/137_2.png) [@teknolai](https://forum.duplicati.com/u/teknolai)
#### Post date: [February 17, 2018, 4:36pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/20 "2018-02-17T16:36:42Z")

</div>

> [@JonMikelV](#):
>
> Move (or copy) the existing database to the new location and point the service job to it  
> Move (or copy) the existing database to the new location and rename it to match what the service job is already looking for
> 
> For 2-3 you’d want to use the job “Database …” menu. In there you can put the actual path to your database in the the “Local database path” field.

Thanks a bunch! The “Database…” menu was exactly what I was missing. It also allowed me to move the database.

So maybe I could suggest an update in the migration guide, to move all the backup database-files with the “Move existing database” button? It did at least do the trick for me.

Thank you for your help! 😄

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [February 17, 2018, 7:24pm UTC](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660/21 "2018-02-17T19:24:36Z")

</div>

> [@teknolai](#):
>
> maybe I could suggest an update in the migration guide, to move all the backup database-files with the “Move existing database” button

Good idea! I went ahead and made the first post a Wiki so feel free to update it based on your own recent experience! 😃

[Next page](https://forum.duplicati.com/t/migrating-from-user-to-service-install-on-windows/660.md?page=2)
