# An Entire Notebook was Deleted

**URL:** <https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161>\
**Category:** Support\
**Created:** [7 December 2023 13:26 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161 "2023-12-07T13:26:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoplinuser](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@ajoplinuser](https://discourse.joplinapp.org/u/ajoplinuser)\
**Post date:** [7 December 2023 13:26 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/1 "2023-12-07T13:26:47Z")

</div>

### Operating system

Linux

### Joplin version

2.12.19

### Desktop version info

Joplin 2.12.19 (prod, linux)

Client ID: d1a2c4397afe401b9e3f357503e3f67b  
Sync Version: 3  
Profile Version: 43  
Keychain Supported: No

Favorites: 1.3.0  
Simple Backup: 1.3.4

### Sync target

Nextcloud

### Editor

Rich Text Editor

### What issue do you have?

Unfortunately, a whole notebook of mine has disappeared.

Immediately before this happened, I deleted a single .md file on the sync target, as the Desktop client was complaining about not being able to get its content. The file was indeed empty, I had deleted the content of the file on the sync target a couple minutes before to try and alleviate another error with the same file (a bunch of attributes like creation date, modified date were missing). So I thought deleting a single file wouldn't do too much harm...

A couple seconds after that, the Desktop client synced and started deleting all my notes in the notebook. The mobile client did the same thing (arguably I should have disabled network access on my phone and tried to backup, but I naively hoped that one of the clients would realize that there was no reason to delete the notes).

Before deleting the above mentioned .md file, **I created new notebooks and sub-notebooks and assigned my notes to them**. I had four notebooks before the deletion, now I only have three.

Before doing _that_ I also installed the Simple Backup plugin and configured it. Of course it didn't make a backup yet, because I left it to its default backup interval of 24 hours.

### Log

Looking at the log, I went from a total notes count of 98 to 38. The lines of the log between these two counts is riddled with lines like this:

```auto

2023-12-07 13:47:29: Synchronizer: "Sync: deleteRemote: local has been deleted: (Remote ffb01bc130a84b0095e6caf940d2f202)"

```

And (I think after a program restart) this:

```auto

2023-12-07 13:48:49: Synchronizer: "Sync: fetchingProcessed: Processing fetched item"
2023-12-07 13:48:49: Synchronizer: "Sync: deleteLocal: remote has been deleted: Note: (Local 1f2ec2093f874dc9a7642a987353fd19): (Remote 1f2ec2093f874dc9a7642a987353fd19.md)"

```

### How to recover?

To my untrained eye it looks like the changes I made (with regards to putting all my notes into new notebooks) were never actually fully pushed to the sync target and that somehow, the client decided that the newer local notes must be inferior to the old ones on the sync target. At the same time, the fact that the notes were structured differently in comparison to the target (i.e. all in one notebook on the target instead of neatly organized locally) _did_ seem to get picked up, which then justified the deletion of the notes. The big question is, then, why the other three notebooks were left intact.

Would it make any sense to try and restore the .md files from Nextcloud's deleted files interface? For some reason it wont let me sort them properly, so even though I checked to list the freshest deleted files at the top, there are a couple older files sprinkled in (which I would try not to include). Makes me fear I'd only make it worse that way.

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [7 December 2023 15:17 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/2 "2023-12-07T15:17:59Z")

</div>

What may have happened is that the md file you deleted was the notebook metadata - and since it was deleted, the notebook content got deleted too.

If you still have things in the Nextcloud recycle bin you might want to ask for support over there as they can advise you better. If you can restore the sync target to its previous state, make a backup of it. Then you should reset your data locally (by deleting the profile folder), and sync again.

---

<div class="post-metadata">

**Author:** ![ajoplinuser](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@ajoplinuser](https://discourse.joplinapp.org/u/ajoplinuser)\
**Post date:** [9 December 2023 15:02 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/3 "2023-12-09T15:02:30Z")

</div>

Thanks for the reply! I was about to make copies of my Joplin profile before trying to restore the .md files, when I noticed that the Simple Backup Plugin did _indeed_ make a copy (just not where it was supposed to, i.e. the path I specified, but in the Joplin .config folder). So a big thanks to the dev of that plugin! This unpredictable behavior has indeed saved me many hours.

General comment: I think that Joplin's lack of a "trash" folder should be grounds to proactively ask users if they want Simple Backup installed when they start using Joplin.

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [9 December 2023 15:41 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/4 "2023-12-09T15:41:29Z")

</div>

> General comment: I think that Joplin's lack of a "trash" folder should be grounds to proactively ask users if they want Simple Backup installed when they start using Joplin.

We're working on including Simple Backup in the app by default 🙂

> <https://github.com/laurent22/joplin/pull/9360>
>
> \# Summary
> 
> \- Adds 7zip-bin as a library that can be \`require\`d by plugins
> \- A…dds the Simple Backup plugin as a submodule
> - This may require extra steps after cloning. \*\*To-do\*\*: Can this be done automatically? (\`git submodule init && git submodule update\`)
> - Patches the plugin to update to the latest build script (used Webpack 4 previously, which seems to require Node's \[--openssl-legacy-provider\](https://nodejs.org/en/blog/release/v17.0.0) flag) and include \`7zip-bin\` as an external dependency.
> - Webpack 5 also includes support for \[\`externalsType\`\](https://webpack.js.org/configuration/externals/#externalstype) which allows keeping a \`require\` for \`7zip-bin\`, even though the built plugin script doesn't use \`exports....\` to export functions.
> - With Webpack 4, \`7zip-bin\` is required with \`eval('require("7zip-bin")')\` to preserve the \`require\` statement.
> - Builds the plugin on \`postinstall\`
> 
> 
> \# To-do
> \## This pull request
> \- \[x\] \*\*Fix\*\*: Automatically pull submodules
> \- \[x\] \*\*Fix\*\*: On a first \`postinstall\`, the default plugin build script tries to use \`execCommand\` from \`@joplin/utils\` before \`@joplin/utils\` has been built.
> \- \[x\] \*\*Fix\*\*: The patch file for Simple Backup is currently very, very large
> - This is because it upgrades Simple Backup to the latest published build script, which uses Webpack 5.
> - I haven't managed to correctly mark \`7zip-bin\` as an \[external dependency\](https://v4.webpack.js.org/configuration/externals/) in Webpack 4.
> \- \[x\] \*\*Refactoring\*\*: \`default-plugins\` currently writes to a directory in a different package (\`packages/app-desktop/build/\`) on build. For maintainability, it may make sense to make \`default-plugins\` a dependency of \`app-desktop\`. \`app-desktop\` can then trigger the build and provide an output path.
> \- \[x\] \*\*Upstream changes\*\*: Open the migration to the latest build script as a pull request.
> - Would significantly shrink the size of the patch being applied to the plugin.
> - See https://github.com/JackGruber/joplin-plugin-backup/pull/60
> \- \[\] \*\*Testing\*\*: Verify that MacOS and Windows apps can be built (switches from 7zip-bin packages for individual platforms to the 7zip-bin package for more platforms).
> 
> \## Follow-up pull request
> \- \[x\] \*\*Feature\*\*: Show indication that Simple Backup is a default plugin (currently doesn't show "recommended" badge either)
> \- \[\] \*\*Feature\*\*: Don't allow users to uninstall default plugins, but do allow rolling back to the version shipped with Joplin or disabling. \*\*To-do\*\*: What about resetting/clearing settings?
> - This will also require adding a way to switch from a default plugin to a version published on NPM. (Currently an "Update" button is shown next to the plugin).
> \- \[\] \*\*Fix\*\*: Default plugins should auto-update when installing a new version of Joplin.
> 
> \<!--
> 
> Please prefix the title with the platform you are targetting:
> 
> Here are some examples of good titles:
> 
> \- Desktop: Resolves #123: Added new setting to change font
> \- Mobile, Desktop: Fixes #456: Fixed config screen error
> \- All: Resolves #777: Made synchronisation faster
> 
> And here's an explanation of the title format:
> 
> \- "Desktop" for the Windows/macOS/Linux app (Electron app)
> \- "Mobile" for the mobile app (or "Android" / "iOS" if the pull request only applies to one of the mobile platforms)
> \- "CLI" for the CLI app
> 
> If it's two platforms, separate them with commas - "Desktop, Mobile" or if it's for all platforms, prefix with "All".
> 
> If it's not related to any platform (such as a translation, change to the documentation, etc.), simply don't add a platform.
> 
> Then please append the issue that you've addressed or fixed. Use "Resolves #123" for new features or improvements and "Fixes #123" for bug fixes.
> 
> AND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/dev/CONTRIBUTING.md
> 
> \--\>

---

<div class="post-metadata">

**Author:** ![ajoplinuser](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@ajoplinuser](https://discourse.joplinapp.org/u/ajoplinuser)\
**Post date:** [9 December 2023 16:05 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/5 "2023-12-09T16:05:54Z")

</div>

Amazing! 😃

---

<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:** [8 January 2024 16:06 UTC](https://discourse.joplinapp.org/t/an-entire-notebook-was-deleted/34161/6 "2024-01-08T16:06:41Z")

</div>

Closed on 8 January 2024 16:06 UTC

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