Backup
Backup operations allow administrators to protect platform data against loss.
ngdpbase has two separate layers of data that require different backup strategies.
A complete backup requires both.
1. Structured Data Backup ("Backup Data" button)
Found at Admin → Backup Management.
The Create & Download Backup button:
- Calls
backup()on every registered manager - Aggregates results into a single JSON document
- Compresses with gzip
- Downloads as
<timestamp>-amdwiki-backup.json.gz - Retains the last 10 backups on the server
What IS included
| Data | Notes |
|---|---|
| Configuration settings | All ngdpbase.* config keys |
| User accounts and roles | Usernames, hashed passwords, role assignments |
| Access control lists | Page-level permissions |
| Attachment metadata | Filenames, hashes, MIME types, page links |
| Search index | Rebuilt automatically if missing |
What is NOT included
| Data | How to back up |
|---|---|
Page files (.md) | Copy $SLOW_STORAGE/pages/ |
| Attachment binary files | Copy $SLOW_STORAGE/attachments/ |
| Page version history | Included in $SLOW_STORAGE/pages/ copy |
| Media files (photos/videos) | Back up media source folders at the OS/NAS level |
Important: The Backup Data button alone is not a complete backup.
Without a filesystem copy of your pages and attachments, you cannot fully restore the platform.
2. Filesystem Backup
Back up the following directories using your OS, NAS, or cloud backup tool:
| Directory | Contains |
|---|---|
$SLOW_STORAGE/pages/ | All page markdown files + version history |
$SLOW_STORAGE/attachments/ | All uploaded attachment binary files |
$FAST_STORAGE/ | Users, sessions, config overrides, logs, search index |
FAST_STORAGE and SLOW_STORAGE are set in your instance .env file.
3. Media Backup
Media files are read-only to ngdpbase — it indexes them but does not own them.
Back up media at the storage level (NAS, external drive, cloud).
The media index (media-index.json) is regenerated automatically on the next scan via
Admin → Media → Rescan. It does not need to be backed up explicitly.
Auto Backup
When Auto Backup is enabled, the server automatically runs the structured backup at the
configured time and day(s). Configure it at Admin → Backup Management.
Auto backup covers only structured data (same as the manual button).
It does not back up page files, attachments, or media.
Backup Configuration System has the following values:
ngdpbase.backup*
| Key | Value |
|---|---|
ngdpbase.backup.auto-backup |
false |
ngdpbase.backup.auto-backup-days |
daily |
ngdpbase.backup.auto-backup-interval |
86400000 |
ngdpbase.backup.auto-backup-time |
02:00 |
ngdpbase.backup.compress |
true |
ngdpbase.backup.directory |
${SLOW_STORAGE}/backups |
ngdpbase.backup.max-backups |
10 |
ngdpbase.backup.provider |
filebackupprovider |
Recommended Backup Process
Step 1 — Structured backup (weekly or more often)
- Go to Admin → Backup Management
- Click Create & Download Backup
- Store the
.json.gzfile in a safe location (cloud storage, external drive)
Or enable Auto Backup to have this run automatically on a schedule.
Step 2 — Filesystem backup (daily recommended)
Use your OS, NAS, or cloud backup tool to snapshot:
$SLOW_STORAGE/pages/$SLOW_STORAGE/attachments/$FAST_STORAGE/(or at minimum theusers/andconfig/subdirectories)
Step 3 — Media backup (as needed)
Back up your configured media folders independently.
Restore Process
Restore structured data
- Go to Admin → Data Management → Restore Data
- Upload the
.json.gzbackup file - The server calls
restore()on each manager in sequence
Stop all traffic to the platform before restoring in a production environment.
Restore replaces live data.
Restore page and attachment files
- Stop the server:
./server.sh stop - Copy backed-up
pages/andattachments/directories back to their original locations - Restart the server:
./server.sh start
Restore after complete loss (new machine)
- Install ngdpbase and configure
.envwith the sameFAST_STORAGEandSLOW_STORAGEpaths - Copy
pages/andattachments/from backup to$SLOW_STORAGE/ - Copy
users/andconfig/from backup to$FAST_STORAGE/ - Start the server and use Restore Data to load the
.json.gzstructured backup - Trigger a media rescan if applicable
No comments yet.