# How to move the config & database?

**URL:** https://forum.syncthing.net/t/how-to-move-the-config-database/19819
**Category:** Support
**Created:** [February 18, 2023, 8:26am UTC](https://forum.syncthing.net/t/how-to-move-the-config-database/19819 "2023-02-18T08:26:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![InteXX](https://forum.syncthing.net/user_avatar/forum.syncthing.net/intexx/32/9963_2.png) [@InteXX](https://forum.syncthing.net/u/InteXX)
#### Post date: [February 18, 2023, 8:26am UTC](https://forum.syncthing.net/t/how-to-move-the-config-database/19819/1 "2023-02-18T08:26:29Z")

</div>

I’m attempting to move Syncthing’s configuration and database to an external USB drive, as advised [here](https://forum.syncthing.net/t/devices-seem-to-not-be-syncing/19799/15).

Here’s the original `home` path from my service config:

```plaintext
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/home/admin/.config/syncthing

```

…and here’s what I changed it to, after running `sudo rsync -r /home/admin/.config /media/pi/Elements`:

```plaintext
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/media/pi/Elements/.config/syncthing

```

Here’s what `systemctl status` reports:

```plaintext
pi@OFFSITE:/media/pi/Elements $ sudo systemctl status syncthing@admin.service
* syncthing@admin.service - Syncthing service for admin
     Loaded: loaded (/etc/systemd/system/syncthing@admin.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/syncthing@admin.service.d
             `-override.conf
     Active: failed (Result: exit-code) since Fri 2023-02-17 17:35:29 AKST; 1min 57s ago
    Process: 64338 ExecStartPre=/home/pi/Documents/Scripts/mount-sync-drive.sh (code=exited, status=0/SUCCESS)
    Process: 64340 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/media/pi/Elements/.config/syncthing (code=exited, status=1/FAILURE)
   Main PID: 64340 (code=exited, status=1/FAILURE)
        CPU: 74ms

Feb 17 17:35:29 OFFSITE systemd[1]: Starting Syncthing service for admin...
Feb 17 17:35:29 OFFSITE systemd[1]: Started Syncthing service for admin.
Feb 17 17:35:29 OFFSITE syncthing[64340]: WARNING: Failure on home directory: mkdir /media/pi/Elements/.config/syncthing: permission denied
Feb 17 17:35:29 OFFSITE systemd[1]: syncthing@admin.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 17:35:29 OFFSITE systemd[1]: syncthing@admin.service: Failed with result 'exit-code'.

```

I’m not sure why it’s trying to create that `syncthing` directory, as the directory already exists. I’ve verified such manually, as well as checked its permissions against the original.

Clearly I’ve missed something here, but I’m not spotting what it is.

Any suggestions?

---

<div class="post-metadata">

### Author: ![bt90](https://forum.syncthing.net/user_avatar/forum.syncthing.net/bt90/32/18565_2.png) [@bt90](https://forum.syncthing.net/u/bt90)
#### Post date: [February 18, 2023, 8:50am UTC](https://forum.syncthing.net/t/how-to-move-the-config-database/19819/2 "2023-02-18T08:50:03Z")

</div>

Could you post the output of `ls -lah` for that directory?

---

<div class="post-metadata">

### Author: ![InteXX](https://forum.syncthing.net/user_avatar/forum.syncthing.net/intexx/32/9963_2.png) [@InteXX](https://forum.syncthing.net/u/InteXX)
#### Post date: [February 18, 2023, 1:19pm UTC](https://forum.syncthing.net/t/how-to-move-the-config-database/19819/3 "2023-02-18T13:19:06Z")

</div>

That was it, thank you!

`owner:group` was set to `root` on the hierarchy, presumably because I’d run `rsync` under `sudo`. (Not sure how I missed that earlier.)

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [March 20, 2023, 1:19pm UTC](https://forum.syncthing.net/t/how-to-move-the-config-database/19819/4 "2023-03-20T13:19:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
