Skip to content

Commit 99f5740

Browse files
ddcashclaudeandlo
authored
Store data in addon_config so it persists across reinstalls (#10)
* Store data in addon_config so it persists across reinstalls Moves MeshCentral data, backups and recordings from /data to /config (the addon_config mapping, /addon_configs/<slug> on the host). Unlike /data, this folder survives add-on updates, rebuilds and uninstalls, and is reachable via the Samba addon_configs share. Includes a one-time migration from the old /data location. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Bump version and document persistent storage change Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: ddcash <25888001+ddcash@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: andlo <andlo@outlook.dk>
1 parent 0973fac commit 99f5740

5 files changed

Lines changed: 36 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

3-
## \[0.2.13\] - 2026-07-09
3+
## \[0.2.13\] - 2026-07-10
44

55
### Added
66

7-
- `plugins` — enable the MeshCentral plugin system. Adds a **Plugins** tab under **My Server** where administrators can install, update and remove plugins. Installed plugins are stored under `/data/meshcentral-data/plugins` and persist across restarts, updates and backups. Disabled by default.
7+
- `plugins` — enable the MeshCentral plugin system. Adds a **Plugins** tab under **My Server** where administrators can install, update and remove plugins. Installed plugins are stored in the add-on's persistent data folder and persist across restarts, updates and backups. Disabled by default.
8+
9+
### Changed
10+
11+
- **Persistent storage** — MeshCentral's database, certificates, backups and recordings now live in the add-on configuration folder (`/addon_configs/<slug>_meshcentral`, the `addon_config` mapping) instead of `/data`. This folder survives add-on updates, rebuilds and uninstall/reinstall, and is reachable via the Samba **addon_configs** share. Existing installs are migrated automatically on first start.
812

913
## \[0.2.12\] - 2026-07-07
1014

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ All settings are in the add-on **Configuration** tab. No JSON files to edit. The
157157

158158
### Backup
159159

160-
Backups are stored at `/data/meshcentral-backups` and are included in Home Assistant's standard backup.
160+
Backups are stored in the add-on configuration folder (see [Data storage](#data-storage)) and are included in Home Assistant's standard backup.
161161

162162
| Option | Default | Description |
163163
|--------|---------|-------------|
@@ -181,14 +181,16 @@ Only needed if you want account confirmation, password reset, and notification e
181181

182182
## Data storage
183183

184-
All data is stored under `/data` and included in HA's standard backup automatically.
184+
All data is stored in the add-on configuration folder — `/addon_configs/<slug>_meshcentral` on the host, also reachable via the Samba **addon_configs** share. Unlike `/data`, this folder **survives add-on updates, rebuilds and even uninstall/reinstall**, and is included in HA's standard backup automatically.
185185

186186
| Folder | Contents |
187187
|--------|----------|
188-
| `/data/meshcentral-data/` | Database and certificates |
189-
| `/data/meshcentral-data/meshcentral-files/` | Files shared via MeshCentral |
190-
| `/data/meshcentral-backups/` | Automatic server backups |
191-
| `/data/meshcentral-data/meshcentral-recordings/` | Session recordings |
188+
| `meshcentral-data/` | Database, certificates and the generated config.json |
189+
| `meshcentral-data/meshcentral-files/` | Files shared via MeshCentral |
190+
| `meshcentral-backups/` | Automatic server backups |
191+
| `meshcentral-data/meshcentral-recordings/` | Session recordings |
192+
193+
Existing installs are migrated automatically: on first start after this change, anything found in the old `/data` location is copied over.
192194

193195
## Troubleshooting
194196

meshcentral/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

3-
## \[0.2.13\] - 2026-07-09
3+
## \[0.2.13\] - 2026-07-10
44

55
### Added
66

7-
- `plugins` — enable the MeshCentral plugin system. Adds a **Plugins** tab under **My Server** where administrators can install, update and remove plugins. Installed plugins are stored under `/data/meshcentral-data/plugins` and persist across restarts, updates and backups. Disabled by default.
7+
- `plugins` — enable the MeshCentral plugin system. Adds a **Plugins** tab under **My Server** where administrators can install, update and remove plugins. Installed plugins are stored in the add-on's persistent data folder and persist across restarts, updates and backups. Disabled by default.
8+
9+
### Changed
10+
11+
- **Persistent storage** — MeshCentral's database, certificates, backups and recordings now live in the add-on configuration folder (`/addon_configs/<slug>_meshcentral`, the `addon_config` mapping) instead of `/data`. This folder survives add-on updates, rebuilds and uninstall/reinstall, and is reachable via the Samba **addon_configs** share. Existing installs are migrated automatically on first start.
812

913
## \[0.2.12\] - 2026-07-07
1014

meshcentral/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
"smtp_tls": "bool?"
104104
},
105105
"map": [
106-
"data:rw"
106+
"data:rw",
107+
"addon_config:rw"
107108
],
108109
"image": "ghcr.io/andlo/meshcentral-addon-{arch}",
109110
"homeassistant_api": false,

meshcentral/run.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@ BACKUP_KEEP=$(bashio::config 'backup_keep_days')
2727
SMTP_ENABLED=$(bashio::config 'smtp_enabled')
2828

2929
# ── Paths ─────────────────────────────────────────────────────────────────────
30-
DATA_PATH="/data/meshcentral-data"
30+
# Everything lives in the add-on config folder (/addon_configs/<slug>, mounted
31+
# at /config) so the database and settings persist across updates, rebuilds
32+
# and reinstalls — unlike /data, which is deleted on uninstall.
33+
DATA_PATH="/config/meshcentral-data"
3134
FILES_PATH="${DATA_PATH}/meshcentral-files"
32-
BACKUP_PATH="/data/meshcentral-backups"
35+
BACKUP_PATH="/config/meshcentral-backups"
3336
RECORDINGS_PATH="${DATA_PATH}/meshcentral-recordings"
3437
CONFIG_FILE="${DATA_PATH}/config.json"
3538

39+
# One-time migration from the old /data location
40+
if [ -d /data/meshcentral-data ] && [ ! -d "${DATA_PATH}" ]; then
41+
cp -a /data/meshcentral-data "${DATA_PATH}"
42+
bashio::log.info "Migrated MeshCentral data from /data to /config (persistent storage)."
43+
fi
44+
if [ -d /data/meshcentral-backups ] && [ ! -d "${BACKUP_PATH}" ]; then
45+
cp -a /data/meshcentral-backups "${BACKUP_PATH}"
46+
fi
47+
3648
# ── Hostname ──────────────────────────────────────────────────────────────────
3749
HOSTNAME=$(bashio::info.hostname)
3850
if bashio::config.has_value 'hostname'; then

0 commit comments

Comments
 (0)