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 12:43] – [Repos tab] 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 101: | Line 101: | ||
| === Create === | === Create === | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-4.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-2.png? |
| Allows you to create and initialize a Borg // | Allows you to create and initialize a Borg // | ||
| Line 113: | Line 113: | ||
| * ENCRYPTION. Check this box if you want the // | * ENCRYPTION. Check this box if you want the // | ||
| * SKIP INIT. If you are trying to import an already created // | * SKIP INIT. If you are trying to import an already created // | ||
| + | * STORAGE QUOTA: Set the maximum capacity of the repository. 5G, 1.5T as examples. Leave blank for no quota. | ||
| * Press the SAVE button. You will return to the REPOS form where a line should appear with the values of your new // | * Press the SAVE button. You will return to the REPOS form where a line should appear with the values of your new // | ||
| Line 125: | Line 126: | ||
| < | < | ||
| Warning | Warning | ||
| - | </ | + | </ |
| Before changing the location of a // | Before changing the location of a // | ||
| </ | </ | ||
| Line 137: | Line 138: | ||
| ---- | ---- | ||
| + | |||
| + | === Change quota === | ||
| + | |||
| + | Allows you to change the quota of a // | ||
| + | |||
| + | * TYPE | ||
| + | * NAME: Specifies the name of the repository for which you want to change the quota. | ||
| + | * CURRENT QUOTA: Current quota value. | ||
| + | * NEW QUOTA: Desired quota value. | ||
| + | * Press CHANGE to apply changes. | ||
| + | |||
| + | ---- | ||
| + | |||
| === Remove === | === Remove === | ||
| Line 144: | Line 158: | ||
| < | < | ||
| Note | Note | ||
| - | </ | + | </ |
| Deleting the repository will not delete the folder or its contents in the file system.< | Deleting the repository will not delete the folder or its contents in the file system.< | ||
| If there are ARCHIVES configured in this REPOSITORY the FILES will be removed from the plugin configuration but the files in the server file system will not be removed. | If there are ARCHIVES configured in this REPOSITORY the FILES will be removed from the plugin configuration but the files in the server file system will not be removed. | ||
| Line 159: | Line 173: | ||
| < | < | ||
| Note | Note | ||
| - | </ | + | </ |
| When you delete an entire repository, the security information and local cache for it (if any) are also deleted. | When you delete an entire repository, the security information and local cache for it (if any) are also deleted. | ||
| </ | </ | ||
| Line 183: | Line 197: | ||
| < | < | ||
| Info | Info | ||
| - | </ | + | </ |
| The check command verifies the consistency of a repository and its archives. It consists of two major steps:< | The check command verifies the consistency of a repository and its archives. It consists of two major steps:< | ||
| 1. Checking the consistency of the repository itself. This includes checking the segment magic headers, and both the metadata and data of all objects in the segments. The read data is checked by size and CRC. Bit rot and other types of accidental damage can be detected this way. When checking a remote repository, please note that the checks run on the server and do not cause significant network traffic.< | 1. Checking the consistency of the repository itself. This includes checking the segment magic headers, and both the metadata and data of all objects in the segments. The read data is checked by size and CRC. Bit rot and other types of accidental damage can be detected this way. When checking a remote repository, please note that the checks run on the server and do not cause significant network traffic.< | ||
| Line 198: | Line 212: | ||
| < | < | ||
| Warning | Warning | ||
| - | </ | + | </ |
| Do not confuse data integrity of an ARCHIVE in a REPOSITORY with data integrity of the backup source (your file system on the server where the data from which the backup is made is stored).< | Do not confuse data integrity of an ARCHIVE in a REPOSITORY with data integrity of the backup source (your file system on the server where the data from which the backup is made is stored).< | ||
| < | < | ||
| Line 247: | Line 261: | ||
| < | < | ||
| Note | Note | ||
| - | </ | + | </ |
| Borg does not automatically compact segments in the // | Borg does not automatically compact segments in the // | ||
| < | < | ||
| Line 272: | Line 286: | ||
| < | < | ||
| Note | Note | ||
| - | </ | + | </ |
| Accessing an encrypted repository requires the repository' | Accessing an encrypted repository requires the repository' | ||
| < | < | ||
| Line 290: | Line 304: | ||
| < | < | ||
| Note | Note | ||
| - | </ | + | </ |
| The plugin does not apply any permissions arguments to this command, so all files and folders will have their original permissions. | The plugin does not apply any permissions arguments to this command, so all files and folders will have their original permissions. | ||
| </ | </ | ||
| Line 322: | Line 336: | ||
| < | < | ||
| \\ | \\ | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-5.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-5.png? |
| ---- | ---- | ||
| Line 328: | Line 342: | ||
| === Create === | === Create === | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-6.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-6.png? |
| Allows you to create a // | Allows you to create a // | ||
| * ENABLE: Determines whether this schedule will run automatically or not. | * ENABLE: Determines whether this schedule will run automatically or not. | ||
| Line 361: | Line 375: | ||
| * daily jobs start at 5:30 (4 + 1 hour + 30 mins) | * daily jobs start at 5:30 (4 + 1 hour + 30 mins) | ||
| * hourly start at 5 mins after the hour every hour | * hourly start at 5 mins after the hour every hour | ||
| + | |||
| ---- | ---- | ||
| Line 367: | Line 382: | ||
| Allows you to edit a // | Allows you to edit a // | ||
| * A dialog box will open with all the //ARCHIVE// settings and you can edit them. | * A dialog box will open with all the //ARCHIVE// settings and you can edit them. | ||
| - | * Press the SAVE button | + | * Press SAVE to apply changes. |
| ---- | ---- | ||
| Line 384: | Line 399: | ||
| Link to official documentation -> [[https:// | Link to official documentation -> [[https:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | === Dry run === | ||
| + | |||
| + | This allows you to run a backup to see the result without making any changes. Select a ARCHIVE and press **DRY RUN**. | ||
| ---- | ---- | ||
| Line 410: | Line 431: | ||
| < | < | ||
| \\ | \\ | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-7.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-7.png? |
| ---- | ---- | ||
| Line 452: | Line 473: | ||
| === Create a local REPOSITORY === | === Create a local REPOSITORY === | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-4.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-2.png? |
| The first step is to create the // | The first step is to create the // | ||
| * NAME: '' | * NAME: '' | ||
| Line 475: | Line 496: | ||
| === Create a ARCHIVE === | === Create a ARCHIVE === | ||
| - | {{ :omv7:omv7_plugins:borgbackup7-8.jpg? | + | {{ :omv8:omv8_plugins:borgbackup8-8.png? |
| The second step is to create a // | The second step is to create a // | ||
| Line 543: | 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 ===== | ||