Foolishly relocated .exe - how can I reload config / restore ID?

Hi! Syncthing is wonderful, and I thank you all for your creativity. I’m afraid this is a desperately newbie query from an ordinary consumer, rather than a coding pro, but I’ll hope my cluelessness will prove useful to others in the long run… Installing syncthing on Windows 8.1, I located files in a messy way, with syncthing.exe in Program Files/Syncthing/syncthing-windows-amd64-v0.10.27/
I thought (better?) of this after tweaks including following instructions for non-GUI autostart (using NSSM), which had me put syncthing.bat in Program Files/Syncthing
So I moved sycthing.exe up a folder to Program Files/Syncthing, too, editing NSSM etc to make syncthing.exe run from the new location. However, when I called up the GUI, it showed none of the old repositories or the connection to my other computer (an Acer Aspire running Syncthing on Linux Mint, btw). The GUI showed a new ID #. It was as if I had reinstalled Syncthing. Looking into the config.xml in AppData/Local/Syncthing, I see folder IDs for the repositories and device ID for the Acer. The Windows machine was the one I set up first, from which I sent the connection to the Linux machine. I would prefer to keep it that way, IF that priority matters (once the folders have been shared between devices that are both authorized to read/write/create/delete). It seems that I could a) start over from the new, “blank” ID on the Windows GUI, sending another “Add Device” connection to the Acer, or b) discover (with your help) how to recover and reactivate the ID and configuration still recorded in config.xml. Many thanks for your assistance, and again, many thanks for Syncthing, which is infinitely preferable to copy.com / dropbox / drive etc and even to BTSync for my purposes.

I think NSSM makes it run under a different user account, hence it uses a different config.xml located under the service user. I think service users home folder it’s actually somewhere in C:\Windows\System32, hence look for config.xml somewhere there, and replace it (together with the other files).

1 Like

Thank you, AudriusButkevicius! It’s very kind of you to answer, and so quickly! I’ll try to make sure I understand: a) The config.xml I have in the C:\Users\William\AppData\Local\Syncthing folder is the one created by my original install and configuration, with the repositories/device connections I created etc. This is confirmed when I open it. Let’s call it Config #1. b) The config.xml I have found in Windows/System32/config/systemprofile/AppData/Local/Syncthing was put there by NSSM. When I open it, I see it has the ID I find in the new, no-repositories/device connections GUI. Let’s call it Config #2. c) If I want to continue to use the NSSM-enabled autostart and set-up, but revert to my old ID and the repositories/device connections of Config #1, I should copy Config #1 AND all the other files and the folder in \Users\William\AppData\Local\Syncthing, which are (in addition to Config #1) cert.pem config.xml.v9 csrftokens.txt https-cert.pem https-key.pem key.pem syncthing.log and the folder index (which contains 29 more files) to Windows/System32/config/systemprofile/AppData/Local/Syncthing, replacing Config #2 and all the other files AND the index folder there? If that is correct, I’ll do it right away and let you know how it works. Thanks!

Yes, you have to replace all the files from your home directory with the ones in the service users home directory.

Oh dear. I’m afraid it didn’t work. I copied all the files from C:\Users\William\AppData\Local\Syncthing to Windows/System32/config/systemprofile/AppData/Local/Syncthing and the GUI appears blanked of all particulars. Instead of the name of the computer, it shows (unknown device) and when I pull down the gear icon to Show ID, the field is blank. The Settings opens no window at all.

If I try to restart, it hangs forever on the “Please wait…” notice.

Perhaps I do have to reinstall and start over?

Sometimes it’s just slow to start. Check perhaps there are some errors in the javascript log.

I’m afraid I don’t know how to check for errors in the javascript log. Rebooting and trying again this morning, I get only “Problem loading page” and "Firefox can’t establish a connection to the server at localhost:8080." I replaced the log in the #2 config folder with the log from the #1 folder. Now I see that the content of that log (created days ago) reads:

