# \[CLI\] storage of notes

**URL:** <https://discourse.joplinapp.org/t/cli-storage-of-notes/34634>\
**Category:** Support\
**Created:** [23 December 2023 22:48 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634 "2023-12-23T22:48:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mve](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mve](https://discourse.joplinapp.org/u/mve)\
**Post date:** [23 December 2023 22:48 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/1 "2023-12-23T22:48:17Z")

</div>

### Operating system

Linux

### Joplin version

2.13.2

### What issue do you have?

As I understand the notes are stored in .config/joplin/database.sqlite

Why are they still kept there if I Remove them from my CLI application?

---

<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:** [23 December 2023 22:57 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/2 "2023-12-23T22:57:18Z")

</div>

The following two settings (from `joplin-cli help config`) should be relevant here:

> ```
> revisionService.enabled Enable note history.
> Type: bool.
> Default: true
>                               
> revisionService.ttlDays Keep note history for.
> Type: int.
> Default: 90
> 
> ```

By default, [note history](https://joplinapp.org/help/apps/note_history) is enabled (I'm not sure if there's a way to access previous note versions from CLI...).

Changing the `revisionService.ttlDays` setting should change how long deleted notes and resources are kept. (For resources, this is even if note history is disabled).

---

<div class="post-metadata">

**Author:** ![mve](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mve](https://discourse.joplinapp.org/u/mve)\
**Post date:** [23 December 2023 23:04 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/3 "2023-12-23T23:04:34Z")

</div>

okay, how do I disable note history?

---

<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:** [23 December 2023 23:25 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/4 "2023-12-23T23:25:25Z")

</div>

First make a backup of (undeleted) notes:

```auto
joplin-cli export --format="jex" ./backup.jex

```

Next,

- `joplin-cli config revisionService.ttlDays 1` (delete revisions and unlinked resources after 1 day)
  - I _think_ that the minimum is 1

- `joplin-cli config revisionService.enabled false` (disable revisions)

should work.

After restarting the app, old revisions (deleted more than a day ago) should be deleted after four or so seconds:

> <https://github.com/laurent22/joplin/blob/b4928eb7e5cebe10dc34efbaecdd98963ca98cad/packages/lib/services/RevisionService.ts#L317>

Unlinked resources will be deleted after slightly longer:

> <https://github.com/laurent22/joplin/blob/ee18271f9b8bd9a4ce48891ac1963d3b323a8f66/packages/lib/services/ResourceService.ts#L173>

---

<div class="post-metadata">

**Author:** ![mve](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mve](https://discourse.joplinapp.org/u/mve)\
**Post date:** [24 December 2023 11:05 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/5 "2023-12-24T11:05:02Z")

</div>

Are all these settings saved in .config/joplin? If I want to migrate to another device I just need to backup my .config/joplin dir and move it to .config/joplin on my new device right?

---

<div class="post-metadata">

**Author:** ![mve](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mve](https://discourse.joplinapp.org/u/mve)\
**Post date:** [28 December 2023 14:43 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/6 "2023-12-28T14:43:19Z")

</div>

Am I right?

---

<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:** [27 January 2024 14:44 UTC](https://discourse.joplinapp.org/t/cli-storage-of-notes/34634/7 "2024-01-27T14:44:09Z")

</div>

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