How can manually export note data without syncing [Android]

I have a damaged Android phone, which I had been using for a number of years, that has a large number of Joplin notes on it.

I'm looking for a way to manually extract the notes data, and exported so I can use it on my new device.

I mention it is damaged only because it might not be possible to get it any network connectivity, and therefore when I take it to the repair shop I will have to get the data out either through the USB port, or by exporting it to an SD card.

So, considering I cannot use the the standard sync method (honestly, I've never really configured that anyway), how can I manually do this.

Do I need to somehow copy the entire app directory, or just the folder where the notes are?

The actual Joplin installation is obviously in the "android" app "data" directory, but there is a separate file where I have synced the notes through the file system:

If I just copy the contents from here, and send it out, will that be enough to import it to my new installation? Or do I need some other metadata material?

Will that preserve any of the notebooks or tags? Or will it just be a bunch of random individual notes?

Also, the old notes are synced did the local file system, but also encrypted. Do I need to somehow reverse the first? Do I need to export the key file to make them readable in the new installation?

Any detailed instructions on how to do this, even if it seems elementary, would be greatly appreciated, since I am something of a novice.

3 Likes

I'd love to know how to export my notes from the Android as well since I'm afraid of loosing all my notes because of synchronization failure!
Please, someone, tell me how to backup my files!
Thanks!

On android in the config screen you can use export profile as a backup which will contain your sqlite database and resources folder which apparently (although I've not actually tried it) you can drop in place of your regular Joplin database + resources folder - best try with a portable install.

For desktop I would just use the simple backup plugin.

1 Like

Good to know. At least I have something to try with if the sync keeps not working as it is... I feel quite concerned using Joplin now as it doesn't import my notes from Dropbox, I've filed a bug on Github yesterday.

I have no folder named "Joplin Notes" in Documents folder - either in Internal or SD.
In fact a search for "Joplin" returns no results.
I don't understand what the "config screen" is - is that a developer thing?
I simply want to export all Notes as there are plenty of posts about attempting to sync deleting all existing notes.
I am happy to do this manually.
In the Joplin help pages it says you can export in Android but it doesn't say how and I can not find an option to do so.

Tried searching Android phone for *.md - no results.
Tried Configuration > Export Profile - "Could not export files: Directory could not be created". I realise this would probably not have exported the notes themselves anyway - just trying to be proactive and thorough.
Tried Configuration > Sync target: File System, set up a folder ("SD Card/Sync Joplin", hit Synchronise: nothing happens, no files in the folder I created and set as sync target.
(There is a permanent message below the Sync button saying "Created remote items: 1, Completed, Last Error: ... Could not encrypt... Master key is not loaded.
When I tap the orange banner "Press to set the decryption password" it says "Master password: Loaded". I have tried disabling encryption. Nothing works.

I simply want to start from scratch and sync from PC to Android and then work from there - hoping I can backup from PC, relying on successful sync.
It would be good however to know I can export or backup or at least manually copy files from Android if you can tell me how in slightly more detail please.

Well, it seems this request was not the first one. Could one of the experts in Joplin simply state the status regarding this issue ? Is it, or is it not possible to export from Android ?

This may be a newbie question, but I think it deserves an answer. I got some success with the export profile : indeed as @bod said, a standard export profile doesn't work because created the directory won't work. So I created manually the /Documents/Joplin/ directory on my Android device and tried again (having chaged the "Joplin Notes" into "Joplin"), and it does something: the joplin.sqlite and log.sqlite are exported, as well as a /resources/ directory that contains ... the images and formatting. Still no .md files. Probably no way either to merge this sqlite (that presumably incorporates the metadata of the notes, but no notes themselves assuming it should be the same as Windows, i.e. writing .md files somewhere...

It's not, except by exporting the profile.

The .sqlite does contain notes as well as tags, folders, etc - everything except resources.
However the only way to use it is to copy over to desktop and replace the file from the desktop version with the one copied from Android.

Progressing ... Thanks for being honest. Now there is no sqlite file in the Apps directory, so I guess I have tooverwrite some file in /appdata/ something ? I found two Joplin directories, but not a single .sglite file there... Any clue which file I haveto replace ?

Are you talking about the desktop app? The exact path depends on your OS. On Linux it's ~/.config/joplin-desktop/, on Windows it's c:\Users\<user>\.config\joplin-desktop. No idea where it is on MacOS but should be something similar.

Found it, and after some trial/errors I finally got it in place, but when I relaunch Joplin (desktop), it always "locally deletes" the notes. When it does that, the database.sqlite file decreases. Seems to me that's because I have the sqlite but it can't find the .md files (probably since they are not exported and I never could find them on the Android)

not sure what this means, tbh. Try this.

  1. Back up your joplin folder.
  2. Delete the original.
  3. Start Joplin - it should create the folder again with some default settings.
  4. Fully close Joplin.
  5. Copy the DB from Android, overwriting the local file. You may also need to rename the file from Android to match the one on desktop.
    Optionally, also copy the resources.
  6. Start Joplin - you should see the notes you had on Android.

There are no .md files -- all your data is in the sqlite file, except for pictures and other attachments which are in resources/

OK. So by reloading I finally got the Android files to my desktop version. Step 1 accomplished.
Still these notes don't make it back to the Android phone. Launching Joplin Android app triggers an error saying it can't access some file in the locks directory...
BTW, the sync method on Android using OneDrive doesn't work for me either (not sure how that is supposed to work), so I selected the "file system" option, using my OneSync directory (inside OneDrive, it's the folder that gets copied to/from the Android in the background.

I just realised that there is both a ".lock" and a "locks" directory in my Joplin directory. Could that be the source of the problem ? Only the "visible" locks is copied to the Android phone. The OneSync app says that the invisible ".lock" is ignored. Tried several things, like deleting "locks" or creating ".lock" on Android, to no avail.

Still I could send the debug report from Android to PC in the vary same directory (OneSyncFiles/Joplin) :
Date,Level,Message
12-01T16:32:09,30,"RevisionService: ""maintenance: Done in 2142ms""
12-01T16:32:09,30,"RevisionService: ""collectRevisions: Created revisions for 0 notes""
12-01T16:32:07,30,"RevisionService: ""maintenance: Service is enabled""
12-01T16:32:07,30,"RevisionService: ""maintenance: Starting...""
12-01T16:31:46,30,"""DecryptionWorker: cannot start because no master key is currently loaded.""
12-01T16:31:45,30,"Synchronizer: ""Total notes: 5""
12-01T16:31:45,30,"Synchronizer: ""Total resources: 3""
12-01T16:31:45,20,"Synchronizer: ""There was some errors:""
12-01T16:31:45,20,"Synchronizer: ""Error: Error: Operation not permitted. Path: /storage/29A7-1BEB/OneSyncFiles/Joplin/locks/2_2_056b384c36a14ed8be7226816886972e.json
Code: EUNSPECIFIED
value@index.android.bundle:1108:275
index.android.bundle:1108:4056
p@index.android.bundle:83:588
index.android.bundle:83:1893
p@index.android.bundle:83:588
o@index.android.bundle:83:1069
index.android.bundle:83:1241
u@index.android.bundle:77:157
index.android.bundle:77:866
index.android.bundle:85:1672
k@index.android.bundle:85:500
w@index.android.bundle:85:898
callReactNativeMicrotasks@index.android.bundle:85:3054
value@index.android.bundle:38:2868
index.android.bundle:38:960
value@index.android.bundle:38:2504
value@index.android.bundle:38:919
value@[native code]
value@[native code]""
12-01T16:31:45,30,"Synchronizer: ""Total folders: 1""
12-01T16:31:45,30,"Synchronizer: ""Operations completed: ""
12-01T16:31:45,10,"Synchronizer: ""Error: Error: Operation not permitted. Path: /storage/29A7-1BEB/OneSyncFiles/Joplin/locks/2_2_056b384c36a14ed8be7226816886972e.json
Code: EUNSPECIFIED

I think the file system sync method is still broken on Android, there's a fix ready but it hasn't been released yet.

Thanks for the info. I had tried the OneDrive previously, and it didn't work either. Since I reinstalled Joplin on Android, maybe I should try again now ? Did it, re-authorised, and ... it works. Thanks for the help.