This should help once implemented.
1 Like
I am trying the SQL query you provided in your bash script, but it seems it give strange results (resources referred are outputted).
Further inspect of the note_resources
table shows that these items indeed have is_associated = 0
. Not sure what's happening inside.
I saw the same in my database. Never figured out why.
huy
5 October 2021 10:11
24
@rxliuli I ran your joplin-batch-web, which found lots of old images, and I ran @tessus 's jnrmor
script which found nothing. Do you think the difference in results is because joplin-web-batch doesn't check old note histories?
rxliuli:
You can refer to the existing backup plugins above. It is a regular backup, but if you use git, you can do this more frequently (because incremental backups are possible), and also about when to back up. The simple solution is to follow the time interval (for example, 30s, it seems that there will be performance problems for people with a lot of notes, but as long as the query joplin api layer is also cached or the plugin hooks api is used, the backup can be as little as possible), complex The solution is batch processing, to achieve a function similar to the IDE's local history, and then submit to git in batches at the right time
There will be unlimited increase of git repositories, and N historical records before submission can be deleted regularly
The problem I expect to solve is already mentioned in the README
Real full backup can be used to migrate or reset
Can incremental backup to avoid losing notes
Human readable
Recover any notes (or notebooks) at any point in time - this is the existing ability of git and should be integrated
...and any progress for this? I'm about to do so myself but I haven't look into API yet...
有任何进展吗?我差点自己这么做了……
Currently there is a bug in joplin api, if it is not resolved, this plugin cannot continue
opened 02:15AM - 09 Sep 21 UTC
bug
desktop
high
<!--
Please provide a clear and concise description of what the bug is. (In t… he section Steps To Reproduce.)
Include screenshots if needed.
Please test using the latest Joplin release to make sure your issue has not already been fixed.
-->
<!--
IMPORTANT: If you are reporting a clipper bug, please include an example URL that shows the issue.
Without the URL the issue is likely to be closed.
-->
## Environment
![image](https://user-images.githubusercontent.com/24560368/132610309-743aee1b-b0f6-4649-8ac2-e6bee732086a.png)
<!--
Platform can be one of: macOS, Linux, Windows, Android, iOS, terminal (or a combination)
OS specifics: e.g. OS version, Linux distribution, Android/iOS version...
-->
## Steps to reproduce
1. Call `joplin.data.post(['tags', item.tagId,'notes'], null, {id: item.noteId, }) in the plugin
2. An error has occurred and all written data has been cleared
![joplin 大量写入 tag-note 关系时错误演示](https://user-images.githubusercontent.com/24560368/132610352-397f24ad-8b7c-47e0-a35e-f05b73b6d4d4.gif)
```js
Uncaught (in promise) Error: Not Found
at Object.<anonymous> (C:\Users\rxliuli\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\services\rest\routes\tags.js:25:23)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\rxliuli\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\services\rest\routes\tags.js:5:58)
```
## Describe what you expected to happen
## Logfile
<!--
Please attach a debug log. Issues without a debug log are likely to stall.
For information on how to collect a log file: https://joplinapp.org/debugging/
-->
ylc395
9 November 2021 16:50
27
what is the advantage / difference between these methods and just exporting to a JEX file, deleting everything and then re-importing the JEX followed by a manual sync?
jex is not a full backup in the true sense, it will lose some metadata, refer to: When will joplin modify the id of the note?
The difference is that the script in your provided link uses SQL to determine which resources are orphaned, and my script uses a diff between the export JEX file and the current Joplin instance. Considering that the script in your link is created by one of Joplin main contributor, it should probably be safe to use (at your own risk!). It's just a different method to achieve the same goal.