Decidim backup and restore: what you must protect and why
A Decidim backup covers two things together: the PostgreSQL database that holds proposals, votes, comments, user accounts and configuration, and the uploaded files (or the object storage bucket that replaces local disk) that hold attachments and images. Backing up only one of them produces a restore that looks complete but is broken, because records point to files that no longer exist. A backup only counts once you have restored it successfully into a separate environment and checked that participants, content and attachments came back. Until that test passes, you have a copy of data, not a recovery capability.
Backup is also routine operations, not an emergency measure. Decidim's update guide tells operators to back up the database before upgrading, and to move one minor version at a time because some releases change database structures. Each upgrade therefore needs a fresh, verified backup taken at a known point, so a failed migration can be rolled back. Confirm with your own team how the upgrade rollback will run, which backup it uses, and who signs off that the restored copy is usable.
Participant personal data makes these backups a security object in their own right. Copies of the database contain names, email addresses, verification records and private messages, and copies of uploads may contain identity documents submitted during authorization. Decide before go-live who can read, copy or delete backups, where they are stored, whether they are encrypted at rest and in transit, and how long they are kept. Your retention rules must match what you have promised participants in your privacy notice, so a backup kept for years can conflict with a deletion request handled in the live system. Ask your hosting provider and your data protection officer to confirm these answers in writing before the first backup runs.
Backup options and when each fits
This table compares the three main ways to back up the PostgreSQL database behind a Decidim install: logical dumps, physical base backups with WAL archiving, and volume or object storage snapshots. Read each row against your recovery target and your deployment, because the database and the uploaded files usually need different methods and must be restored to the same point in time.
| Option | Recovery granularity | Restore time and operations fit |
|---|---|---|
| Logical dump (pg_dump or pg_dumpall) | Restores to the moment the dump ran, so anything entered afterward is lost unless you take another dump | Simple to run and inspect, but restore time grows with database size; pg_dumpall also captures roles and cluster-wide settings |
| Physical base backup with continuous WAL archiving | Supports point-in-time recovery to a chosen moment between base backups, the approach the PostgreSQL continuous archiving docs describe | More moving parts (archive command, base backup schedule, retention), but it is the option that can answer 'what did the platform hold at 14:00 yesterday' |
| Snapshots of volumes or object storage | Coarse: each snapshot is a point in time for the whole volume, so database and uploads may not match unless the database is quiesced first | Fast to take and restore on platforms that support them, but consistency depends on how the storage layer and database are coordinated |
| Uploaded files in ActiveStorage (local disk) | Usually backed up as a file copy or volume snapshot taken close to the database dump | Must be restored with the database from the same window, or attachments will point to missing files |
| Uploaded files in S3-compatible object storage | Depends on bucket versioning and replication settings you configure in the storage service | Confirm with your storage provider how versioning, object lock and cross-region copies work before relying on them |
| Docker installs | Volumes for the database and uploads are the usual targets; the database often runs in a separate container or managed service | Snapshot the volumes and the PostgreSQL data directory consistently, and confirm the image tags you restore onto match the Decidim version |
| Manual Rails installs | Dumps and base backups run on the database host, with the upload directory or bucket handled separately | Scripts and cron jobs on the host are common; verify they still run after each Decidim upgrade |
How to set up backups for a Decidim install
This sequence gives you a documented, tested backup of the PostgreSQL database and every uploaded file, taken at the same point in time and stored apart from the production server. Each step ends with a check you can repeat before the first real participant data goes in.
Inventory data stores and storage paths
Start by listing everything Decidim writes to: the PostgreSQL database, the uploads directory or object storage bucket used by ActiveStorage, any generated exports, and the configuration files that hold secrets such as the Rails secret key and SMTP credentials. Note where each one lives for your install, whether it is a local volume, a Docker persistent volume or a bucket, and who can access it. Confirm the list with the team that runs the server, since any store left off the list will not be backed up. Done means you have a written inventory that another engineer could follow without asking you.
Choose the database backup method and retention
Decide how the database is captured. For a standard PostgreSQL setup, a logical dump with pg_dump or continuous archiving with point-in-time recovery are the common options, and the PostgreSQL continuous archiving documentation describes the second in detail. Record the backup frequency, how many copies you keep, and where they are stored, and make sure the policy covers personal data in the participant tables. Ask your security or compliance lead to approve the retention period. Done means the chosen method and retention are written into the procedure.
Configure file or object storage backups
Set up a scheduled copy of the uploads directory or the object storage bucket. For local storage, use a tool that supports incremental copies and checksums. For S3-compatible storage, enable bucket versioning or replication to a second location if your provider offers it, and confirm this with the provider. Keep the backup target separate from the production volume. Done means a first copy exists in the backup location and the file count there matches the count on the source.
Take a consistent snapshot of both stores
Run the database backup and the file backup close together so the two match. Uploads added between the two steps can otherwise point to records that are missing, or the reverse. Decide whether to pause writes during the window, which is most practical in a low-traffic period, and document that choice. Store the database dump, the file copy and a checksum manifest under one backup label with the date and time. Done means one labeled set exists that contains both stores.
Verify that the backup can be read and restored
Check the artifacts before trusting them. Confirm the database dump can be listed or read by the same PostgreSQL major version you run, and compare the number of files and total size in the file backup with the source. Compare checksums for a sample of files. Then restore the set to a separate environment, start Decidim there and confirm that a process page, a proposal and an uploaded document load. Done means a restore test has passed and the result is recorded with the date and the person who ran it.
Protect backups that contain participant data
Encrypt the database dump and the file copy at rest, store encryption keys separately from the backups, and restrict read access to the operators who need it. Keep at least one copy isolated from the production network, such as offline media, a separate account or an off-site location. Participants' names, contact details and verification records can appear in both stores, so treat the backups as personal data in the retention schedule. Done means access and encryption settings are documented and an access review is scheduled.
Schedule the jobs and alert on failures
Set the backup job to run on your chosen schedule with cron, a systemd timer or your platform's scheduler. Send the job output to a place someone reads, and alert when a run fails or produces an empty or unusually small file. Include the restore test in the calendar as a recurring task. Done means a scheduled run has completed without manual intervention and the alert has been tested with a deliberate failure.
Record the procedure and back up before every upgrade
Write the backup and restore procedure as a runbook that names the inventory, commands, schedule, storage locations, restore steps and owners. Add a rule that a fresh database backup is taken before any Decidim upgrade, as the Decidim update guide requires, and that upgrades proceed one minor version at a time. Store the runbook where operators can reach it during an outage. Done means the runbook has been reviewed by a second person and the upgrade rule appears in the change process.
How to test a Decidim restore before you need it
A backup is unproven until it has been restored into a separate environment. Schedule a restore test that rebuilds both halves of the data on isolated infrastructure: load the PostgreSQL dump into a fresh database, restore the uploads or object storage bucket to the same paths or endpoints the application expects, and then start the Decidim application against them. Keep this environment off the production network and away from production DNS, so nothing it does can reach real participants. Use the same Ruby, Node and PostgreSQL versions as production, because a restore that only works on a different stack proves less than it appears to.
Once the application is running, check the things participants and administrators would notice first. Confirm that key records such as processes, meetings, proposals and user accounts are present and match counts or spot checks taken from production at the time of the backup. Open several attachments to confirm the files resolve and are not broken links. Log in with a test administrator account and a regular participant account to confirm authentication and sessions work. Record the start time, the time the database load finished, the time the files finished copying, and the time the application served its first successful page. Those measurements give you a restore duration to plan against, and they show which step dominates. Ask your hosting or platform team to confirm the duration of the restore against your real data volume, since the test on a small staging copy will understate it.
Write each test result down with the backup identifier, the date, the software versions, the person who ran the test and any defects found, then repeat the test after every substantive change. Upgrades are the clearest trigger, because Decidim's update guidance says to back up the database first and some minor versions change database structures, so a backup that restores cleanly on the old version may not on the new one. Run the test on a staging copy with SMTP disabled, or with outgoing mail pointed at a sink, so restored notifications, reminders and phase-change messages do not reach real participants. Review Decidim's update guide before each upgrade and treat a failed restore test as a blocker for that change.
How to keep backups with participant personal data protected
Backups of a Decidim database and uploads hold the same participant names, emails, votes and identity records as production, often in more places and for longer. The controls below work together: a documented recovery process sets the rules, and encryption, separation, access limits, retention and key custody enforce them.
Document the recovery process
Write down what is backed up, who may restore it, how recovery priorities are ordered and how backup data itself is secured. CIS Safeguard 11.1, which sits in Implementation Group 1, asks for this kind of documented process, reviewed annually. For Decidim, the document should name the PostgreSQL database, the uploads or object storage bucket, and the configuration secrets needed to restore them. Ask your team who signs off each review.
CIS Control 11 specEncrypt backups in transit and at rest
Backups should be encrypted on the way to storage and while stored, so a copied backup file does not expose participant data. Check that the backup tool or storage target supports encryption, that transfers use TLS, and that the restore path can decrypt without manual workarounds. Encryption protects against theft of the storage medium, but it does not stop an authorized administrator from deleting copies, which the access controls below address.
Separate recovery data from production
CIS Safeguards 11.3 and 11.4 ask that recovery data be protected like the original and kept isolated, for example as offline, off-site, or separate cloud copies. For a Decidim install, keep at least one copy outside the production database host and the production uploads volume, in a different account or location. A backup that shares credentials or networks with production can be lost in the same incident that takes production down.
Limit who can change retained copies
Under the Essential Eight at maturity level 3, backup administrator accounts should not be able to modify or delete backups during their retention period, and unprivileged accounts should not reach backups, including their own. In practice, separate the account that runs backups from the account that deletes them, enable object lock or immutability where storage supports it, and log every restore and deletion. Confirm these capabilities with your storage vendor before you rely on them.
Essential Eight modelSet retention from the privacy policy
Keeping backups longer than production data is a common gap. Decide how long each backup set lasts, then match that to the retention rules in your privacy notice and any data deletion commitments made to participants. Deleted participant records may still exist in older backups, so document how long they persist and what happens if a deletion request arrives. Ask your data protection officer to approve the retention period in writing.
Control encryption key custody
A backup is only as recoverable as its key. Store encryption keys separately from the backup files, record who holds them, and keep a tested way to recover them if the key holder leaves or is unavailable. Losing the key makes every encrypted backup useless, while keeping it beside the backup removes most of the protection. Test a restore using only the documented key process, so the procedure works during an incident.
Backup and restore questions buyers ask
What does a Decidim backup and restore engagement cost, and what drives it up or down?
Cost depends on how much data there is, how long backups are kept, how often restores are tested, and where backups are stored. The main cost components are the work to configure backups for the PostgreSQL database and uploaded files, the storage itself (on-premises disks, a backup system, or object storage), and the restore tests. Setup is largely one-time work, while storage growth, retention and scheduled restore tests recur. Volume of uploaded files, especially attachments from proposals and meetings, usually matters more than database size. DeployOpen does not publish a price list. Ask for a quote that separates setup, storage sizing, retention assumptions, restore test frequency and any ongoing support, and confirm your current data volumes first.
How long does setting up Decidim backups and testing a restore take?
Duration depends on the size of the database and file store, the hosting model, and whether object storage is already in place. The work usually covers reviewing the current setup, configuring database and file backups, setting retention, running a full restore into a separate environment, and documenting the steps. Each restore test can take longer than the backup itself because the platform must be rebuilt and checked. No fixed duration applies to every environment, so ask for a timeline in the written scope, and confirm how long your largest backup takes to copy and restore in your own environment before agreeing to one.
What must our team provide before a backup project starts?
The work needs access to the servers or container platform running Decidim, the PostgreSQL instance, the uploaded files or object storage bucket, and the backup target. You also need to state your retention periods, recovery time and recovery point expectations, and any privacy rules for participant data, such as where backups may be stored and who may read them. Provide a current version of your Decidim configuration, a list of custom modules, and a contact who can approve a restore test in a non-production environment. Confirm these items with your infrastructure and data protection teams before the scope is written.
Can our own team run Decidim backups without an outside partner?
Yes, many teams run backups in-house if they have people who can administer PostgreSQL, the file store, and the backup tooling, and if they can run restores on a schedule. The skills that matter are PostgreSQL backup and point-in-time recovery, file storage administration, secret and key handling, and Rails operations. The main risk is an untested process that works only in theory. Check whether your team has done a complete restore into a separate environment in the last year, who owns the process, and how it is documented. An outside partner is most useful for the initial design, the first full restore test, and a review of the result.
How do backups relate to Decidim upgrades?
Decidim's update guidance says to back up the database before upgrading, because some minor version upgrades change database structures. Upgrades must also move one minor version at a time, following each release's instructions. A backup taken just before an upgrade is a rollback point, but it only helps if the restore has been tested against the same version and the uploaded files match the database. Plan a backup immediately before each upgrade step and a restore test into a staging copy of the upgraded system. Confirm your current Decidim version and the next step in the upgrade path before scheduling either.
What does a restore test prove, and what does it not prove?
A restore test proves that a specific backup can be copied, loaded into a clean environment, and started with the database and uploaded files consistent with each other. It shows the real steps, the time they take, and any missing secrets, configuration or access. It does not prove that every past backup is usable, that retention rules are met, or that the restored system will meet your recovery time target under a real incident. It also does not confirm that backup copies are protected. Record the backup identifier, the restore duration, the checks performed and the gaps found, then repeat the test on a schedule and after significant changes.
How should backups containing participant personal data be protected?
Backups of Decidim contain the same personal data as production, so they need the same protection as the live system. Encrypt them in transit and at rest, separate the backup storage from the production administrators' everyday access, and restrict who can restore or delete them. Keep at least one copy isolated from the production environment, such as an off-site or offline copy. Align retention periods with your privacy notice and deletion obligations, and confirm how a deleted participant's data is handled in older backups. Review these controls against CIS Controls v8.1 Safeguards 11.3 and 11.4, which cover protecting recovery data and keeping an isolated copy.
Which backup tools work well with Decidim's PostgreSQL and file storage?
Decidim stores structured data in PostgreSQL and uploaded files in its file storage layer, so a backup must cover both at the same point in time. PostgreSQL's point-in-time recovery relies on continuous archiving of write-ahead logs, which lets you restore to a chosen moment. For the wider infrastructure, general backup systems such as Bareos, Proxmox Backup Server or Velero may fit depending on whether you run virtual machines or Kubernetes. Confirm that the chosen tool can capture the file store and database consistently, supports encryption and retention controls, and can restore into a separate environment. Check the current PostgreSQL version support window before choosing a backup approach.
Limits to confirm in your environment
A backup plan is only as good as the assumptions behind it. The items below are the ones that most often differ between a documented design and the platform that actually runs in your environment, so confirm each one before a restore is needed.
PostgreSQL version and support window
Confirm the exact PostgreSQL major version your Decidim database runs and when it leaves support. Version 14 is supported until November 12, 2026, while version 17 is supported until November 8, 2029. A backup taken from an unsupported server may still restore, but you will carry the risk of an unpatched database while you plan the upgrade, and the Decidim update path may require a backup before each step.
- Version 14 support ends
- Nov 12, 2026
Point-in-time recovery support in your tooling
Confirm that the backup tool you chose can replay write-ahead logs to a chosen moment, not only restore a nightly dump. Point-in-time recovery depends on continuous WAL archiving being configured and tested on the actual server, including archive storage and retention. If your tooling only produces daily logical dumps, the most recent hours of participant activity, such as new proposals or votes, may be lost on restore.
Continuous archiving docsObject storage versioning and immutability
Decidim stores uploaded files such as attachments and images through ActiveStorage, so a database backup alone does not restore them. Ask your storage provider whether bucket versioning, object lock or retention rules are available and how they apply to deletions made from the Decidim admin panel. Check that the backup credentials cannot delete the backup copies, because a compromised application account should not be able to erase its own recovery data.
Cross-site copy capacity
Confirm that you have enough bandwidth, storage and permission to copy backups to a second site or a separate account. The copy must be able to finish within your backup window and must be readable when the primary site is down. Ask the hosting team to measure transfer time for a full database dump and the current upload volume, because a copy that takes longer than the interval between backups will silently fall behind.
Database and file size driving restore time
Restore duration depends on the size of the database and the volume of uploaded files, and on how fast your hardware can write them back. Measure a restore on a copy of production rather than estimating from disk usage, and record the result. Include the time to rebuild indexes, reconfigure SMTP and background jobs, and verify that the site starts, since these steps often take longer than the data copy itself.
High availability is a separate control
PostgreSQL provides hot standby servers and replication, but it does not detect a failed primary or promote a standby on its own, so automatic failover requires external tooling. Replication copies mistakes such as an accidental deletion to the standby as well, so it does not replace backups. Confirm who owns failover decisions and whether your backups remain the recovery path when replication fails.
PostgreSQL failover docsHow the backup and restore flow fits together
The flow starts with the live Decidim application, which writes participant data to PostgreSQL and uploaded files to file or object storage. A scheduled backup job takes a database dump and a copy of the files, encrypts both, and sends them to a separate store that is isolated from the production environment. A restore test pulls a copy from that store into staging, and the team checks the restored data before it counts as a working backup. Verify that the encryption keys are stored apart from the backups.
Production data flows through scheduled encrypted backups to an isolated store and a staging restore test.
How DeployOpen scopes backup and restore work
DeployOpen starts every backup and restore engagement by agreeing the scope in writing before any work begins. For a Decidim platform, that scope names each data store that holds participant or administrative data: the PostgreSQL database, the uploaded files held by ActiveStorage (on local disk or in object storage), the configuration and secrets needed to bring the application back, and any logs your team needs to keep. The agreement also sets recovery priorities, such as which organizations or participatory spaces must return first if a single host fails. Those decisions shape the backup frequency, the retention periods and the restore order, so they should be made with your compliance, security and service owners in the room rather than left to the implementer alone. The written scope is what a later quote is built from, so it is the place to settle these questions.
Implementation then takes place inside your own cloud accounts, data centers or air-gapped network. DeployOpen configures scheduled database dumps or continuous archiving, copies of uploaded files, and storage of the backup sets in a separate location from production. Participant personal data inside those backups needs the same protection as the live system, so the design should cover encryption at rest, restricted access for backup administrators, and a clear rule on who can delete backups before their retention period ends. Restore tests are the part most often skipped. DeployOpen runs restores into a separate environment, checks that the database and files match, and confirms that the application starts and that a sample of records and attachments opens correctly. Each test is recorded, and the results feed the procedure. Confirm with your own team how much of a restore you need to prove, because the answer depends on how quickly your organization must be operational again.
The deliverable is a runbook written for your operators, covering the backup schedule, the restore steps in order, the checks after each restore, the contacts and the known limits. DeployOpen also prepares the evidence an internal audit or external assessor will ask for, such as the documented procedure, test records and access settings. It does not issue audit reports, attestations or certifications; independent auditors and certification bodies make those determinations. Ongoing restore testing, runbook updates after Decidim or PostgreSQL upgrades, and periodic review are available as a retainer, which suits teams that want testing repeated on a schedule rather than only at launch. Ask for the scope, deliverables and timeline in writing so you can compare them with what your own team can run.
How DeployOpen delivers Decidim backup and restore
DeployOpen plans, builds, tests and documents backup and restore for Decidim inside infrastructure you control, covering the PostgreSQL database, uploaded files or object storage, and the access controls around backups that hold participant personal data. Each engagement starts from a written scope, so your team knows what is protected, how it is restored and who signs off.
How we scope
- Inventory the PostgreSQL database, ActiveStorage uploads or object storage buckets, and configuration files that a restore would need.
- Agree backup frequency, retention periods and recovery priorities with your data owners in writing before work starts.
- Define which backups contain participant personal data and the encryption, access and separation controls they must meet.
How we build
- Configure scheduled PostgreSQL backups and file or object storage copies, with the schedule and storage location set for your environment.
- Set up an isolated copy of backups, such as off-site or version-controlled storage, separated from the production Decidim host.
- Restrict backup administrator and application accounts so they cannot silently alter or delete backups during retention.
How we hand over
- Run restore tests into a separate environment and record the time taken and the checks performed for each test.
- Deliver a written runbook covering restore steps, the order of database and file recovery, and the upgrade backup step.
- Document backup scope, retention, encryption and access decisions so your compliance and security teams can review them.
How we support
- Repeat restore tests after Decidim upgrades, PostgreSQL upgrades and other substantive changes to the platform.
- Review backup coverage and access settings with your team on a schedule agreed in the scope.
- Ongoing support, upgrades and continuous testing are available as a retainer after the initial handover.

