[Solved] Backing up config files


Recommended Posts


Over the last month, I've had a lot of trouble with BTSync and had to reinstall several times. Each time I've done this, I have lost all the config options (mainly the shares). I'm now on the official debian version, but am confused which config files I should back-up.

I want to get to the stage where I can install BTSync on a freshly formatted device, restore a config, and all the old settings and shares are there and working.

Can anyone advise which folders and files are essential to be backed-up to make this happen?



Link to comment
Share on other sites

Hi Roman,

Thanks. Option 2 makes more sense I think. So I took a look at the config and have tried to populate "Shared folders section" without luck.

I've used the key for a shared folder from another BTSync instance on another device. Is this correct? When I run BTsync, the folder isn't appearing, so I've obviously done something wrong and I'm sure it's to do with the key.

The docs for shared folders in configs is a bit sparse, so would love your help if you get time




Link to comment
Share on other sites

Hi Helen,

I've managed to sort it, thanks. Here are my findings for backing things up on debian / raspberry pi.


Webui and shared folders can't work together, so you can't monitor things in the web interface. To add a shared folder, you need a key which you can generate - then just use this key on other devices. Save the config file with a unique name so it isn't automatically over-written, and make a backup of it in a completely separate folder which isn't touched. Keep it safe!

To run this config using systemd, create a new service file. This is mine. Save and overwrite it in /lib/systemd/system/btsync.service

Description=BitTorrent Sync service

ExecStartPre=/bin/mkdir -p /var/run/btsync
ExecStartPre=/bin/chown -R pi:pi /var/run/btsync
ExecStart=/usr/bin/btsync --config /home/pi/.config/btsync/config2.json

I'm running it as pi instead of btsync in order to preserve permissions.

When you upgrade btsync, all your settings are overwritten - including /lib/systemd/system/btsync.service. So, once you've installed btsync or upgraded, run a script to restore your backups:

sudo systemctl stop btsync.service
sleep 2
sudo rm /lib/systemd/system/btsync.service
sudo cp /home/pi/btsyncconfig/btsync.service /lib/systemd/system/btsync.service
sudo systemctl daemon-reload
sudo systemctl start btsync.service

This will run btsync using my backed-up config and all the old shares are still there.

Hope this helps someone


Edited by w82
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.