[R4GNC] 09:32:30 INFO: syncthing v0.10.29 (go1.4.2 windows-amd64 default) unknown-user@syncthing-builder 2015-03-22 14:09:14 UTC [R4GNC] 09:32:30 INFO: My ID: R4GNCA3-UMCDDKN-62HT6B3-7HXJQBE-NPQYBG3-HJIHRLQ-BBZV4T2-4LQT5AJ [R4GNC] 09:32:30 FATAL: Cannot open database: leveldb/storage: corrupted or incomplete CURRENT file - Is another copy of Syncthing already running? [R4GNC] 09:32:31 INFO: syncthing v0.10.29 (go1.4.2 windows-amd64 default) unknown-user@syncthing-builder 2015-03-22 14:09:14 UTC [R4GNC] 09:32:31 INFO: My ID: R4GNCA3-UMCDDKN-62HT6B3-7HXJQBE-NPQYBG3-HJIHRLQ-BBZV4T2-4LQT5AJ [R4GNC] 09:32:31 FATAL: Cannot open database: leveldb/storage: corrupted or incomplete CURRENT file - Is another copy of Syncthing already running? [R4GNC] 09:32:33 INFO: syncthing v0.10.29 (go1.4.2 windows-amd64 default) unknown-user@syncthing-builder 2015-03-22 14:09:14 UTC [R4GNC] 09:32:33 INFO: My ID: R4GNCA3-UMCDDKN-62HT6B3-7HXJQBE-NPQYBG3-HJIHRLQ-BBZV4T2-4LQT5AJ [R4GNC] 09:32:33 FATAL: Cannot open database: leveldb/storage: corrupted or incomplete CURRENT file - Is another copy of Syncthing already running? [R4GNC] 09:32:35 INFO: syncthing v0.10.29 (go1.4.2 windows-amd64 default) unknown-user@syncthing-builder 2015-03-22 14:09:14 UTC [R4GNC] 09:32:35 INFO: My ID: R4GNCA3-UMCDDKN-62HT6B3-7HXJQBE-NPQYBG3-HJIHRLQ-BBZV4T2-4LQT5AJ [R4GNC] 09:32:35 FATAL: Cannot open database: leveldb/storage: corrupted or incomplete CURRENT file - Is another copy of Syncthing already running?

I did NOT retain the content of the .log that had been in the folder with Config #2. Can I erase the content in the javascript .log I have? Will the program start without it? Or can I edit it and erase everything after [R4GNC] 09:32:30 INFO: syncthing v0.10.29 (go1.4.2 windows-amd64 default) unknown-user@syncthing-builder 2015-03-22 14:09:14 UTC [R4GNC] 09:32:30 INFO: My ID: R4GNCA3-UMCDDKN-62HT6B3-7HXJQBE-NPQYBG3-HJIHRLQ-BBZV4T2-4LQT5AJ and before the first FATAL?

Sorry to keep asking clueless questions!

It seems whatever you copied is corrupt/not copied in full. You can try removing the index folder and letting it reindex your files.

Wow! A few hours back, I took a chance and edited the syncthing.log, removing all but the first two lines (ending in the device ID) and cutting away all the FATAL error messages. But that didn’t seem to do anything. However, I just took your advice, and deleted the index folder in Windows/System32/config/systemprofile/AppData/Local/Syncthing which seemed not to work, as Windows instantly replaced it. I must note here that I did not look into that folder before I deleted it; I assumed it held the same old 29 files I’d transferred there from the Windows/System32/config/systemprofile/AppData/Local/Syncthing index folder. Perhaps it did. But the index folder which Windows immediately caused to appear after I deleted it did NOT have all those files. And when I opened the Syncthing GUI, there was my old ID, with old repositories and connection to ACER intact! It seems to be rescanning all repositories, which may indicate something about what happened to those of you in the know. But it is wonderful! Thank you, AudriusButkevicius!!! Your kindness and know-how are the essence of online community.

2 Likes