Protect Meilisearch
Snapshots, Marks, Proof, Rewind and Pulse for Meilisearch Community Edition 1.12 and newer.
Rowsafe backs up Meilisearch to your bucket (or Rowsafe Storage), encrypted on your server. You get Marks, a weekly Proof, Rewind (bring documents back or rewind every index) and Pulse with one-click fixes.
Restores go back to a snapshot (every 15 minutes) or a Mark, not to any second.
Community Edition (MIT) only. Rowsafe never installs or turns on Enterprise features (sharding, networks of instances, snapshots to S3).
Before you start
- Meilisearch 1.12 or newer, one instance, installed on the server (Debian or Ubuntu) and run by systemd. Docker isn't supported yet.
- A master key. Without one, Rowsafe still backs it up, but anyone who reaches it can read and change everything, and API keys can't be managed.
- Its snapshot folder isn't under
/homeor/root. - A bucket and a passphrase. See Adopt an existing database.
Turn on backups
Run this on the server, then approve it in your browser:
curl -fsSL https://rowsafe.sh | sudo sh -s -- --accountThe installer finds Meilisearch. Nothing restarts and no setting changes.
Rowsafe's own API key. The installer reads the master key from Meilisearch's settings, or asks. The agent uses it once to make a key named Rowsafe, and never keeps it. Without a terminal, pass ROWSAFE_MEILISEARCH_MASTER_KEY (used once, never saved). See what the key may do.
Read access to the snapshot folder, for the agent's own rowsafe user only (an ACL; owners and modes unchanged).
The plan. Review it and say yes. Rowsafe checks the bucket and passphrase, then takes the first snapshot.
What Rowsafe does
| How | |
|---|---|
| Backup | Meilisearch's own snapshot (indexes, settings, task queue, API keys), encrypted on your server and uploaded. Searches go on. Every 15 minutes by default. If nothing changed, Rowsafe keeps the last one instead of copying it again. |
| Keeping backups | Every snapshot for 6 hours, one an hour for 48 hours, then the newest of each day (and those Marks point at), for 7 days by default. |
| Marks | A snapshot taken on the spot. |
| Proof | Weekly: start the newest snapshot as a temporary local Meilisearch. Check every index's primary key, settings and document count, and that a search answers. Then delete it. |
| Rewind | A copy, compare, bring documents back, or rewind every index in place with Undo for 7 days (below). |
| Pulse | Indexes, disk, the task queue and indexing (below). |
| Security check | Where it listens, TLS, whether it asks for a key, and keys that can do everything. |
| API keys | Indexes and API keys in Databases & users. |
| Restart | Restart, after you confirm, when root allows it. |
Everything is encrypted before it leaves the server, index names included.
Restores go back to a snapshot
Meilisearch keeps no change log. A restore uses the newest snapshot at or before your moment, or a Mark, and says when that was. Later changes aren't in it. If that snapshot was removed, a rewind in place stops and names the nearest kept one.
- To lose less, pick every 5 minutes in Settings (or 30 or 60 for fewer).
- Before a risky change (a reindex, a migration, a bulk delete), save a Mark. AI agents with Guard can too.
Rewind
In the dashboard, for owners and admins. See Restore a database.
- Restore a copy from a snapshot or Mark. It runs on the same server, on
127.0.0.1only, with its own master key. Kept up to 7 days. - Compare an index with production by primary key: missing, changed and added documents.
- Bring documents back to the indexes you choose. Missing documents are added. Changed ones are reset only if you tick it.
- Rewind the whole database (Meilisearch 1.18+) puts every index back, no restart. Rowsafe copies the snapshot's indexes in under temporary names (
rowsafe-restore-…) while live ones keep answering, then swaps them all at once. Newer indexes are set aside too. The old indexes stay for 7 days: Undo rewind swaps them back. API keys aren't changed.
Pulse
Pulse reads Meilisearch's statistics and task queue. Only index names, sizes and counts reach Rowsafe, never documents or keys.
| Finding | Fix |
|---|---|
| An index takes more than twice the disk its data needs | Compact it. Searches go on. Needs a recent Meilisearch. |
| The task history is very long | Clear old task history: removes records of tasks finished over a week ago. Data and waiting tasks are untouched. |
| Tasks failed in the last 24 hours | The newest failure's message, so you can fix what your app sends. |
| Indexing is more than 30 minutes behind | What slows it down, and what to change. |
| Meilisearch sends usage data to its makers | How to turn it off at its next restart. |
API keys
In Databases & users, databases are indexes and users are API keys.
- Create or remove an index. Removing takes a Mark first.
- Add an API key on the indexes you choose: read only (search), read and write (also documents) or owner (also index settings).
- New password makes a new key with the same rights and removes the old one.
A new key is made on your server and shown once, encrypted for the person who asked. Apps send it in a header to https://HOST:7700 (or http:// without TLS). Rowsafe's key and full-rights keys are listed but never changed.
What Rowsafe may do
Rowsafe's API key is used only for your backups or when someone asks. It may:
- read version, statistics, indexes, settings and tasks (backups, Proof, Pulse);
- take snapshots (backups, Marks);
- read and add documents (compare, bring back);
- create, delete, swap and compact indexes, and delete finished tasks (Databases & users, rewind, fixes);
- list, make and delete API keys (Databases & users).
A key that can make keys could make one with every right: Meilisearch has nothing narrower. Rowsafe's key never leaves your server. Removing it stops backups.
Root decides what Rowsafe may do on the server (permissions): Restart and the firewall. Rewinding the whole database needs no root permission.
On servers Rowsafe creates
Rowsafe Cloud and Create a server for me can install Meilisearch:
- Meilisearch 1.54, Community Edition, from GitHub, checked against a SHA-256 Rowsafe pinned (Meilisearch publishes none).
- Master key made on the server, root only. Production mode, analytics off, sandboxed.
- HTTPS on port 7700 through Rowsafe's TLS front; Meilisearch listens on
127.0.0.1only. Certificates renew without a restart. - Indexing memory limit: half the server's memory (256 MiB to 8 GiB).
On the server's page, one click creates your app's index and key, and shows MEILISEARCH_URL and MEILISEARCH_KEY once. Put them in your app's environment. Give your backend a read-write key, and browsers a search-only key.
import os
import meilisearch
client = meilisearch.Client(os.environ["MEILISEARCH_URL"], os.environ["MEILISEARCH_KEY"])
client.index("products").search("running shoes")On a server in your own cloud account, the certificate isn't publicly signed, so clients that check certificates must trust it. No standby, Clone or private connections from AWS.
Restore without Rowsafe
With the ROWSAFE_REPO_* lines of /etc/rowsafe/agent.env in the environment:
set -a; . /etc/rowsafe/agent.env; set +a
# --stanza is the database's "Bucket folder" (on its Settings page in the dashboard).
rowsafe-agent meilisearch download-backup --stanza search
rowsafe-agent meilisearch download-backup --stanza search --label 20261003-140000F --to ./search.snapshotThe list shows each snapshot's Meilisearch version. Start that version on an empty data folder with --import-snapshot ./search.snapshot and your master key.
Not available for Meilisearch
Restore to any second, Find the moment, major upgrades, standby servers, connection pooling, Tuning, logs, recommendations, safe copies, migration previews, clones, Move in, a second copy, and Files. The dashboard says so.
Limits
- Restores go back to a snapshot (every 15 minutes by default) or a Mark, not to any second.
- Updates go to the newest release Rowsafe tested, after a Mark, and only where Rowsafe's installer set Meilisearch up.
- Docker: not supported yet.
- One snapshot stays on the server, unencrypted, in Meilisearch's folder until the next one replaces it.
- Temporary instances (Proof, copies, rewind) need free disk for the snapshot and its unpacked indexes; the agent checks first. They use the server's Meilisearch: a snapshot from a newer version can't open, and one from an older version is upgraded.
- Proof checks exact document counts only if nothing changed while the snapshot was written.
- Compare reads up to 5 million documents per index, and counts changed ones only up to 200,000. Indexes without a primary key are skipped. One bring-back writes at most 10 million documents.
- Rewinding the whole database needs disk for the restored indexes next to the live ones, kept until Undo's 7 days end. Writes during it land in the set-aside indexes. Not available when Meilisearch serves TLS itself: restore a copy and bring documents back.
- Compacting needs a recent Meilisearch and about the index's size free on disk.
- Master key: without one, API keys can't be managed. Rowsafe never sets a master key or TLS, since both change how apps connect.