# How do I synchronize joplinapp content between an android phone and a PC using Syncthing

**URL:** <https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777>\
**Category:** Support\
**Created:** [7 August 2022 08:39 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777 "2022-08-07T08:39:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![postone](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@postone](https://discourse.joplinapp.org/u/postone)\
**Post date:** [7 August 2022 08:39 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/1 "2022-08-07T08:39:53Z")

</div>

Joplin mobile v 2.7.2  
Joplin Linux 2.6.10

How do I synchronize Joplin to my android phone using Syncthing? Syncthing seems to work properly with my specified directory `/storage/40BE-5197/globalsync` but when I try to get the Joplin to sync I get an error.

> Last error: Error: Could not initialise synchroniser: Error: Directory could not be created. Path: /storage/40BE-5197/globalsync

---

<div class="post-metadata">

**Author:** ![hhtmp88](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhtmp88](https://discourse.joplinapp.org/u/hhtmp88)\
**Post date:** [10 August 2022 04:25 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/2 "2022-08-10T04:25:31Z")

</div>

Not Possible to do so!

Per my personal experience,  
It is suggested to sync to a S3 compatible storage (e.g. Storj, 150GB free)

---

<div class="post-metadata">

**Author:** ![tomasz86](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tomasz86](https://discourse.joplinapp.org/u/tomasz86)\
**Post date:** [10 August 2022 08:28 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/3 "2022-08-10T08:28:12Z")

</div>

Of course it's possible, however the current Android release is still affected by [https://github.com/laurent22/joplin/issues/5779](https://github.com/laurent22/joplin/issues/5779), so you either need to wait for a new release (with the issue already fixed) or use the terminal commands listed in [https://github.com/laurent22/joplin/issues/5779#issuecomment-1013874764](https://github.com/laurent22/joplin/issues/5779#issuecomment-1013874764).

Please be aware that there's also [https://github.com/laurent22/joplin/issues/6517](https://github.com/laurent22/joplin/issues/6517), which is very likely to affect local files synchronised with Syncthing. You can use my workaround suggested there (i.e. set the timestamps into the future to force Joplin to rescan the files).

---

<div class="post-metadata">

**Author:** ![postone](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@postone](https://discourse.joplinapp.org/u/postone)\
**Post date:** [15 August 2022 18:10 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/4 "2022-08-15T18:10:19Z")

</div>

Thank you for your help. I am running android version 12, OneUI version 4.1.

I installed adb `sudo apt install -y adb` and ran the command `adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow && adb shell cmd appops set net.cozic.joplin android:legacy_storage allow && adb shell am force-stop net.cozic.joplin`. it seems to have fixed my problem since I no longer get the error

> Last error: Error: Could not initialise synchroniser: Error: Directory could not be created. Path: `/storage/40BE-5197/globalsync`

I no longer get the error, but joplin does not import the synchronized .md files. I changed syncthing to save the joplin files to `/storage/40BE-5197/sync/joplinapp` and changed the Joplin to synchronize to that location, but only one of the files has synchronized to my phone.

I can see the files saved on my phone `/run/user/1000/gvfs/mtp:host=*/SD card/sync/joplinapp` when I check that directory, so I don't know why the rest of the files are not synchronizing. I don't think encryption is the problem because I've configured it on both devices.

---

<div class="post-metadata">

**Author:** ![tomasz86](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tomasz86](https://discourse.joplinapp.org/u/tomasz86)\
**Post date:** [15 August 2022 19:15 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/5 "2022-08-15T19:15:34Z")

</div>

I'd suggest to clear the Joplin app data on the phone and try to set it up again from scratch. I had a similar problem before and this is what helped solve it. Basically, the proper order was to install Joplin first, then run the ADB commands, and only then enter the filesystem sync path and try to perform the synchronisation.

---

<div class="post-metadata">

**Author:** ![postone](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@postone](https://discourse.joplinapp.org/u/postone)\
**Post date:** [15 August 2022 22:35 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/6 "2022-08-15T22:35:06Z")

</div>

It looks like clearing all joplinapp data, running `adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow && adb shell cmd appops set net.cozic.joplin android:legacy_storage allow && adb shell am force-stop net.cozic.joplin` again, and enabling storage permissions has fixed the problem. at first the notes would not decrypt, but I forced stopped the app and reopened, which fixed that problem.

I'm not sure what is going on now... Syncthing on my computer says "syncing 70%" and is counting down, Syncthing on my phone says syncing "Idle" and joplin says

> Updated remote Items: \* (counting up)  
> Decrypting items \*/100 counting to 100 and then restarting

I don't know if this means there is conflict as Joplin mobile is performing synchronization... I have syncthing on android set to "receive only" so that none of the files on my PC are changed before the apps are configured correctly, but this may be the source of the problem.

---

<div class="post-metadata">

**Author:** ![tomasz86](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tomasz86](https://discourse.joplinapp.org/u/tomasz86)\
**Post date:** [16 August 2022 08:12 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/7 "2022-08-16T08:12:20Z")

</div>

It sounds like a different issue, unrelated to the folder set to "receive only". It should still sync and decrypt the notes, even if you just copied the folder to Android manually instead of using Syncthing, etc.

I don't use Joplin encryption, so I've got no real idea what the problem may be about, but I can only suggest to make a backup of the whole folder on the computer before doing more experiments, just to be extra safe.

---

<div class="post-metadata">

**Author:** ![postone](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@postone](https://discourse.joplinapp.org/u/postone)\
**Post date:** [20 August 2022 19:05 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/8 "2022-08-20T19:05:33Z")

</div>

I'm not exactly sure why I had that [problem](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/6), but I suspect it had something to do with improperly configuring Joplin's encryption on my phone...

Either way, I wiped the Joplin & Syncthing data from my phone and restarted with the steps below:

I will do some more troubleshooting but this seems to have solved my problem (including the joplin encryption)

# Solution instructions (sync joplinapp from linux to android):

If there are any joplinapp support/staff watching this, you should put these instructions somewhere on Joplinapp dot org so other android users don't have to look very far to get a solution.

- Enable USB Debugging on the phone and install adb (in linux) `sudo apt install -y adb`
- Connect the phone to the PC (and allow access to phone)
- clear syncthing data on android device and do not turn the app back on (If already paired to the PC)
- remove the android device from syncthing PC (If already paired to the PC)
- On PC: `Actions > Show ID`
- Syncthing on Phone: `Hamburger Menu > Settings > Run Conditions > [Select "Run on Wi-Fi" and "Run on metered Wi-Fi" and "Run on mobile data"]`
- On Phone: `[open syncthing] > Devices > "+" [scan ID on PC]`
- On PC: accept new device and share file directory with the new device
- On Phone: Open dropdown and choose sync directory for new shared folder and copy the directory to `Configuration > Synchronization > Directory to synchronize with (absolute path)`
- Open Joplin mobile
- Use adb to grant file permissions to joplin (`adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow && adb shell cmd appops set net.cozic.joplin android:legacy_storage allow && adb shell am force-stop net.cozic.joplin`)
- Copy syncthing directory plus the joplin-specific items directory and set them in `Configuration \> Synchronization \> File system
- Joplin Mobile: Synchronize
- Configure encryption password when prompted
- Force close Joplin mobile and reopen

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)\
**Post date:** [19 September 2022 19:06 UTC](https://discourse.joplinapp.org/t/how-do-i-synchronize-joplinapp-content-between-an-android-phone-and-a-pc-using-syncthing/26777/9 "2022-09-19T19:06:11Z")

</div>

Closed on 19 September 2022 19:06 UTC

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