---
title: Backup and restore | Space Works docs
description: One guide for keeping a Space Works install recoverable: what is backed up, how often, where the copies go, how to restore each kind of install, how to go…
url: https://spaceworkslabs.tech/docs/space-works/backup-and-restore/
updated: 2026-11-16
---

[Space Works](https://spaceworkslabs.tech/docs/space-works/) Start here
- [What Space Works is](https://spaceworkslabs.tech/docs/space-works/guide-overview/)
- [Getting started](https://spaceworkslabs.tech/docs/space-works/guide-getting-started/)
- [FAQ and troubleshooting](https://spaceworkslabs.tech/docs/space-works/guide-faq/)
- [Glossary](https://spaceworkslabs.tech/docs/space-works/guide-glossary/)
- [Sign-in methods](https://spaceworkslabs.tech/docs/space-works/guide-sign-in-methods/)
Tutorials
- [Tutorials overview](https://spaceworkslabs.tech/docs/space-works/tutorials-overview/)
- [Set up your first makerspace](https://spaceworkslabs.tech/docs/space-works/tutorials-first-makerspace/)
- [Lend your first tool](https://spaceworkslabs.tech/docs/space-works/tutorials-lend-your-first-tool/)
- [Run your first event](https://spaceworkslabs.tech/docs/space-works/tutorials-first-event/)
- [Take room bookings](https://spaceworkslabs.tech/docs/space-works/tutorials-room-bookings/)
- [Take payments](https://spaceworkslabs.tech/docs/space-works/tutorials-take-payments/)
- [Machines and inductions](https://spaceworkslabs.tech/docs/space-works/tutorials-machines-and-inductions/)
- [Connect analytics](https://spaceworkslabs.tech/docs/space-works/tutorials-connect-analytics/)
Modules
- [Areas and modules overview](https://spaceworkslabs.tech/docs/space-works/modules-overview/)
- [Inventory](https://spaceworkslabs.tech/docs/space-works/modules-inventory/)
- [Machines](https://spaceworkslabs.tech/docs/space-works/modules-machines/)
- [Presence](https://spaceworkslabs.tech/docs/space-works/modules-presence/)
- [Events](https://spaceworkslabs.tech/docs/space-works/modules-events/)
- [Bookings](https://spaceworkslabs.tech/docs/space-works/modules-bookings/)
- [Shop](https://spaceworkslabs.tech/docs/space-works/modules-shop/)
- [Memberships](https://spaceworkslabs.tech/docs/space-works/modules-memberships/)
- [Payments](https://spaceworkslabs.tech/docs/space-works/modules-payments/)
- [Donations and sponsors](https://spaceworkslabs.tech/docs/space-works/modules-donations/)
- [Analytics and reports](https://spaceworkslabs.tech/docs/space-works/modules-analytics/)
- [Notifications and messaging](https://spaceworkslabs.tech/docs/space-works/modules-notifications-and-messaging/)
- [Organizations](https://spaceworkslabs.tech/docs/space-works/modules-organizations/)
- [Backup and migration](https://spaceworkslabs.tech/docs/space-works/modules-backup-and-migration/)
- [API clients and integrations](https://spaceworkslabs.tech/docs/space-works/modules-api-clients/)
- [Platform and superadmin](https://spaceworkslabs.tech/docs/space-works/modules-platform/)
- [Choosing modules](https://spaceworkslabs.tech/docs/space-works/choosing-modules/)
How-to guides
- [How-to guides](https://spaceworkslabs.tech/docs/space-works/how-to-overview/)
- [Use your own domain with HTTPS](https://spaceworkslabs.tech/docs/space-works/how-to-custom-domain/)
- [Send email through your own provider](https://spaceworkslabs.tech/docs/space-works/how-to-email-sending/)
- [Send alerts to a Telegram group](https://spaceworkslabs.tech/docs/space-works/how-to-telegram-alerts/)
- [Privacy and terms pages](https://spaceworkslabs.tech/docs/space-works/how-to-privacy-and-terms/)
- [Set up SMS and WhatsApp](https://spaceworkslabs.tech/docs/space-works/how-to-sms-whatsapp/)
- [Choose and configure sign-in methods](https://spaceworkslabs.tech/docs/space-works/how-to-sign-in-methods/)
- [Two-step sign-in for staff and superadmins](https://spaceworkslabs.tech/docs/space-works/how-to-staff-and-superadmin-mfa/)
- [Turn an area or add-on on or off safely](https://spaceworkslabs.tech/docs/space-works/how-to-turn-areas-on-off/)
- [Give someone a role](https://spaceworkslabs.tech/docs/space-works/how-to-roles-and-handover/)
- [Import members and inventory from a spreadsheet](https://spaceworkslabs.tech/docs/space-works/how-to-import-members-and-inventory/)
- [Export your data](https://spaceworkslabs.tech/docs/space-works/how-to-export-your-data/)
- [Set up offsite backups and restore](https://spaceworkslabs.tech/docs/space-works/how-to-offsite-backups/)
- [Move a space to another server](https://spaceworkslabs.tech/docs/space-works/how-to-move-a-space/)
- [Add Apple Wallet and Google Wallet passes](https://spaceworkslabs.tech/docs/space-works/how-to-wallet-passes/)
- [Remove card photo backgrounds](https://spaceworkslabs.tech/docs/space-works/how-to-background-eraser/)
- [Design cards and certificates](https://spaceworkslabs.tech/docs/space-works/how-to-design-cards-and-certificates/)
- [Add web analytics, replay and error tracking per space](https://spaceworkslabs.tech/docs/space-works/how-to-web-telemetry/)
- [Set prices, rate cards and fees](https://spaceworkslabs.tech/docs/space-works/how-to-rate-cards-and-fees/)
- [Set up guest passes and waivers](https://spaceworkslabs.tech/docs/space-works/how-to-guest-passes-and-waivers/)
- [Admit minors with guardian consent](https://spaceworkslabs.tech/docs/space-works/how-to-minors-and-guardian-consent/)
- [Let people check in by location](https://spaceworkslabs.tech/docs/space-works/how-to-presence-check-in/)
- [Rotate encryption and secret keys](https://spaceworkslabs.tech/docs/space-works/how-to-rotate-keys/)
- [Run behind a reverse proxy and reach the control plane](https://spaceworkslabs.tech/docs/space-works/how-to-reverse-proxy-and-control-plane/)
- [Upgrade SpaceWorks safely](https://spaceworkslabs.tech/docs/space-works/how-to-upgrade-safely/)
- [The SpaceWorks front page and the Features page](https://spaceworkslabs.tech/docs/space-works/how-to-front-page-and-features/)
- [The public profile](https://spaceworkslabs.tech/docs/space-works/how-to-member-profile/)
- [Usernames](https://spaceworkslabs.tech/docs/space-works/how-to-usernames/)
- [Public space page and display screens](https://spaceworkslabs.tech/docs/space-works/how-to-display-screens/)
- [Show your screens on Anthias](https://spaceworkslabs.tech/docs/space-works/how-to-anthias/)
- [Give members machine access](https://spaceworkslabs.tech/docs/space-works/how-to-machine-access/)
- [Manage device adapters](https://spaceworkslabs.tech/docs/space-works/how-to-adapter-console/)
- [Use a shelf pointer](https://spaceworkslabs.tech/docs/space-works/how-to-shelf-pointer/)
- [Set up machine types and their consumables](https://spaceworkslabs.tech/docs/space-works/how-to-machine-consumables/)
- [Machine printing and connecting machines](https://spaceworkslabs.tech/docs/space-works/how-to-machine-printing/)
- [Log machine use for an event](https://spaceworkslabs.tech/docs/space-works/how-to-machine-use-for-events/)
- [Equipment kits and contextual requests](https://spaceworkslabs.tech/docs/space-works/equipment-kits/)
- [Equipment loan context](https://spaceworkslabs.tech/docs/space-works/equipment-contexts/)
- [Loan policy, renewal and reminders](https://spaceworkslabs.tech/docs/space-works/loan-policy/)
- [Sign-in, identity and borrowing](https://spaceworkslabs.tech/docs/space-works/sign-in-and-borrowing/)
Members
- [Getting started with Space Works](https://spaceworkslabs.tech/docs/space-works/member-getting-started/)
- [Sign in, create an account and manage it](https://spaceworkslabs.tech/docs/space-works/member-sign-in-and-account/)
- [Two-step sign-in and passkeys](https://spaceworkslabs.tech/docs/space-works/member-two-step-sign-in/)
- [Security emails and "This wasn't me](https://spaceworkslabs.tech/docs/space-works/member-security-alerts/)
- [Join a makerspace](https://spaceworkslabs.tech/docs/space-works/member-join-the-space/)
- [Renew, cancel or leave your membership](https://spaceworkslabs.tech/docs/space-works/member-renewals-and-leaving/)
- [Your member area](https://spaceworkslabs.tech/docs/space-works/member-member-area/)
- [Your member card and My cards](https://spaceworkslabs.tech/docs/space-works/member-member-card/)
- [Join an ID programme](https://spaceworkslabs.tech/docs/space-works/member-id-programmes/)
- [Borrow tools from Inventory](https://spaceworkslabs.tech/docs/space-works/member-borrow-tools/)
- [Borrow or return a tool yourself](https://spaceworkslabs.tech/docs/space-works/member-self-checkout/)
- [Book a room or resource](https://spaceworkslabs.tech/docs/space-works/member-book-a-room/)
- [Find and register for events](https://spaceworkslabs.tech/docs/space-works/member-events/)
- [Buy tickets and manage your orders](https://spaceworkslabs.tech/docs/space-works/member-event-orders/)
- [Confirm your place, join the crew, or review applications](https://spaceworkslabs.tech/docs/space-works/member-event-participation/)
- [Take part in a hackathon](https://spaceworkslabs.tech/docs/space-works/member-hackathons/)
- [Request a machine job](https://spaceworkslabs.tech/docs/space-works/member-machine-jobs/)
- [Use a machine yourself](https://spaceworkslabs.tech/docs/space-works/member-machine-sessions/)
- [My machine access](https://spaceworkslabs.tech/docs/space-works/member-machine-access/)
- [Your machine certifications](https://spaceworkslabs.tech/docs/space-works/member-certifications/)
- [Tell the space something is broken](https://spaceworkslabs.tech/docs/space-works/member-something-broken/)
- [Pay what you owe](https://spaceworkslabs.tech/docs/space-works/member-pay-what-you-owe/)
- [Support a space with a gift or a pledge](https://spaceworkslabs.tech/docs/space-works/member-donate/)
- [Calendar links](https://spaceworkslabs.tech/docs/space-works/member-calendar-links/)
- [Personal API tokens and connected apps](https://spaceworkslabs.tech/docs/space-works/member-api-access-and-apps/)
- [Buy from the space's shop](https://spaceworkslabs.tech/docs/space-works/member-shop/)
- [Check in when you arrive](https://spaceworkslabs.tech/docs/space-works/member-check-in/)
- [Inbox and notifications](https://spaceworkslabs.tech/docs/space-works/member-inbox-and-notifications/)
- [Your public profile](https://spaceworkslabs.tech/docs/space-works/member-public-profile/)
- [Your data and privacy](https://spaceworkslabs.tech/docs/space-works/member-your-data/)
Space managers
- [First steps for a new space](https://spaceworkslabs.tech/docs/space-works/space-manager-first-steps/)
- [Choose modules and features](https://spaceworkslabs.tech/docs/space-works/space-manager-modules-and-features/)
- [Settings, and who can change them](https://spaceworkslabs.tech/docs/space-works/space-manager-settings-and-grants/)
- [Add staff and give them roles](https://spaceworkslabs.tech/docs/space-works/space-manager-staff-and-roles/)
- [Machine access](https://spaceworkslabs.tech/docs/space-works/space-manager-machine-access/)
- [Two-step sign-in for staff](https://spaceworkslabs.tech/docs/space-works/space-manager-staff-two-step/)
- [Security settings for your space](https://spaceworkslabs.tech/docs/space-works/space-manager-security-settings/)
- [Public site, branding, hours and your domain](https://spaceworkslabs.tech/docs/space-works/space-manager-public-site-and-branding/)
- [Device adapters](https://spaceworkslabs.tech/docs/space-works/space-manager-device-adapters/)
- [Notifications, chat rooms and email](https://spaceworkslabs.tech/docs/space-works/space-manager-notifications-and-channels/)
- [Membership plans and admissions](https://spaceworkslabs.tech/docs/space-works/space-manager-membership-plans-and-admissions/)
- [Import members from a file or a Google Sheet](https://spaceworkslabs.tech/docs/space-works/space-manager-member-import/)
- [Member cards and card designs](https://spaceworkslabs.tech/docs/space-works/space-manager-member-cards/)
- [Run an ID programme for an organisation](https://spaceworkslabs.tech/docs/space-works/space-manager-id-programmes/)
- [Reports, saved views and the audit log](https://spaceworkslabs.tech/docs/space-works/space-manager-insights-and-audit/)
- [Pair a display screen](https://spaceworkslabs.tech/docs/space-works/space-manager-display-screens/)
- [API access and signed webhooks](https://spaceworkslabs.tech/docs/space-works/space-manager-api-and-webhooks/)
- [Back up, restore and export your space](https://spaceworkslabs.tech/docs/space-works/space-manager-backups-and-exports/)
- [The help centre and its switch](https://spaceworkslabs.tech/docs/space-works/space-manager-help-centre/)
Inventory managers
- [Review borrow requests](https://spaceworkslabs.tech/docs/space-works/inventory-manager-requests-queue/)
- [Hand over a request](https://spaceworkslabs.tech/docs/space-works/inventory-manager-issue-a-request/)
- [Take a return](https://spaceworkslabs.tech/docs/space-works/inventory-manager-process-a-return/)
- [Items, quantities and categories](https://spaceworkslabs.tech/docs/space-works/inventory-manager-inventory-and-categories/)
- [QR labels and the scanner](https://spaceworkslabs.tech/docs/space-works/inventory-manager-qr-tools/)
- [Stocktakes and stock transfers](https://spaceworkslabs.tech/docs/space-works/inventory-manager-stocktake-and-transfers/)
- [Containers and kits](https://spaceworkslabs.tech/docs/space-works/inventory-manager-containers-and-kits/)
- [Bulk-import items](https://spaceworkslabs.tech/docs/space-works/inventory-manager-bulk-import/)
- [To-Buy, warranties and vendors](https://spaceworkslabs.tech/docs/space-works/inventory-manager-to-buy-warranty-vendors/)
- [Consumables](https://spaceworkslabs.tech/docs/space-works/inventory-manager-consumables/)
- [The To-be-fixed shelf](https://spaceworkslabs.tech/docs/space-works/inventory-manager-to-be-fixed/)
- [The ledger and accountability](https://spaceworkslabs.tech/docs/space-works/inventory-manager-ledger-and-accountability/)
- [Inventory loan rules](https://spaceworkslabs.tech/docs/space-works/inventory-manager-lending-settings/)
Machine managers
- [Machine types and machines](https://spaceworkslabs.tech/docs/space-works/machine-manager-machines-and-types/)
- [Run the job queue](https://spaceworkslabs.tech/docs/space-works/machine-manager-job-requests-and-quotes/)
- [Machine sessions](https://spaceworkslabs.tech/docs/space-works/machine-manager-machine-sessions/)
- [Certifications](https://spaceworkslabs.tech/docs/space-works/machine-manager-certifications/)
- [Machine access](https://spaceworkslabs.tech/docs/space-works/machine-manager-machine-access/)
- [Machine maintenance](https://spaceworkslabs.tech/docs/space-works/machine-manager-maintenance/)
- [Connected devices](https://spaceworkslabs.tech/docs/space-works/machine-manager-devices-and-integrations/)
Event managers
- [Assigned resources](https://spaceworkslabs.tech/docs/space-works/event-manager-assigned-resources/)
- [Create and publish an event](https://spaceworkslabs.tech/docs/space-works/event-manager-create-an-event/)
- [Ticket types, promo codes and invitations](https://spaceworkslabs.tech/docs/space-works/event-manager-tickets-and-invites/)
- [Ticket orders, add-ons and series passes](https://spaceworkslabs.tech/docs/space-works/event-manager-paid-ticketing/)
- [Check people in](https://spaceworkslabs.tech/docs/space-works/event-manager-check-in/)
- [Applications and review stages](https://spaceworkslabs.tech/docs/space-works/event-manager-applications-and-review/)
- [Attendance confirmation, re-accepting and crew](https://spaceworkslabs.tech/docs/space-works/event-manager-attendance-and-crew/)
- [Hackathons and judging](https://spaceworkslabs.tech/docs/space-works/event-manager-hackathons-and-judging/)
- [Finalists, prizes, entry fees and saved views](https://spaceworkslabs.tech/docs/space-works/event-manager-judging-extras/)
- [Certificates, event cards, tickets and feedback](https://spaceworkslabs.tech/docs/space-works/event-manager-cards-certificates-feedback/)
- [Design event badges](https://spaceworkslabs.tech/docs/space-works/event-manager-badge-designer/)
- [Broadcasts, websites, short links and partners](https://spaceworkslabs.tech/docs/space-works/event-manager-broadcasts-and-websites/)
- [Venue fees for outside organisers](https://spaceworkslabs.tech/docs/space-works/event-manager-venue-fees/)
Booking managers
- [Rooms and resources](https://spaceworkslabs.tech/docs/space-works/booking-manager-resources/)
- [Booking requests and changes](https://spaceworkslabs.tech/docs/space-works/booking-manager-booking-requests/)
- [Arrivals, passes and confirmations](https://spaceworkslabs.tech/docs/space-works/booking-manager-arrivals-and-passes/)
- [Resource staff, websites and broadcasts](https://spaceworkslabs.tech/docs/space-works/booking-manager-resource-staff-and-websites/)
- [Resource analytics and room upkeep](https://spaceworkslabs.tech/docs/space-works/booking-manager-analytics-and-upkeep/)
Shop managers
- [Set up the shop](https://spaceworkslabs.tech/docs/space-works/shop-manager-set-up-the-shop/)
- [Products, prices and stock](https://spaceworkslabs.tech/docs/space-works/shop-manager-products-and-stock/)
- [Sell at the front desk and cash up](https://spaceworkslabs.tech/docs/space-works/shop-manager-front-desk-sales/)
- [Orders, pickups and returns](https://spaceworkslabs.tech/docs/space-works/shop-manager-orders-and-returns/)
Handover and technicians
- [The front-desk console](https://spaceworkslabs.tech/docs/space-works/handover-front-desk-console/)
- [Direct handout](https://spaceworkslabs.tech/docs/space-works/handover-direct-handout/)
- [Job pickups](https://spaceworkslabs.tech/docs/space-works/handover-job-handover/)
- [Kiosk stations](https://spaceworkslabs.tech/docs/space-works/handover-kiosk-stations/)
- [Your repair jobs](https://spaceworkslabs.tech/docs/space-works/technician-your-jobs/)
- [Run scheduled maintenance](https://spaceworkslabs.tech/docs/space-works/technician-run-maintenance/)
- [Take something out of service](https://spaceworkslabs.tech/docs/space-works/technician-service-state/)
- [Manage repairs and technicians](https://spaceworkslabs.tech/docs/space-works/technician-managing-repairs/)
Finance and organisations
- [Payments and offline receipts](https://spaceworkslabs.tech/docs/space-works/finance-payments-and-settlements/)
- [Refunds](https://spaceworkslabs.tech/docs/space-works/finance-refunds/)
- [When you lower a price](https://spaceworkslabs.tech/docs/space-works/finance-price-drop-refunds/)
- [The finance ledger](https://spaceworkslabs.tech/docs/space-works/finance-finance-ledger/)
- [Tax, receipts and disputes](https://spaceworkslabs.tech/docs/space-works/finance-tax-and-receipts/)
- [Price lists and member discounts](https://spaceworkslabs.tech/docs/space-works/finance-price-lists/)
- [Donations and sponsors](https://spaceworkslabs.tech/docs/space-works/finance-donations-and-sponsors/)
- [What an organisation is](https://spaceworkslabs.tech/docs/space-works/organisation-what-is-an-organisation/)
- [Create an organisation, invite people and leave one](https://spaceworkslabs.tech/docs/space-works/organisation-create-and-invite/)
- [Organised events and organisation analytics](https://spaceworkslabs.tech/docs/space-works/organisation-organised-events/)
Platform administration
- [Sign in to the platform console](https://spaceworkslabs.tech/docs/space-works/superadmin-platform-console/)
- [Work inside a space, and personal data windows](https://spaceworkslabs.tech/docs/space-works/superadmin-working-in-a-space/)
- [The platform dashboard](https://spaceworkslabs.tech/docs/space-works/superadmin-platform-dashboard/)
- [Space health, service pauses and closure](https://spaceworkslabs.tech/docs/space-works/superadmin-space-lifecycle/)
- [Per-space limits](https://spaceworkslabs.tech/docs/space-works/superadmin-platform-limits/)
- [Users, Space Managers and new spaces](https://spaceworkslabs.tech/docs/space-works/superadmin-users-and-space-managers/)
- [Lock a space's security settings](https://spaceworkslabs.tech/docs/space-works/superadmin-security-locks/)
- [Organisations across the platform](https://spaceworkslabs.tech/docs/space-works/superadmin-organisations/)
- [Modules, limits and purging data](https://spaceworkslabs.tech/docs/space-works/superadmin-modules-and-purges/)
- [Platform backups and restores](https://spaceworkslabs.tech/docs/space-works/superadmin-backups-and-restore/)
- [Move a space to another server](https://spaceworkslabs.tech/docs/space-works/superadmin-tenant-migration/)
- [Platform settings, sign-in providers and hosting requests](https://spaceworkslabs.tech/docs/space-works/superadmin-platform-settings/)
- [The /control/ admin](https://spaceworkslabs.tech/docs/space-works/superadmin-control-admin/)
- [Install Space Works](https://spaceworkslabs.tech/docs/space-works/host-operator-install/)
- [Update and re-run the installer](https://spaceworkslabs.tech/docs/space-works/host-operator-upgrade/)
- [Back up and restore the server](https://spaceworkslabs.tech/docs/space-works/host-operator-backups/)
- [Environment keys and rotating them](https://spaceworkslabs.tech/docs/space-works/host-operator-environment-keys/)
- [Encryption keys and row-level security](https://spaceworkslabs.tech/docs/space-works/host-operator-keys-and-row-level-security/)
- [Reach /control/ safely](https://spaceworkslabs.tech/docs/space-works/host-operator-control-plane-access/)
- [Health checks and logs](https://spaceworkslabs.tech/docs/space-works/host-operator-health-and-logs/)
- [Show or hide the SpaceWorks front page](https://spaceworkslabs.tech/docs/space-works/host-operator-front-page/)
Self-hosting
- [Self-Hosting Guide](https://spaceworkslabs.tech/docs/space-works/self-hosting/)
- [Choose your hosting](https://spaceworkslabs.tech/docs/space-works/choose-your-hosting/)
- [Install and update Space Works](https://spaceworkslabs.tech/docs/space-works/install-and-update/)
- [Setting up Space Works — Open Source Makerspace Manager (plain-language guide)](https://spaceworkslabs.tech/docs/space-works/setup-for-makerspaces/)
- [Backup and restore](https://spaceworkslabs.tech/docs/space-works/backup-and-restore/)
- [Run your space on your own domain or frontend](https://spaceworkslabs.tech/docs/space-works/own-domain-and-frontend/)
Developers
- [SpaceWorks API guide](https://spaceworkslabs.tech/docs/space-works/api-guide/)
- [Signed webhook v2](https://spaceworkslabs.tech/docs/space-works/webhooks-v2/)
- [Device Adapter API v1](https://spaceworkslabs.tech/docs/space-works/device-adapters/)
- [Build an adapter in another repository](https://spaceworkslabs.tech/docs/space-works/device-adapters-build-an-adapter/)
- [Adapter API reference](https://spaceworkslabs.tech/docs/space-works/device-adapters-api/)
- [Adapter authentication](https://spaceworkslabs.tech/docs/space-works/device-adapters-authentication/)
- [Build a shelf-pointer adapter (Raspberry Pi or ESP32)](https://spaceworkslabs.tech/docs/space-works/device-adapters-hardware-shelf-pointer/)
[All docs](https://spaceworkslabs.tech/docs/)

Space Works · Self-hosting

# Backup and restore

One guide for keeping a Space Works install recoverable: what is backed up, how often, where the copies go, how to restore each kind of install, how to go back after an upgrade, and how to prove a backup works. Background and the exact commands for key rotation, drills and self-host moves stay in[Self-hosting](https://spaceworkslabs.tech/docs/space-works/self-hosting/#backups) ; the update-specific procedures stay in[Database recovery after an update](https://github.com/SpaceWorks-Labs/SpaceWorks/blob/c447a11e657ba3979b594cf855dbb7aa5195412d/docs/update-recovery.md) .

## What is backed up

| Layer | What it holds | Made by | Restored with |
| --- | --- | --- | --- |
| **Whole-deployment archive** | The entire database (every space, every module, accounts, audit, money, the encrypted fields as stored, the database's own immutability triggers) plus the object files, signed and encrypted to the**platform key** | Nightly at 02:00, and on demand (Backup and restore, or`/control/`) | `scripts/import-backup.sh`then`scripts/restore.sh`(disaster restore) |
| **One-space archive** | One space's rows and files (guest passes, minors and consents, incidents, volunteer credits, supervised sessions, bookings, loans, events and so on). Accounts, the live audit history, money records and evidence photos are append-only and are never rolled back | Nightly, two spaces per ten minutes between 01:00 and 08:00, and**Back up now** | The app: Backup and restore, choose the space, preview, confirm with your password and the space slug |
| **Pre-update dump** | A SQL dump of the active database, taken before every update | `scripts/update.sh`(and the automatic deploy runner) into`backups/` | The documented offline procedure,[below](#roll-back-an-upgrade) |
| **Offsite copies** | A verified copy of any archive above on an S3-compatible destination you own | Every five minutes while a destination is enabled | [Offsite copies](#offsite-copies) |

Retention: nightly archives keep 7 daily copies and 4 weekly copies; on-demand archives keep the configured number of days (default set under Backup settings). The newest verified offsite copy of each destination is never pruned, even past its window. `flowchart LR data[("Database and object files")] --> whole["Whole-deployment archive<br/>nightly, sealed to the platform key"] data --> space["One-space archive<br/>nightly or Back up now"] upd["Every update"] --> pre["Pre-update dump in backups/"] whole --> off["Offsite copy in your own S3 bucket<br/>read back and checked"] space --> off`

### What is not in a backup
- **Your`.env`and keys.**The archive carries ciphertext; the keys that open it (`SECRET_KEY`,`API_CLIENT_ENC_KEY`,`PII_MASTER_KEY`,`PII_SEARCH_HASH_KEY`,`AUDIT_MAC_MASTER_KEY`,`ACCOUNT_PII_MASTER_KEY`,`EVENT_REGISTRATION_CREDENTIAL_*`,`PUSH_TOKEN_HMAC_KEY`and the rest of the continuity set) travel in the archive's sealed continuity record, but keep an independent copy of`.env`off the server anyway. Losing them makes encrypted fields (minors' guardian details, incident notes, integration and wallet secrets) unreadable.
- **The platform key.**It opens whole-deployment archives and must stay off the server.
- **Files you mounted yourself:**deployment-wide wallet certificates (`WALLET_*_FILE`), the web-push VAPID key and any provider credentials supplied only through the environment.
- **Expired evidence photo bytes.**The photo record, scans, remarks and audit trail stay; the bytes follow the evidence-retention window.
- **Platform-level settings are not part of a space move.**Request-rate overrides, the hosting switch, each space's hosting type, and wallet signing credentials (platform or per space) are never in a tenant export or a one-space archive; they are re-entered on the target.

## How often, and where the copies go
- Whole deployment: nightly. One space: nightly. Pre-update: on every update. Run one any time before risky changes.
- Keep at least one copy**off this server**. Add a destination under Backup and restore,**Offsite copies**(any S3-compatible bucket: R2, B2, S3, Supabase Storage, MinIO elsewhere). Space Works uploads the encrypted archive, reads it back and checks its size and SHA-256 before it counts as a copy; verified copies are re-checked every 30 days.

## Offsite copies
- **Add and test**a destination, then**probe**it (a read/write check). These need no extra proof.
- **Push now, rotate credentials, retire a destination and rehydrate an archive**(bring a copy back from the destination) are destructive or credential-bearing: they ask you to confirm your password again if you have not signed in in the last ten minutes (`recent_reauth_required`). Every step is audited.
- A copy is only trusted once its read-back matches. A failed verification stays visible on the destination and is retried; it is never silently counted.

## Restore

Pick the row that matches what went wrong.

| Situation | Procedure |
| --- | --- |
| One space was damaged or edited by mistake | **Restore one space**in the app. Preview first: it lists what will be replaced, rows after the restore point that are kept (money, audit, evidence) and anything that blocks it. A safety backup of the space is taken before anything changes |
| The server is lost, or the database is unusable | **Disaster restore**on a new or reset install, below |
| An update went wrong | [Roll back an upgrade](#roll-back-an-upgrade) |
| Moving one space to another server | Tenant export and import ([Self-hosting](https://spaceworkslabs.tech/docs/space-works/self-hosting/#move-a-space-to-this-server-self-host-move) ) |
 `flowchart TD q{"What went wrong?"} q -- "One space damaged" --> one["Restore one space in the app<br/>preview first, safety backup taken"] q -- "Server or database lost" --> where{"Where is the database?"} where -- Bundled --> b["import-backup.sh, then restore.sh"] where -- Outside --> o["Same commands with the owner login<br/>and --replace"] b --> quar["Quarantine: a superadmin reviews, then writes resume"] o --> quar q -- "An update went wrong" --> u{"Did it fail midway?"} u -- yes --> auto["Images roll back by themselves; database stays migrated"] u -- "No, going back on purpose" --> pre["Restore the pre-update dump and deploy that release"] q -- "Moving one space" --> mv["Tenant export and import"]`

### Disaster restore, bundled database
- Install the**same release**(or newer) on the new host, with the same`.env`keys (restore them from your off-server copy).
- Put the platform age identity on the host for this run only:`BACKUP_AGE_IDENTITY_FILE`(default`<ops>/work/age-identity.txt`). Remove it afterwards.
- `sudo bash scripts/import-backup.sh <archive.tar.age> <superadmin-username> [expected-sha256]`registers the archive and records the restore.
- `sudo bash scripts/restore.sh <restore-uuid>`. The supervisor verifies the archive, drains writers, takes its own pre-restore snapshot, restores the database and objects, re-grants the runtime database login and checks readiness. If anything fails it puts the snapshot back.
- A disaster restore enters**quarantine**: a superadmin reviews the result in`/control/`and acknowledges before normal writes resume. Then run the[verification](#verify-a-backup) checks.

Restoring recreates every immutability trigger (guest passes, evidence, audit, booking decisions, equipment snapshots) because the database catalogue is part of the dump and is checked against the release's managed function catalogue; a restore that would lose one is refused.

### Disaster restore, outside database (Supabase, Neon, RDS and similar)

The same two commands apply when`.env`has`SPACEWORKS_DATABASE=external`. Differences:
- The restore runs from a one-off backend container with the**owner**login (`SPACEWORKS_MAINTENANCE_DATABASE_URL`, the direct or session connection, never a transaction pooler and never the narrow runtime login).
- Because the outside database always holds freshly migrated tables, the restore refuses to replace it unless it holds no accounts yet or you confirm:`sudo bash scripts/restore.sh <uuid> --replace`, or`SPACEWORKS_RESTORE_REPLACE=1`, or type the database name when asked.
- A pre-restore dump is written to the private work directory first and put back if the restore fails or is interrupted.
- The client is chosen by the server's major version (16 or 17); another major is refused.

### Restore one space from a whole-deployment archive

Extract the space on a trusted machine and copy only the decrypted directory to the host ([Restore one space](https://spaceworkslabs.tech/docs/space-works/self-hosting/#restore-one-space) ); it then appears as a restore point for that space.

## Roll back an upgrade

Upgrades are**forward-only**. The updater refuses an older target release, and never points an old release at a database a newer release has migrated.
- **A failed update**rolls the application images back by itself and leaves the database as the new release migrated it. Nothing is restored automatically; the pre-update dump stays in`backups/`.
- **Going back on purpose**means restoring the pre-update dump the updater took, then deploying the release that dump came from:
- bundled database:`backups/pre-update-<timestamp>.sql.gz`(plain SQL). Follow[Restore a pre-update SQL dump](https://github.com/SpaceWorks-Labs/SpaceWorks/blob/c447a11e657ba3979b594cf855dbb7aa5195412d/docs/update-recovery.md#restore-a-pre-update-sql-dump) .
- outside database:`backups/pre-update-<timestamp>.dump`(custom format, written with the version-matched`pg_dump`). Restore it with`pg_restore --clean --if-exists --no-owner --no-acl`of the same major version using the owner login, against the**direct**connection; the same quiesce, grants and image-tag steps apply ([outside database notes](https://github.com/SpaceWorks-Labs/SpaceWorks/blob/c447a11e657ba3979b594cf855dbb7aa5195412d/docs/update-recovery.md#restore-a-pre-update-sql-dump) ).
- Object files are not in the dump. Restore the matching object-storage state if the update changed files.

## Verify a backup

A backup you have not restored is a hope. Check on a schedule:
- **Drills.**The server drills one space every seven days (configurable): it restores that space's latest archive into a throwaway database with a throwaway key, checks every row and object, then destroys both. Failures email the superadmins; review them under Backup keys, drills and notices.
- **Offsite copies.**Open the destination: every upload shows`verified`and the read-back time.
- **After any restore.** `GET /api/v1/health/readiness/`is ready; the superadmin Platform dashboard shows backups, offsite copies and the scheduler green; spot-check a guest pass, a minor's consent (the guardian name must read back) and an incident in a restored space.
- **Before a release.**On a development stack run the live round trip, which seeds sample data, backs it up, wipes it, restores it and checks counts, an encrypted field and the immutability triggers:

`bash ./scripts/dev.sh up --build ./scripts/dev/backup-roundtrip.sh --clean`

From[SpaceWorks/docs/backup-and-restore.md](https://github.com/SpaceWorks-Labs/SpaceWorks/blob/c447a11e657ba3979b594cf855dbb7aa5195412d/docs/backup-and-restore.md) at c447a11, updated 2026-11-16.[Suggest a change](https://github.com/SpaceWorks-Labs/SpaceWorks/edit/dev/docs/backup-and-restore.md)  [PreviousSetting up Space Works — Open Source Makerspace Manager (plain-language guide)](https://spaceworkslabs.tech/docs/space-works/setup-for-makerspaces/) [NextRun your space on your own domain or frontend](https://spaceworkslabs.tech/docs/space-works/own-domain-and-frontend/)

On this page
- [What is backed up](#what-is-backed-up)
- [What is not in a backup](#what-is-not-in-a-backup)
- [How often, and where the copies go](#how-often-and-where-the-copies-go)
- [Offsite copies](#offsite-copies)
- [Restore](#restore)
- [Disaster restore, bundled database](#disaster-restore-bundled-database)
- [Disaster restore, outside database (Supabase, Neon, RDS and similar)](#disaster-restore-outside-database-supabase-neon-rds-and-similar)
- [Restore one space from a whole-deployment archive](#restore-one-space-from-a-whole-deployment-archive)
- [Roll back an upgrade](#roll-back-an-upgrade)
- [Verify a backup](#verify-a-backup)
