Why backing up Strapi takes more than a database dump
A self-hosted Strapi project keeps its state in several places at once: the relational database holds entries, relations, users and the schema-driven content model, uploaded assets sit in whatever upload provider you configured, and configuration and secrets live in environment variables, config files and your deployment pipeline. A usable backup covers the database, uploaded assets, configuration and secrets, and it is only proven when you restore it into a clean environment and confirm that the admin panel, content and media come back intact. A database dump by itself will recover rows but not the files they point to, and it will not recover the keys needed to read data that was encrypted at rest.
The clearest reason to take a database backup on its own schedule is the upgrade path. Strapi 5 runs data migration scripts on first start, and the migration documentation tells you to back up the database before you upgrade, because downgrading is not supported. That means a fresh dump taken immediately before an upgrade is a rollback plan only if you have also kept the matching media and configuration from the same point in time. Confirm with your Strapi version and your database engine which dump command and format you will use, and confirm that your database version meets the Strapi 5 requirements in the Strapi installation docs before you rely on that dump for restore testing.
Decide early which pieces of state must travel together. Record the Strapi version, the Node.js version, the database engine and version, the upload provider settings, and where APP_KEYS, API_TOKEN_SALT, ADMIN_JWT_SECRET, JWT_SECRET and database credentials are stored. Then decide whether you will use raw database and file backups, the strapi export command, or both, and write down what each one does not capture. Restore tests will expose gaps in this inventory faster than any review meeting, so schedule one before go-live and treat its result as the acceptance test for your backup plan.
Which backup method fits which recovery goal
This table compares native database dumps, strapi export, media storage snapshots and secrets backups by what each captures, what it misses and which recovery goal it serves. Read each row as a separate piece of the plan, because a full recovery usually needs more than one method. The main takeaway is that no single method restores a self-hosted Strapi project on its own.
| Backup method | What it captures and misses | When it fits |
|---|---|---|
| Native database dump | Captures the full PostgreSQL, MySQL, MariaDB or SQLite database, including content, relations and admin users. Misses uploaded media files, the project code and the environment secrets. | Full disaster recovery onto the same database engine and major version. Confirm the restore procedure against your database vendor's documentation. |
| strapi export | Captures content, configuration and optionally media in a Strapi transfer archive, and can be encrypted and compressed. Misses the database engine's own settings, database users and anything outside Strapi's data model, and it is not a substitute for a database dump. | Moving content between Strapi environments, or keeping an offsite archive that a Strapi project can import. Verify that an archive restores into a clean instance before relying on it. |
| Media storage snapshot or object storage copy | Captures uploaded files in the local uploads folder or in the object storage bucket, including versioning if the provider enables it. Misses the database rows that point to each file, so files and records can drift apart. | Recovering assets after accidental deletion or storage failure. Pair snapshot timing with the database dump so references stay valid. |
| Secrets and key backup | Captures the values that Strapi needs at runtime, such as the application keys, the JWT and transfer secrets, and the database credentials, held in your secrets vault. Misses the data itself, and a copy stored beside the database weakens protection of both. | Any restore at all. Without the original keys, encrypted fields and tokens can fail to decrypt or validate, even when the database restores cleanly. |
| Project code and configuration | Captures the schema, content type definitions, custom code, plugin versions and environment templates in version control. Misses data, uploads and runtime secrets. | Rebuilding the application on new infrastructure, and proving which schema a given database dump expects. Keep the lock file and Node.js version with the code. |
| Offsite encrypted archive | Captures copies of the dump, media and exports stored outside your network, with encryption applied before transfer. Misses recoverability if the decryption keys are lost or stored with the archive. | Ransomware recovery and regulatory retention that requires copies outside the primary site. Confirm where keys are held and who can use them. |
Protecting media, encryption keys and secrets
A database dump restores rows, but it does not restore the files editors uploaded or the keys that make Strapi work with that data. These cards cover the pieces that sit outside the database and must be backed up on purpose, stored apart from the archive, and proven recoverable together.
Uploaded media in the storage provider
Media files usually live in an object store or provider bucket, not in the database, so a database dump holds only the metadata that points to them. Confirm which upload provider the project uses, whether the bucket has versioning or its own replication, and whether a restore is expected to bring back the same file keys. Check that a restored database can actually resolve its media URLs in a test environment before you trust the plan.
Strapi migration FAQAPP_KEYS in environment configuration
APP_KEYS is used by Strapi to sign and protect session and admin data, so its value must match between the environment that wrote the backup and the one that restores it. Record the value in your secrets manager with a version tag, and confirm that rotating it is a planned change rather than a side effect of rebuilding a container. Editors who log in after a restore with a changed value will see failures that look like a broken database.
API token and JWT secrets
API token salts and the JWT secret are set through environment variables and are not stored in the content tables. Without the original values, existing API tokens and user sessions cannot be validated after a restore, and the application may start but reject every authenticated call. Ask your team which of these values are generated at install and which are set by hand, and keep both sets in the same vault entry as APP_KEYS.
Encryption keys for export archives
If you encrypt strapi export archives, the key that unlocks them is a separate secret from every key listed above. An archive encrypted with a key nobody can find is a valid file that cannot be read, which is a loss of the backup even though the copy exists. Store the key in at least two controlled locations, record which key version matches which archive, and test a decrypt-and-import on a schedule.
Keeping secrets apart from the archive
A backup archive that also contains the database password, APP_KEYS or the export key gives anyone who steals the archive a route into the system. Keep secrets in a secrets manager or sealed store with its own access log and its own retention, and keep the backup in a location with separate credentials. Confirm who can read each store, and write down the restore order so the on-call engineer does not need to ask for keys during an incident.
Restore drills that include secrets
A restore test that only loads the database proves less than it appears to. Run the drill on a clean host using only the backup, the stored media copy and the secrets from the vault, then log in as an editor, open a media asset and call one token-protected endpoint. Record how long the drill took and which step needed a person to find something, because those gaps are where a real recovery stalls.
Setting up a backup and restore routine
This sequence turns a Strapi backup plan into a routine you can prove works. It ends with a tested restore into a separate environment, so the team knows the copies are usable before an incident forces the question.
Inventory data stores and secrets
Start by listing everything a restore needs: the relational database, the media store (local uploads or an object storage bucket), the project code and plugin versions, configuration files, and the secrets Strapi reads at startup, including the app keys, JWT and transfer tokens, and the encryption key used for any export archives. Record where each item lives and who holds it. The step is done when the inventory names an owner and a storage location for every item, and the secrets list is kept separately from the data copies. Confirm the list against your running environment, since installed plugins and custom settings differ between projects.
Schedule database dumps and exports
Set up a scheduled job that takes a native database dump with the tooling for your database (for example, pg_dump for PostgreSQL or mysqldump for MySQL) and, where you want a Strapi-level archive, a strapi export run. Native dumps capture the database exactly as it is and are the baseline for disaster recovery. A strapi export is a portable archive that can include content and media, and it is the usual choice when moving data between environments. Strapi's upgrade documentation tells you to back up the database before upgrading because downgrades are not supported, so schedule a dump before every upgrade as well. Check each run by confirming the file exists, the size is in line with the previous run, and the job exit code is zero.
Back up the media store
Copy uploaded files on their own schedule, because a database dump does not contain them. If uploads sit on local disk, back up the upload directory with a file-level tool. If you use an object storage provider or a Strapi upload provider, enable the provider's versioning or replication features, and confirm them with the provider, since behavior differs by service. Keep the media copy aligned with the database copy so that entries never point to files that do not exist after a restore. Verify by comparing the file count and total size against the live store, and by opening a sample of restored assets during the restore test in a later step.
Store copies offsite with access control
Send database dumps, exports and media copies to a location outside the production network, such as a separate cloud account or a second data center. Encrypt the archives before they leave the network and keep the encryption keys apart from the archives. Limit write access to the backup job's identity and read access to a small named group, and log every retrieval. Store the secrets inventory in a secrets manager or a sealed vault with its own access list, not in the backup bucket. Confirm that a copy can be listed and downloaded by the restore group and by nobody else, and that deleting production data does not delete the offsite copies.
Document the restore runbook
Write a runbook that a person who did not build the system can follow at 2 a.m. It should name the backup locations, the order of restore (secrets and configuration, database, media, then application start), the exact commands, the Node.js and Strapi versions to install, and the checks to run at each stage. Include how to rebuild the admin user if the restore fails, and who approves a restore into production. Store the runbook somewhere that survives the loss of the production system. The runbook is complete when a colleague can name each step's input and expected output without asking the author.
Run a restore into a separate environment
Restore the latest copies into an isolated environment that has no route to production services, email or payment systems. Follow the runbook exactly as written and record any step that needed interpretation, then update the runbook. Confirm the database dump size and table row counts look right, that the restored Strapi instance starts without errors, that the admin panel loads, and that the API returns published content. Open a sample of media files and confirm they render. Repeat this test on a schedule and after each Strapi upgrade, because a restore that worked last quarter may fail after a version or plugin change.
Proving a Strapi backup restores
An untested backup is an assumption, not a recovery plan. A dump file that exists, has a sensible size and passes its checksum tells you the bytes were written. It does not tell you that Strapi will start, that content types load, that media resolves or that editors can sign in. For a self-hosted Strapi project, the only proof that matters is a restore into a separate environment followed by the same checks production depends on. Run this test on the exact combination you would use in an incident: the database dump or strapi export archive, the media files, and the secrets such as APP_KEYS, API_TOKEN_SALT and JWT_SECRET that the backup must be paired with.
Build the restore test on an isolated environment with its own database, storage bucket or media directory, and no route to production services such as email, webhooks or third-party providers. Then compare the restored system with production on four things. First, content counts per content type, taken from the same queries on both sides and taken at a comparable point in time. Second, media links: sample entries that reference uploaded files and confirm those files load from the restored storage. Third, admin login through the restored panel, including any SSO configuration. Fourth, API responses for a fixed set of public and authenticated endpoints, compared field by field. Record every mismatch, because a missing relation or a changed permission is often the first sign of a backup that is incomplete.
Restore time and the number of people needed are facts you must measure in your own environment, not assume from this page. Time the full sequence from fetching the backup to a passing comparison, and note which steps need a database administrator, an infrastructure engineer or a content owner. Ask your team to confirm who holds the encryption key and the secrets file, whether they can be reached during an outage, and whether the restore runs from documentation alone. Repeat the test on a schedule that matches how often content changes, and after any Strapi upgrade, schema change or change to the storage provider.
Security risks in backup storage and access
A Strapi backup is a full copy of content, configuration references, user records and often uploaded media, so it can be more sensitive than the live system. The cards below cover the access, encryption, credential and retention decisions that determine whether a backup protects the business or creates a new exposure.
Who can read backups
Anyone who can list or download the backup bucket, volume or dump directory can read the content and, if the dump includes the users table, password hashes and personal data. Strapi's admin panel roles control editing, but they do not control the filesystem or object store where backups sit. Map every person and service account with read access and compare that list with the Strapi administrators who should be able to see the data at all.
Encryption at rest and in transit
Dumps written to disk or object storage should be encrypted before they leave the Strapi host, and transfers should use TLS. Confirm where keys are held and whether the storage provider can decrypt the data. A backup that is encrypted with a key stored next to it adds little protection, so record who can reach the key material.
Separate backup and application credentials
The Strapi process needs database credentials and the application secrets used for JWTs, API tokens and encryption. The backup job should use its own database role with read access and its own storage credentials. If the same secret file is copied into backup jobs, a compromised backup runner exposes the live application. Check that the backup role cannot write to content tables or change schema.
Protect the secrets inside backups
Strapi's configuration reads values such as APP_KEYS, API_TOKEN_SALT, ADMIN_JWT_SECRET and JWT_SECRET from the environment. A database dump does not contain these values, so a restore on new hardware fails or invalidates sessions unless the secrets are backed up through a separate, controlled path. Keep secret backups in a vault with its own access log, not in the same archive as the database.
Audit restore access
Restoring a backup is the most powerful operation in the chain because it can replace production content and reset users. Log who starts a restore, which archive they used and where it was written. Review those logs on a schedule and require a second approver for production restores. Confirm that your database and storage platforms record these events, since Strapi's audit logs cover the admin panel and are an Enterprise feature according to the self-hosted pricing page.
Strapi plan featuresPersonal data in retained copies
Backups copy user accounts, form submissions and any personal data editors stored in entries. Deleting a record from Strapi does not remove it from older backups, so retention periods, deletion requests and the restore procedure need to be documented together. Ask your privacy or legal team how long each backup tier may be kept, whether restored data must be re-purged, and whether backup locations fall inside the data residency commitments you have made.
Questions teams ask before backing up Strapi
How much effort does a Strapi backup plan take to set up?
Setup effort depends mostly on how much data you hold, how large your media library is, how many environments you run and how long you must keep copies. A single production instance with a modest media library is a smaller job than several environments with large uploads and retention rules set by a compliance team. Setup covers choosing the database dump or strapi export approach, configuring media storage copies, inventorying secrets, scheduling jobs and writing the restore runbook. Ask any partner to split the quote into these items, and ask which parts are one-time work and which recur, such as monitoring backup jobs and rotating keys.
Can our internal team set up Strapi backups without a partner?
Yes, if your team already runs the database and storage your Strapi instance uses and has someone who can write and test restore procedures. Most of the risk sits in the parts that are easy to skip: the encryption keys and secrets Strapi needs, the media files that are not in the database, and a restore that has never been run in a clean environment. A partner is most useful when you need an independent review, a restore environment built for testing, or documented evidence for an assessment. Decide this by checking whether someone can own the backup runbook after the project ends.
What do we need to provide before backup work starts?
The work needs access and information more than hardware. Typically this includes:
- Read access to the production database and permission to create dumps, plus the database version and connection details
- Storage accounts or buckets for media and backup copies, with write access for the backup job and a separate restore role
- A secret inventory covering
APP_KEYS,API_TOKEN_SALT,ADMIN_JWT_SECRET,JWT_SECRETand any provider credentials - A non-production environment where restores can be tested
Confirm the exact variable names against the Strapi version you run, since they can differ between releases.
How often should we test a Strapi restore?
Test a restore on a schedule that matches how much content and configuration can change between backups, and run one after any change to the database, media storage, Strapi version or secrets. A backup that has never been restored is an assumption, not a control. A good test restores the database and media into a clean environment, starts Strapi, checks that content and uploads load and confirms admin login works with the restored secrets. Record the result, the time taken and any gaps. Ask a partner to define the test frequency and to include a restore test in the handover documentation.
How do we decide retention and offsite copies for Strapi?
Retention is a business and compliance decision, so start with the questions your content owners, legal team and auditors ask: how far back must you recover content, how long must deleted personal data remain recoverable, and where must copies be stored. Offsite copies follow from the same answers plus your data location rules and encryption requirements. Strapi's strapi export can produce encrypted and compressed archives for copies that leave your network, and the sibling guide on encrypted exports covers handling those keys. Keep a written retention schedule, assign an owner for deletion, and make sure the restore team can reach copies stored in another location.
What should we ask for in a backup services quote?
Ask for a written scope that names each deliverable: the backup method for the database, the media storage approach, the secrets inventory, the restore runbook, the restore test and the handover session. Ask which environments are covered, how many restore tests are included, what evidence you receive and who keeps the scripts after delivery. Ask which costs are one-time and which recur, such as ongoing monitoring or retainer support. DeployOpen plans engagements as fixed scope with agreed deliverables and timelines in writing, so use that format when comparing quotes from any provider.
Does a Strapi backup plan change when we upgrade Strapi?
Yes. Strapi's upgrade documentation tells you to back up the database before migrating to Strapi 5, because downgrading is not supported. Treat a pre-upgrade backup as a separate, labeled copy with its own retention, and test that it restores to the version you run before the upgrade. Keep the Strapi version, Node.js version and database version recorded with each backup, since restoring into a mismatched runtime can fail even when the data is intact. Supported database engines include PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3.
How DeployOpen scopes and tests Strapi backups
DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside your own infrastructure. For Strapi backups, we start with a written scope that separates database, media, and key material, then build and test the restore path before handing it over.
How we scope
- Inventory where Strapi's database, uploads provider, and encryption keys live today
- Agree which backup method fits your database, media storage, and offsite requirements
- Confirm retention periods and who is accountable for approving restore tests
- Set the written scope, deliverables, and timeline before any work begins
How we build
- Configure scheduled database dumps and a separate schedule for media storage
- Store encryption keys and secrets apart from the backup files they protect
- Script a restore into a clean environment that mirrors the production Strapi version
- Test a restore end to end and record the measured steps and any gaps found
How we hand over
- Document the backup schedule, storage locations, and retention rules in one runbook
- Write step-by-step restore procedures that your operations team can run without us
- Walk through a live restore with the people who will own it after handover
- List open risks, such as untested media restores, for your team to accept or fix
How we support
- Offer retainers that cover periodic restore tests and runbook updates
- Re-test backups after Strapi upgrades, database changes, or hosting moves
- Review backup job logs and alerts as part of ongoing operational support
- Provide retesting after fixes so you can confirm the restore path still works

