GoCMS uses a snapshot service to export and import the core CMS dataset as a single JSON bundle. This is the supported autonomous backup path for operators who cannot rely on external backup SaaS.
Implementation: internal/application/snapshot.
- Version string:
gocms.snapshot.v1(SnapshotVersionconstant). - Top-level fields: exported timestamp,
backupmetadata, arrays for content, content types, taxonomy definitions, taxonomy terms, media, users, settings, menus.
Included in each export:
generated_atprovider_profile— storage profile string passed viaWithProviderProfile(from bootstrap).item_counts— counts per entity group.validation_result— export validation summary (currentlyokwhen export completes).
Import order inside Import applies dependencies safely: content types and taxonomy definitions before terms; users and settings before content lists; menus and content entries last within the bundle logic.
Plugin id: json-import-export. Registered from internal/plugins/jsonimportexport/plugin.go.
Requires capability settings.manage for all snapshot routes.
- GET
/go-admin/plugins/json-import-export/export - Response:
application/jsonattachmentgocms-content-snapshot.json.
- POST
/go-admin/plugins/json-import-export/import - Multipart form field
snapshot— file upload (max 8 MiB parsed by handler). - Success: HTTP 204 No Content.
When jsondir site package provider is configured (SitePackageDir / plugin setting json-import-export.site_package_dir):
- POST
/go-admin/plugins/json-import-export/export-site-package— writes current snapshot via site package provider. - POST
/go-admin/plugins/json-import-export/import-site-package— loads bundle from site package then imports.
Admin UI actions also appear on Settings and Headless screens (screen ids settings, headless) when the plugin registers screen actions.
- Treat exports as sensitive: they include user records, password hashes, recovery metadata, and settings — protect files like database dumps.
- Restore strategy: stop writes if possible → import snapshot → verify health and audit trail → rotate secrets if the backup might be stale or exposed.
- Cross-provider migration: export from old profile → deploy new binary/config → import into new store (migrations.md).
- Media binaries: snapshot carries media metadata and URLs; large binaries may live outside the JSON bundle depending on provider — verify asset URLs and blob stores separately after restore.
The core registers a snapshot capability health check: if the active storage profile disables snapshots in bootstrap capabilities, the check fails (health-checks.md).
- cms-capabilities.md — plugins and presets.
- migrations.md — schema evolution alongside restores.
- audit-logs.md — auditing administrative restores if extended in your deployment.