Location of the index .ldb files on Android phone

Hi, I have enabled hidden files display in my Android phone’s “ES File Explorer”, but I can’t find the index .ldb files, neither in the microSD card:

/storage/extSdCard/Android/data/com.nutomic.syncthingandroid/

(the only subfolder is files which contains the actual files)

nor in the internal storage

/storage/sdcard0/Android/data/com.nutomic.syncthingandroid/

Where is the hash database located on Android?

1 Like

The path is: /data/data/com.nutomic.syncthingandroid/files/index-v0.14.0.db

It is reachable with root privileges or root ADB shell.

# adb root
# adb shell ls -a -l /data/data/com.nutomic.syncthingandroid/files/index-v0.14.0.db

Thanks @Catfriend1 for your answer.

Following this message How/when does Syncthing know it has to rescan files? and @calmh’s answer, I need to copy the folder index-v0.14.0.db and its content, from my PC to my Android phone (unrooted).

Do you see a solution to do this without rooting the phone?

Ugh, I’ve read the other thread, are you sure you really want to copy that DB over? I’d feel good if the database waa from the phone (same device) but your case with taking it from the pc sounds like putting gloves carefully handling a little fire. It could probably work but if you make a mistake and start it up, you could screw over.

Unfortunately the official Android app does not support exporting and importing the database. This is an experimental feature of Syncthing-Fork, also meant to be used for settings+database from the same device. If you still like to try it, grab a fresh STF installation, export, so you see the /…/backups/syncthing path and where the DB has to be put. Then overwrite with your export from the pc and hit the import button in the app.

1 Like

Thanks for your answer @Catfriend1, I will try this with STF!

(I delete ST classic before installing STF, right?)

I will just try about copying the database from PC to Android, but no problem it it fails : I have many backups.


As it seems you are the maindeveloper of STF @Catfriend1, I think this is an interesting feature : the first scan/hash of a 100 GB microSD card (example: full of MP3) is horrible to do on phone : due to power management, it seems that the process is often interrupted. Then even after a few nights and tricks to maintain the phone on during the process, the 100 GB is still not fully scanned.

Feature proposal : insert the microSD on PC, do the hash of the folder on PC (it takes only a few hours), copy the hash database to microSD card, then re-insert the microSD card in the phone, and click “Import hash database computed on computer” (with a better name!) and done!

Maybe what you described is already exactly this, I’ll try it today !


PS : General question about Android : is it totally impossible to write in /data/data/com.nutomic.syncthingandroid/files/index-v0.14.0.db, either with Windows Explorer (phone connected to PC via USB) or adb or an app like ES File Explorer, if I’m unrooted ? Or is there a small solution that could work even for unrooted phones?

I just installed ST Fork, shared a few folders with PC (working).

Then I tried Settings > Import and export > Export configuration (I also found this from the main window’s “drawer menu”), and I can find /storage/emulated/0/backups/syncthing/ indeed, but there are only 4 files:

cert.pem, config.xml, key.pem, sharedpreferences.dat

It seems that the Export configuration feature doesn’t export the database in backups/syncthing.

Where is the option to export database as well?

PS: Settings > About says:

STF Wrapper v.1.4.2.0 ST version v.1.4.2 ST Database size 47M

(I installed STF from Google Play Store)

After the message

image

the files should be there, including a folder with the database.

image

Ok, this only works since Android API 26+ so you’ll need Android 8+ to do it. STF hasn’t got an implementation for directory copying on lower Android versions, yet.

image

Ok, this only works since Android API 26+ so you’ll need Android 8+ to do it.

Oh this is the reason, then, I have Android 5 (unrooted).

Do you see a solution for my problem with ST or STF?

Either with adb or ES File Explorer or something else?


PS: what do you think of this feature? Insert the microSD on PC, do the hash of the 100GB folder on PC (it takes ~ 1 hour), copy the hash database to the microSD card, then re-insert the microSD card in the phone, and click “Import hash database computed on computer” and done!

Do you see a solution for my problem with ST or STF?

Sorry, I don’t have a solution at hand at the moment. If you’d be ready to put some work in it you could write the java code for API < 26 to handle copying a whole directory and then submit it to STF.

Other things I could imagine is compiling the app yourself from source with a debug signing key and hoping for Android letting you debug the app’s private directory when it is installed which would probably allow you doing an ‘adb push /data/data/com…syncthingandroid/files/index…db’ in debug mode.

Both ways aren’t as nice as what I wished for to provide to you …

PS: what do you think of this feature? Insert the microSD on PC, do the hash of the 100GB folder on PC (it takes ~ 1 hour), copy the hash database to the microSD card, then re-insert the microSD card in the phone, and click “Import hash database computed on computer” and done!

I don’t think this is a good feature as Syncthing may change in the future and other information might be also stored in the database which is not intended to be moved around then. I’d more recommend this: https://github.com/syncthing/syncthing/issues/4488 “Store hashes in external file”

I am not even sure why this is an issue. Most recent (like last 4-5 years) are arm64, which has built-in SHA256 instructions, so hashing/scanning on my phone used to be 6-8 times faster than 4-5 year old CPU without SHA256 instructions.

There are millions of devices older than that still in use. If the OP’s phone runs Android 5, then it may very likely belong to that group.

Thank you for your answers.

This would probably be the easiest way @Catfriend1.

Or just a Import .tar.gz database backup option under Settings > Experimental?

Then it would just open a Filepicker, we would choose a .tar.gz and it would just decompress this package to the normal database folder.

Do you think this is something possible in the future?


One argument for this would be the same as @Calmh’s on this github issue:

Syncthing could use it to seed the real index database when a folder has been moved, copied or removed/re-added, obviating the full initial scan.

1 Like

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