Backup

Last modified: 3/11/2026

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:

  1. Calls backup() on every registered manager
  2. Aggregates results into a single JSON document
  3. Compresses with gzip
  4. Downloads as <timestamp>-amdwiki-backup.json.gz
  5. Retains the last 10 backups on the server

What IS included

DataNotes
Configuration settingsAll ngdpbase.* config keys
User accounts and rolesUsernames, hashed passwords, role assignments
Access control listsPage-level permissions
Attachment metadataFilenames, hashes, MIME types, page links
Search indexRebuilt automatically if missing

What is NOT included

DataHow to back up
Page files (.md)Copy $SLOW_STORAGE/pages/
Attachment binary filesCopy $SLOW_STORAGE/attachments/
Page version historyIncluded 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:

DirectoryContains
$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:

Configuration Values (8 matches) — 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


Step 1 — Structured backup (weekly or more often)

  1. Go to Admin → Backup Management
  2. Click Create & Download Backup
  3. Store the .json.gz file in a safe location (cloud storage, external drive)

Or enable Auto Backup to have this run automatically on a schedule.

Use your OS, NAS, or cloud backup tool to snapshot:

Step 3 — Media backup (as needed)

Back up your configured media folders independently.


Restore Process

Restore structured data

  1. Go to Admin → Data ManagementRestore Data
  2. Upload the .json.gz backup file
  3. 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

  1. Stop the server: ./server.sh stop
  2. Copy backed-up pages/ and attachments/ directories back to their original locations
  3. Restart the server: ./server.sh start

Restore after complete loss (new machine)

  1. Install ngdpbase and configure .env with the same FAST_STORAGE and SLOW_STORAGE paths
  2. Copy pages/ and attachments/ from backup to $SLOW_STORAGE/
  3. Copy users/ and config/ from backup to $FAST_STORAGE/
  4. Start the server and use Restore Data to load the .json.gz structured backup
  5. Trigger a media rescan if applicable

More Information