Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joplin emptied my whole database! #255

Closed
2 of 8 tasks
ronaldgit opened this issue Feb 23, 2018 · 4 comments
Closed
2 of 8 tasks

Joplin emptied my whole database! #255

ronaldgit opened this issue Feb 23, 2018 · 4 comments

Comments

@ronaldgit
Copy link

ronaldgit commented Feb 23, 2018

Operating system

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Application

  • Desktop
  • Mobile
  • Terminal

After I updated Joplin to the newest version (1.0.67), it took about a minute and then my database was almost empty. Before that I had one Notebook in it with lots of notes.
I restored a backup version of the database and it happened again. I installed the debugging mode, but that does not give any clue, the console stays empty.
I now only have a notebook 'Conflict' with 3 notes from the disappeared notebook. when I add another notebook it stays in.
I think it has something to do with syncing. I added the log-database.txt.
log-database.txt
I tried again after I removed the local directory to sync with. It happened again, but this time the notebook names stay in, they're just empty. The 3 conflicted notes are not conflicted anymore, they are back in the - otherwise empty - notebooks they belong to.

@laurent22
Copy link
Owner

Which sync target are you using? And did you recently make any change to either:

  • The sync target on Joplin (i.e. changing from OneDrive to Nextcloud, or changing the Nextcloud URL)
  • The files on the sync target (eg. deleting/moving files around)

The reason it's deleting again after restoring the backup is because the sync state is still in the database and probably there's nothing on your sync target or something completely different than what you have locally. If you want to start over clean, you could do this:

  • First, of course, keep a separate unmodified copy of the backup
  • Open database.sqlite in something like SQLiteStudio
  • Open the SQL editor (Alt+E)
  • Run this command: DELETE FROM sync_items; DELETE FROM deleted_items; DELETE FROM settings;

Now restart Joplin with this database and your notes/folders will be there. You will need to setup the sync and other settings again but otherwise it should work.

@ronaldgit
Copy link
Author

I've done what you said and that restored the database. Thank you. I have recently changed a harddisk on the server and I think that might be the cause of this. The Conflicts are also gone now.
I did notice one other thing: every time I open Joplin a new version is opened in memory. I expected the existing version to be used. So I ended up with 12 versions of Joplin in memory after a while.

@laurent22
Copy link
Owner

So I ended up with 12 versions of Joplin in memory after a while.

That could have contributed to the issue as multiple apps writing and syncing to the same local db might cause problems (at least it's never been tested).

It's a good point though, the app currently does not check if another instance is running while it definitely should. For now, rather than re-opening the app every time I'd suggest using the tray icon and open it from there.

@ronaldgit
Copy link
Author

I'll do that. The tray-icon was invisible before, I have made it visible all the time, so I won't make this mistake again. Thank you. Great program!

@lock lock bot locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants