Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| omv8:omv8_plugins:borgbackup [2025/12/28 15:21] – [Create a ARCHIVE] chente | omv8:omv8_plugins:borgbackup [2026/06/04 20:53] (current) – [Step 1.2 — Create a user for the backup client to log in as] ryecoaaron | ||
|---|---|---|---|
| Line 496: | Line 496: | ||
| === Create a ARCHIVE === | === Create a ARCHIVE === | ||
| - | {{ : | + | {{ : |
| The second step is to create a // | The second step is to create a // | ||
| Line 564: | Line 564: | ||
| ---- | ---- | ||
| + | |||
| + | |||
| + | ====== Backing up one OMV server to another with BorgBackup ====== | ||
| + | |||
| + | This guide walks you through setting up an **automatic, | ||
| + | |||
| + | You will use two machines: | ||
| + | |||
| + | ^ Role ^ What it does ^ What you configure ^ | ||
| + | | **Backup server** | Stores the backups. Hosts the repository. | The **Serve** tab | | ||
| + | | **Backup client** | The server whose data you want to protect. Pushes backups out. | The **Repos** + **Archives** tabs | | ||
| + | |||
| + | <note tip> | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | Both machines need the **openmediavault‑borgbackup** plugin installed (version 8.2 or later, which adds the Serve tab). | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Part 1 — On the BACKUP SERVER (the destination) ===== | ||
| + | |||
| + | This is the machine that will //receive and keep// the backups. | ||
| + | |||
| + | ==== Step 1.1 — Enable SSH ==== | ||
| + | |||
| + | - Go to **Services → SSH**. | ||
| + | - Tick **Enable** and **Save / Apply**. | ||
| + | |||
| + | The backup client will connect to this machine over SSH. | ||
| + | |||
| + | ==== Step 1.2 — Create a user for the backup client to log in as ==== | ||
| + | |||
| + | You can reuse an existing user, but a dedicated one is cleaner. | ||
| + | |||
| + | - Go to **Users → Users → Create**. | ||
| + | - Name it something like '' | ||
| + | - Give it a password (it won't be used for backups, but OMV requires one). | ||
| + | - Ensure the user is in the '' | ||
| + | - **Save**. | ||
| + | |||
| + | ==== Step 1.3 — Create a shared folder to hold the backups ==== | ||
| + | |||
| + | - Go to **Storage → Shared Folders → Create**. | ||
| + | - Name it e.g. '' | ||
| + | - **Save**. | ||
| + | - Select the folder, click **Permissions**, | ||
| + | |||
| + | ==== Step 1.4 — Add the client on the Serve tab ==== | ||
| + | |||
| + | - Go to **Services → BorgBackup → Serve → Create**. | ||
| + | - Fill in the form: | ||
| + | * **Name** — a label for this client, e.g. '' | ||
| + | * **Login user** — select '' | ||
| + | * **Target shared folder** — select '' | ||
| + | * **Append‑only** — leave **ticked** (recommended). | ||
| + | * **Storage quota** — optional, e.g. '' | ||
| + | * **Client public key** — you have two choices: | ||
| + | * **Easiest: | ||
| + | * **Or** paste the client' | ||
| + | - Click **Save**, then **Apply** the pending configuration change. | ||
| + | |||
| + | ==== Step 1.5 — Download the private key (only if you left the key blank) ==== | ||
| + | |||
| + | If you let the plugin generate the key: | ||
| + | |||
| + | - Back on the **Serve** list, select your new '' | ||
| + | - Click **Download private key** (the download icon). | ||
| + | - Save the file — you'll move it to the backup client in Part 2. | ||
| + | |||
| + | < | ||
| + | The **Private key stored** column shows a check mark for clients whose key was generated here and can be downloaded. Keep this file safe; treat it like a password. | ||
| + | </ | ||
| + | |||
| + | The backup server is now ready and listening. Note down: | ||
| + | |||
| + | * the server' | ||
| + | * the **login user** ('' | ||
| + | * the **full path of the target shared folder** — find it under **Storage → Shared Folders** (e.g. ''/ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Part 2 — On the BACKUP CLIENT (the source) ===== | ||
| + | |||
| + | This is the machine whose data you want to protect. | ||
| + | |||
| + | ==== Step 2.1 — Put the private key on the client ==== | ||
| + | |||
| + | The BorgBackup plugin runs as **root**, so the key must be readable by root. | ||
| + | |||
| + | - Copy the private key you downloaded to the client, for example to ''/ | ||
| + | - Set tight permissions (from a root shell, or '' | ||
| + | |||
| + | <code bash> | ||
| + | install -m 600 / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | **Alternative (key never leaves the client):** instead of generating the key on the server, generate it here with '' | ||
| + | </ | ||
| + | |||
| + | ==== Step 2.2 — Tell Borg which key and host to use ==== | ||
| + | |||
| + | - Go to **Services → BorgBackup → Environment Variables → Create**. | ||
| + | - Add: | ||
| + | * **Name:** '' | ||
| + | * **Value:** '' | ||
| + | * **Repo:** you can set this after creating the repo in the next step, or choose **Repo creation** for now and revisit. | ||
| + | - **Save**. | ||
| + | |||
| + | This tells Borg to connect using your key and to trust the server' | ||
| + | |||
| + | ==== Step 2.3 — Create the remote repository ==== | ||
| + | |||
| + | - Go to **Services → BorgBackup → Repos → Create**. | ||
| + | - Fill in: | ||
| + | * **Name** — e.g. '' | ||
| + | * **Type** — **Remote**. | ||
| + | * **Remote path** — this points at a //new sub‑folder inside the server' | ||
| + | * **Passphrase** — set a strong passphrase. **Write it down somewhere safe** — without it your backups cannot be restored. | ||
| + | * **Encryption** — tick it (recommended). | ||
| + | * **Skip init** — leave unticked (this is a brand‑new repo). | ||
| + | - Make sure your '' | ||
| + | - **Save**. The plugin will create (initialise) the repository on the backup server. | ||
| + | |||
| + | < | ||
| + | If this step fails with a connection or permission error, jump to **Troubleshooting** below. | ||
| + | </ | ||
| + | |||
| + | ==== Step 2.4 — Create a backup archive (what to back up, and when) ==== | ||
| + | |||
| + | - Go to **Services → BorgBackup → Archives → Create**. | ||
| + | - Fill in: | ||
| + | * **Name** — e.g. '' | ||
| + | * **Repo** — select the '' | ||
| + | * **Include** — the folders to back up, one per line (e.g. ''/ | ||
| + | * **Exclude** — anything to skip (optional). | ||
| + | * **Schedule** — pick a time, e.g. **Daily at 03:00**. | ||
| + | * Compression and other options can be left at their defaults. | ||
| + | - **Save** and **Apply**. | ||
| + | |||
| + | ==== Step 2.5 — Run it once to confirm ==== | ||
| + | |||
| + | - Select the '' | ||
| + | - Watch the live output. A successful run ends with backup statistics. | ||
| + | |||
| + | Your OMV‑to‑OMV backup is now running automatically on the schedule you set. 🎉 | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Pruning and housekeeping (important with append‑only) ===== | ||
| + | |||
| + | Because the client connects in **append‑only** mode, it can //add// backups but **cannot delete old ones** — that's what protects you from ransomware. Old backups are therefore removed and space reclaimed **from the backup server side**: | ||
| + | |||
| + | * On the **backup server**, go to **Services → BorgBackup → Compact** and schedule a periodic compaction of the '' | ||
| + | * Retention (how many daily/ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Troubleshooting ===== | ||
| + | |||
| + | **" | ||
| + | |||
| + | * Confirm SSH is enabled on the backup server (Step 1.1). | ||
| + | * Confirm the private key path in '' | ||
| + | * Confirm the public key matches the client entry on the server' | ||
| + | |||
| + | **" | ||
| + | |||
| + | * The BorgBackup plugin must be installed on the **backup server** too — the forced '' | ||
| + | |||
| + | **" | ||
| + | |||
| + | * The **Remote path** in Step 2.3 must be //inside// the target shared folder you chose on the Serve tab. Check the path matches exactly. | ||
| + | |||
| + | **Permission denied writing the repository** | ||
| + | |||
| + | * The Serve **Login user** needs read/write permission on the target shared folder (Step 1.3, Permissions). | ||
| + | |||
| + | **Where did the access actually get configured? | ||
| + | |||
| + | * On the backup server, each Serve client becomes a single restricted line in the login user's '' | ||
| + | |||
| + | < | ||
| + | command=" | ||
| + | </ | ||
| + | |||
| + | This is what confines the client to '' | ||
| ===== A Closing Note ===== | ===== A Closing Note ===== | ||