Skip to content

feat(cli): automatic periodic SQLite export with retention - #8819

Merged
Alkarex merged 1 commit into
FreshRSS:edgefrom
polybjorn:feat/auto-sqlite-export
May 12, 2026
Merged

Alkarex merged 1 commit into
FreshRSS:edgefrom
polybjorn:feat/auto-sqlite-export

Conversation

@polybjorn

Copy link
Copy Markdown
Contributor

First step of the multi-PR plan in #8183: settings and CLI for periodic on-server SQLite export. No Web UI yet.

Kept separate from cli/db-backup.php / cli/db-restore.php. Those are paired around a fixed backup.sqlite filename for one-shot migration; periodic exports want timestamped files and rotation, so they live under their own path data/users/<user>/sqlite-backups/.

Settings

Added to config.default.php:

'auto_sqlite_export' => [
    'enabled' => false,
    'retention' => 7,
],

enabled defaults to false; the CLI exits without writing when off. retention is how many past backups to keep per user; older ones are deleted after each successful export.

The third setting from #8183 (max DB size for a Web UI trigger) is deferred to the PR that adds the Web UI, since it has no consumer here.

Usage

./cli/export-sqlite-auto.php
# Writes: data/users/<username>/sqlite-backups/<YYYYMMDDTHHMMSSZ>.sqlite

Timestamps are UTC, basic ISO 8601 format, filename-safe and lexically sortable. Meant to be scheduled by the admin (cron, systemd timer). Supports -q / --quiet like the other CLI scripts.

Test plan

  • make test-all passes locally.
  • With enabled => false: CLI exits 0, writes nothing.
  • With enabled => true: each user gets a .sqlite file under sqlite-backups/ containing all FreshRSS tables.
  • After 5 runs with retention => 3: 3 newest files remain per user.
  • --quiet suppresses non-error output.

Add an opt-in CLI that exports each user's database to
`data/users/<user>/sqlite-backups/<YYYYMMDDTHHMMSSZ>.sqlite` (UTC) and
prunes older files to a configured count. Gated by two new settings,
`auto_sqlite_export.enabled` and `auto_sqlite_export.retention`.

Kept separate from `cli/db-backup.php` / `cli/db-restore.php`, which
stay the fixed-filename migration tool. First step of FreshRSS#8183.
@polybjorn
polybjorn force-pushed the feat/auto-sqlite-export branch from ee891e3 to ff38aa1 Compare May 11, 2026 21:48
@polybjorn
polybjorn marked this pull request as ready for review May 11, 2026 21:49
@Alkarex Alkarex added this to the 1.30.0 milestone May 12, 2026
@Alkarex

Alkarex commented May 12, 2026

Copy link
Copy Markdown
Member

Good idea 👍🏻

@Alkarex
Alkarex merged commit d74337d into FreshRSS:edge May 12, 2026
1 check passed
@Alkarex Alkarex added the CLI Command line interfaces in ./cli label May 12, 2026
@polybjorn
polybjorn deleted the feat/auto-sqlite-export branch May 12, 2026 06:53
@Alkarex Alkarex modified the milestones: 1.30.0, 1.29.1 May 14, 2026
doonga pushed a commit to greyrock-labs/home-ops that referenced this pull request May 20, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [freshrss/freshrss](https://freshrss.org/) ([source](https://github.com/FreshRSS/FreshRSS)) | patch | `1.29.0-alpine` → `1.29.1-alpine` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/34) for more information.

---

### Release Notes

<details>
<summary>FreshRSS/FreshRSS (freshrss/freshrss)</summary>

### [`v1.29.1`](https://github.com/FreshRSS/FreshRSS/blob/HEAD/CHANGELOG.md#2026-05-20-FreshRSS-1291)

[Compare Source](FreshRSS/FreshRSS@1.29.0...1.29.1)

- Features
  - Accept `.txt` import of feed URLs in additional to e.g. OPML [#&#8203;8818](FreshRSS/FreshRSS#8818), [#&#8203;8837](FreshRSS/FreshRSS#8837)
  - New CLI for automatic periodic SQLite export with retention [#&#8203;8819](FreshRSS/FreshRSS#8819)
  - More feed info: last received date, publication date [#&#8203;8799](FreshRSS/FreshRSS#8799)
- Bug fixing
  - Fix cookies with some browsers [#&#8203;8867](FreshRSS/FreshRSS#8867)
  - Fix search in shared user queries with empty results [#&#8203;8863](FreshRSS/FreshRSS#8863)
  - Fix XML errors with loading invalid OPML in `lib_opml` library [#&#8203;8652](FreshRSS/FreshRSS#8652), [#&#8203;8853](FreshRSS/FreshRSS#8853),
    [lib\_opml#48](https://framagit.org/marienfressinaud/lib_opml/-/merge_requests/48), [lib\_opml#51](https://framagit.org/marienfressinaud/lib_opml/-/merge_requests/51)
  - Fix ensure maximum number of feeds also with Dynamic OPML [#&#8203;8832](FreshRSS/FreshRSS#8832)
  - Fix click mark as read [#&#8203;8817](FreshRSS/FreshRSS#8817)
- UI
  - Improve browser compatibility to keep mobile navigation at the bottom [#&#8203;8833](FreshRSS/FreshRSS#8833)
  - Improve support of older/simpler Web browsers/engines such as SeaMonkey [#&#8203;8810](FreshRSS/FreshRSS#8810),
    [#&#8203;8811](FreshRSS/FreshRSS#8811), [#&#8203;8813](FreshRSS/FreshRSS#8813),
  - Improve *Swage* theme [#&#8203;8842](FreshRSS/FreshRSS#8842)
  - Rename *Nord theme* to *Nord* [#&#8203;8805](FreshRSS/FreshRSS#8805)
  - Replace GIF spinner by CSS spinner [#&#8203;8804](FreshRSS/FreshRSS#8804), [#&#8203;8812](FreshRSS/FreshRSS#8812)
  - Various UI and style improvements: [#&#8203;8800](FreshRSS/FreshRSS#8800), [#&#8203;8816](FreshRSS/FreshRSS#8816),
- I18n
  - Improve Brazilian Portuguese [#&#8203;8846](FreshRSS/FreshRSS#8846)
  - Improve Dutch [#&#8203;8868](FreshRSS/FreshRSS#8868)
  - Improve German [#&#8203;8840](FreshRSS/FreshRSS#8840)
  - Improve Polish [#&#8203;8854](FreshRSS/FreshRSS#8854)
  - Improve Russian [#&#8203;8861](FreshRSS/FreshRSS#8861)
  - Improve Traditional Chinese [#&#8203;8849](FreshRSS/FreshRSS#8849)
- Misc.
  - Update dev dependencies [#&#8203;8858](FreshRSS/FreshRSS#8858), [#&#8203;8864](FreshRSS/FreshRSS#8864)

</details>

---

### Configuration

📅 **Schedule**: (in timezone America/New_York)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE4Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/88
@Inverle Inverle mentioned this pull request Jul 2, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Command line interfaces in ./cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants