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

After Joplin synchronizes to nextcloud, stop synchronizing midway and change the nextcloud synchronization directory before starting synchronization again. Causing all notes to be lost #10117

Closed
anshiw opened this issue Mar 14, 2024 · 3 comments
Labels
bug It's a bug high High priority issues sync sync related issue

Comments

@anshiw
Copy link

anshiw commented Mar 14, 2024

Operating system

macOS

Joplin version

2.13.15

Desktop version info

Joplin for Desktop

Copyright © 2016-2024 Laurent Cozic
Joplin 2.13.15 (prod, darwin)

Client ID: 2dd91bb5f6404444b8f45dcdb9796323

Current behaviour

After Joplin synchronizes to nextcloud, stop synchronizing midway and change the nextcloud synchronization directory before starting synchronization again. Causing all notes to be lost

Operating system
macOs 12.4

Joplin version
2.13.15
Csv Import: 1.0.1
Cursor Sync: 2.1.0
Folding in Code Mirror Editor: 2.0.1
JSheets: 1.1.3
Kanban: 1.0.7
Outline: 1.5.13
Persistent Editor Layout: 2.2.0
Pseudocode Support: 0.1.0

Desktop version info
2.13.15 (prod, Darwin)
I am using Joplin for Desktop for Mac (Copyright) © 2016-2024 Laurent Cozic

I am using Joplin for Desktop for Mac (all rights reserved) © 2016-2024 Laurent Cozic

After synchronizing to Nextcloud, Joplin 2.13.15 (prod, Darwin) has only two options under "Notebook" in the Joplin panel: "All Notes" and "Conflict". All previously created notes in "All Notes" have disappeared. I tried to use command+Shift+p "restoreNoteRevision+id" for recovery, but it also failed. What should I do now.

Expected behaviour

I installed Joplin on a new Windows computer and used the second data synchronization to Joplin on Windows, but found that it was still the same. All directory structures are lost. I deleted the local data on Mac and used the first synchronization to the directory of nextcloud for data recovery. There will be several directory structures, but they are incomplete. I will go to the~/. config/joblin desktop directory. And using the "sqlite3 database. sqlite" and "SELECT * From folders order BY ROWID ASC LIMITED 100000;" commands to check the database structure, it was found that the previous directory structure is still preserved in the database. How should I recover all my data through the database.sqlite file.

Logs

No response

@anshiw anshiw added the bug It's a bug label Mar 14, 2024
@personalizedrefrigerator personalizedrefrigerator added the sync sync related issue label Mar 14, 2024
@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Mar 14, 2024

Before doing anything else (if you haven't already), I suggest creating a backup of ~/.config/joplin-desktop on both machines. The goal of this is to prevent further data loss.

it was found that the previous directory structure is still preserved in the database.

To confirm: Do notes both have the correct parent_id fields and do parent folders with the correct ID exist in the folders table?

After synchronizing to Nextcloud, Joplin 2.13.15 (prod, Darwin) has only two options under "Notebook" in the Joplin panel: "All Notes" and "Conflict".

How many notes are present under "Conflict"?

I deleted the local data on Mac and used the first synchronization to the directory of nextcloud for data recovery. There will be several directory structures, but they are incomplete.

This might be because the original sync was incomplete before switching folders. Are all notes present? (Is it just notebook structure that's missing?)

After Joplin synchronizes to nextcloud, stop synchronizing midway and change the nextcloud synchronization directory before starting synchronization again. Causing all notes to be lost

Note: In Joplin 2.14, there's logic to prevent switching the sync target until all resources are downloaded. While working on this issue, it could make sense to check the following:

  • It should be checked whether this logic is sufficient to prevent switching targets in the middle of a sync.
  • It should be checked whether the "failsafe" option is broken when following the steps linked above (when changing WebDAV sync settings during sync).

@personalizedrefrigerator personalizedrefrigerator added the high High priority issues label Mar 14, 2024
@anshiw
Copy link
Author

anshiw commented Mar 15, 2024

~/.config/joplin-desktop在执行其他操作之前(如果您还没有这样做),我建议在两台计算机上创建备份。这样做的目的是防止进一步的数据丢失。

发现数据库中还保留着之前的目录结构。

确认:注释是否具有正确的parent_id字段,并且表中是否存在具有正确 ID 的父文件夹folders

同步到Nextcloud后,Joplin 2.13.15(prod,Darwin)在Joplin面板的“笔记本”下只有两个选项:“所有笔记”和“冲突”。

“冲突”下有多少条注释?

我删除了Mac上的本地数据,并使用第一次同步到nextcloud的目录进行数据恢复。会有几个目录结构,但它们并不完整。

这可能是因为切换文件夹之前原始同步不完整。所有注释都存在吗?(只是缺少笔记本结构吗?)

Joplin同步到nextcloud后,中途停止同步并更改nextcloud同步目录,然后再开始同步。导致所有笔记丢失

**注意:**在 Joplin 2.14 中,有一个逻辑可以防止在下载所有资源之前切换同步目标。在解决此问题时,检查以下内容可能是有意义的:

  • 应检查该逻辑是否足以防止在同步过程中切换目标。
  • 按照上面链接的步骤操作时(在同步过程中更改 WebDAV 同步设置时),应检查“故障安全”选项是否被破坏。

Thank you very much for helping me answer this question.

###Fortunately, I made a backup in September 2023 in another self built nextcloud (which I refer to as nextcloud_2023)

###The nextcloud that caused my notes to be lost in 2024 is called nextcloud_2024

  1. I found parent_id in the revisions table of the database.sqlite file, but unfortunately, some parent_ids correspond to empty values and some have data.

  2. There is no data in the "folders" table.

  3. There are 47 data points in the "Conflict" structure.

  4. I am not quite sure if all the notes have been deleted. I re imported the data from the second backup to nextcloud_2024 into Joplin for Mac and found some note data in the revisions table. I imported the data from last year's backup to nextcloud_2023 on another Windows computer. Combined with the revisions table in the database.sqlite file and the data in the notes.normalized table. Restored some notes.

  5. It is strongly recommended to add the function of backing up the entire Joplin directory in the "Help" and "Tools" sections. So my mother no longer has to worry about my data being lost.

@laurent22
Copy link
Owner

After Joplin synchronizes to nextcloud, stop synchronizing midway and change the nextcloud synchronization directory before starting synchronization again. Causing all notes to be lost

As I understand this is working as expected and is documented in the FAQ and in the description below the "WebDAV URL" field:

https://joplinapp.org/help/faq/#all-my-notes-got-deleted-after-changing-the-webdav-url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug high High priority issues sync sync related issue
Projects
None yet
Development

No branches or pull requests

3 participants