How to push data from Android

After setting up my Nextcloud again, I created the usual Joplin folder and set joplin-desktop to sync to that folder. To my surprise it swiftly deleted all my notes.

I still have them on my phone (and I’ve made a backup using Titanium) but when I try to sync to any folder on my Nextcloud instance it deletes all my notes, leaving me to restore the app data with Titanium.

Is there a way for me to force sync the notes on my phone to Nextcloud?

Did you change the webdav URL?

https://joplin.cozic.net/faq/

All my notes got deleted after changing the WebDAV URL!

When changing the WebDAV URL, make sure that the new location has the same exact content as the old location (i.e. copy all the Joplin data over to the new location). Otherwise, if there’s nothing on the new location, Joplin is going to think that you have deleted all your data and will proceed to delete it locally too. So to change the WebDAV URL, please follow these steps:

  1. Make a backup of your Joplin data in case something goes wrong. Export to a JEX archive for example.
  2. Synchronise one last time all your data from a Joplin client (for example, from the desktop client)
  3. Close the Joplin client.
  4. On your WebDAV service, copy all the Joplin files from the old location to the new one. Make sure to also copy the .resource directory as it contains your images and other attachments.
  5. Once it’s done, open Joplin again and change the WebDAV URL.
  6. Synchronise to verify that everything is working.
  7. Do step 5 and 6 for all the other Joplin clients you need to sync.

I was able to fix this. Here’s how:

  1. Copy Joplin App Data to PC. I used Titanium, copied the resulting tar.gz, and extracted it to joplindata
  2. Copy all files in joplindata/data/data/net.cozic.joplin/files/ to ~/.config/joplin-desktop/resources/
  3. Copy joplindata/data/data/net.cozic.joplin/databases/joplin.sqlite to ~/.config/joplin-desktop/
  4. Rename joplin.sqlite to database.sqlite in ~/.config/joplin-desktop/
  5. Create JEX archive in Joplin
  6. Create every other kind of backup in Joplin (optional)
  7. Make sure the sync URL in Joplin is correct
  8. Make sure the sync Folder and Joplin don’t have any notes in them and are synced
  9. Import JEX archive from step 5
  10. Sync

People keep doing this. Wonder what could be done to prevent this particular mistake. (And it's an easy one to make, no lie.)

That's easy. If the sync process encounters an empty target, it could ask what to do.

I suggested this to @laurent a while back, but I can't recall the reason for not implementing such a mechanism. But I reckon there was a good reason for it.

1 Like