CKAN backup and restore

A complete CKAN backup covers the main database, the DataStore database, the FileStore and configuration, and each needs its own method and restore test. This page explains the commands, how to protect dumps holding user data, and what to confirm for your version.

On this page

CKAN backup and restore: what a complete copy must include

A portal team without a tested restore path cannot say what would be lost if the host failed today, and a single database dump will not settle that question. CKAN keeps state in several places, so a complete copy has to capture each of them: the main PostgreSQL database that holds datasets, organizations, users and their activity; the separate DataStore database that holds rows loaded from tabular resources and is reached through its own write and read-only users; the FileStore directory of uploaded files; and the configuration that defines how the instance runs, including site settings and extension options. Restoring only the main database produces a portal that starts but serves resources pointing to missing files or to DataStore tables that no longer exist. For how the DataStore is structured, see the CKAN DataStore documentation.

Start with an inventory that maps each component to its location, its owner and the method that captures it. The main database and the DataStore database should be captured close enough in time that datasets and their loaded tables agree, and the FileStore should be captured in the same window, because a resource record without its file is a failed restore even when every database loads cleanly. Record the database roles as part of the configuration inventory, so the DataStore write and read-only users can be recreated on the target host with the access model your team approved. Then decide how the search index is handled. Confirm in the documentation for your CKAN version whether the index is restored or rebuilt after a restore, and write that decision into the runbook so the team is not working it out during an incident.

Three situations make this work necessary, and each one brings a deadline. Before a production launch, the team should have completed a restore on the target design and keep a record of the result. Before an upgrade, a recent known-good copy is the fallback if a release or extension change goes wrong, and CKAN minor releases may include backwards-incompatible changes. Where audit or contract terms apply, the recovery process must be written down, covering scope, recovery priorities and how backup data is protected. The CIS Controls group this expectation under Safeguard 11.1, which also calls for an annual review. Ask the auditor or client which of these records they expect, and agree the scope in writing before the work starts.

How CKAN backup and restore methods compare

This table compares the main ways to protect a CKAN portal: database dumps, PostgreSQL point-in-time recovery, FileStore copies, host-level tools and Velero for Kubernetes. Read each row for what it captures and misses, because a complete restore usually combines several methods. Confirm exact CKAN dump and restore commands against the CKAN documentation for your version before you write runbooks.

MethodWhat it captures and missesHow it restoresWhen it fits
Main database logical dumpCaptures catalog metadata, users, organizations and activity in the main database. Misses ckan.ini, uploaded files, DataStore tables and the search index.Restore into an empty database with matching PostgreSQL client tools, then rebuild the search index. Confirm commands for your version.Routine scheduled backups, paired with file and DataStore copies so the set is complete.
DataStore database logical dumpCaptures tables loaded into the separate DataStore database. Misses original resource files and the search index.Restore into a separate empty database, recreate the DataStore users, then confirm the Data API returns rows.Any portal that loads resources into the DataStore. Skipping it leaves Data API queries empty after a restore.
PostgreSQL base backup with WAL archivingCaptures every CKAN database in the cluster at a chosen point in time. Misses the FileStore and configuration files outside PostgreSQL.Restore the base backup, replay archived WAL to a target time, start the server and verify. Rehearse this on a separate host.Portals where losing hours of edits is unacceptable. Needs archive storage and a tested recovery runbook.
FileStore copy or volume snapshotCaptures uploaded resource files and images on the FileStore path. Misses all database rows, so files and databases must be backed up together.Copy files back to the same path with the ownership CKAN expects, then check that resource downloads work.Any portal with uploaded files. Snapshots must be taken at the same time as the database backup to stay consistent.
Host-level tools such as Bareos or Proxmox Backup ServerCaptures whole VMs or hosts, including OS, configuration and local data. Misses database consistency unless the database is dumped or quiesced first.Restore a whole host or selected files from the backup server. Test restores in an isolated network before relying on them.Organizations that already run enterprise backup and want one catalog across hosts. Confirm how the tool handles PostgreSQL.
Velero (Kubernetes only)Captures Kubernetes objects and persistent volumes via snapshots or file system backup. Misses database contents unless separate dumps cover them.Restores Kubernetes resources and volumes into a cluster. Database contents still need a restore from a dump or base backup.CKAN running on Kubernetes where the cluster team already uses Velero. Pair it with database backups.

How the parts of a CKAN backup fit together

The diagram starts in the portal environment, where the main PostgreSQL database, the DataStore database, the FileStore and the configuration files hold a CKAN site's state. Each store is copied to backup storage in a separate account run by the backup administrator, so portal administrators sit on the other side of the trust boundary. The final arrow shows restores running in a staging environment, away from the live site. When you review this design, check that portal administrators cannot change or delete backups within their retention period, that database and file copies come from the same point in time, and that restore tests start from backup storage.

Backup copies cross the trust boundary, and restores run only in staging.

What a complete CKAN backup covers across four stores

A complete CKAN backup has to cover four stores, and missing any one of them leaves the restore incomplete. The main database holds the catalog: datasets, resource metadata, users, organizations, groups and permissions. The DataStore is a separate PostgreSQL database that holds the tabular data loaded from resources, and it has its own write user and read-only user. That separation is the most common gap. Teams dump the main database, assume they have the whole portal, and then find the DataStore tables missing or the access roles absent after restore. Before you write the backup job, confirm the DataStore database name and both roles from the ckan.datastore.write_url and ckan.datastore.read_url settings in ckan.ini. Include the role definitions in your backup, because a dump of the data alone does not recreate the logins the portal expects.

The FileStore holds files uploaded directly to the portal. It sits on the storage path your deployment configures, outside both databases, so back it up as files and keep ownership and permissions intact so the web and worker processes can read it after restore. The fourth store is configuration: the ckan.ini file, plus any environment variables or container secrets that hold database passwords, the session secret and API keys. Without them the portal either fails to start or connects to the wrong database. Store these copies under the same access controls as your database dumps, because a configuration copy is effectively a list of credentials. Confirm which secrets come from a secrets manager, and back up those entries through that manager's own process.

Setting up CKAN backup and restore with a check at each step

This sequence builds a CKAN backup you can trust, from an inventory of every store to a restore on an isolated host that has been checked. Each step ends with a concrete check, so the team knows the backup works before an incident depends on it. The result is a documented process, a scheduled and protected backup set, and a recorded restore test.

  1. Inventory every store and its location

    Start by listing every place CKAN keeps state: the main PostgreSQL database, the DataStore database, the FileStore directory or bucket, and the configuration files, including the site configuration and secrets kept outside it. For each store, record the host, the path or bucket, and which accounts can read or write it. Record the Solr index as rebuildable from the database and list extensions and theme code held in version control. Done when a second engineer has checked the table against the running server and no store is missing.

  2. Write the recovery process and owners

    Write a recovery process that states the scope of what is backed up, the priority order in which services must return, who can declare a restore, and how backup data is protected in storage and in transit. Assign an owner to each step and schedule a review of the document at least once a year, as CIS Controls v8.1 Safeguard 11.1 describes. List the versions a recovery needs, including CKAN, PostgreSQL and each extension in use. Done when the platform owner has approved the document and an engineer who did not write it can follow it from start to finish.

  3. Set backup frequency by data sensitivity

    Set the schedule for each store according to how sensitive its content is and how quickly it changes. CIS Controls v8.1 Safeguard 11.2 asks for automated backups of in-scope assets weekly or more often, depending on data sensitivity, so treat that as the floor and shorten the interval for portals with user accounts or frequent harvests and edits. Run the schedule from a scheduler that logs each job and raises an alert on failure. Done when a deliberately failed test job produces an alert and the log shows the time of the last successful run.

  4. Encrypt dumps and store copies separately

    Write each dump to encrypted storage and keep at least one copy in a location separate from the CKAN hosts, such as off-site or isolated storage. Database dumps contain user accounts, password hashes and API tokens, so limit read access to named backup administrators. CIS Controls v8.1 Safeguards 11.3 and 11.4 describe protecting recovery data at the same level as the original and keeping an isolated copy. Done when the CKAN service account can write new dumps but cannot read or delete existing ones, and an authorized administrator can decrypt a test dump.

  5. Run the first backup and record it

    Run one full backup of every store in the inventory, using the same schedule and encryption settings you plan to use in production. Record the time, file sizes, checksums, and the CKAN, PostgreSQL and extension versions alongside each dump. The DataStore database is a separate PostgreSQL database, so confirm it is dumped as well as the main database. Done when every store has a dump, a checksum and a log entry, and the checksums still match after the copy reaches its separate location.

  6. Restore to an isolated host

    Restore the backup to an isolated host running the same CKAN version and the same PostgreSQL major version. Place the host on a network path that cannot reach production services, and disable outbound email so no users are contacted. Restore the main database, the DataStore database, the FileStore and the configuration, then start CKAN against them and rebuild the search index before testing. Done when CKAN starts on the isolated host and the restore log shows no errors from the database or FileStore steps.

  7. Confirm the restore with recorded checks

    Record the checks that confirm the restore. Compare dataset and organization counts with the counts recorded when the dump was taken, run a DataStore query through the Data API on a known resource and compare its row count, and download a sample of FileStore resources and verify them against their checksums. Sign in as a test user with a known role. Save the results with the restore date and the dump identifier. Done when every check passes and the record names the person who ran each one.

  8. Repeat the restore test after changes

    Repeat the full restore and checks after each CKAN upgrade, extension change or change to the storage target, and at least once a year. DORA Article 11(6) requires financial entities to test ICT response and recovery plans at least yearly and after substantive changes, including switchovers to backups. Keep the same checks each time so results can be compared over time. Done when the new restore record sits beside the previous one and any failed check has a logged fix and a passing retest.

Choosing a restore path by failure type

A dataset or organization deleted by mistake usually still exists in the main database until it is purged, so the first step is to check whether the record can be recovered in place before any restore starts. Restoring a whole environment to fix one record can overwrite edits made since the backup, so the restore path should be chosen with that loss in mind. Point-in-time recovery is seldom needed when a recent dump exists, but it becomes useful when the deletion happened after the newest dump and later edits must be kept.

  • Stores involved: the main database holds the metadata, and the FileStore holds uploaded resource files, so both must match the restored record.
  • DataStore: restore the DataStore database as well if the deleted resources had loaded tables, because the Data API reads from it.
  • Staging first: restore the dump into a staging copy, locate the record, and list which later edits would be lost before touching production.
  • Targeted recovery: export only the affected dataset or organization from staging and reapply it to production, which leaves later edits intact.

Afterwards, check that the dataset, its resources, collaborators and organization membership are visible, that resource downloads work, and that search shows the record again.

Protecting CKAN backup files that hold user data

A CKAN backup holds the main database, DataStore, FileStore and configuration, so it contains user accounts, API token records, private dataset metadata and secrets. The controls below decide who can change, read, copy, keep and delete those files. Treat the dump store as more sensitive than the portal it came from.

Separate the backup administrator

Run dumps and manage retention with an account that is not a CKAN sysadmin or a server administrator for the portal. Under Essential Eight maturity level 3, backup administrator accounts cannot modify or delete backups during their retention period (ISM-1708 and ISM-1813). Confirm that portal sysadmins, cloud administrators and backup administrators are separate groups, and test that a portal sysadmin cannot delete a stored dump.

Essential Eight maturity model

Limit who can read dumps

A dump contains every user's account record, password hashes, API token records, private dataset metadata and DataStore rows, so read access is a data exposure. Unprivileged accounts should not reach even their own backups (ISM-1706). Keep the list of readers short, record it, and remove people when their role changes. Check storage permissions directly, since CKAN organization roles do not apply to files in a backup bucket.

Encrypt dumps and isolate a copy

Encrypt each dump before it leaves the server, and keep the decryption keys apart from the dump store so that reading the store alone does not expose the data. CIS Safeguard 11.3 expects recovery data to get the same protection as the original, through encryption or separation. CIS Safeguard 11.4 expects an isolated copy, such as an offline, cloud or off-site copy that a compromised portal cannot reach. Test a restore from that isolated copy, since an encrypted dump without its key cannot be restored.

CIS Control 11 specification

Secrets in configuration files

A CKAN configuration file such as ckan.ini usually holds database passwords, Solr and Redis connection details, mail server credentials and any SSO client secrets or certificates. If the backup includes that file, every copy of the dump is also a copy of those secrets. Decide whether configuration is backed up in full, backed up with secrets removed, or kept in a secrets manager and restored separately. After a dump containing live secrets is exposed, rotate those secrets and check which systems used them.

Retention and deletion of old dumps

Dumps keep personal data after a user is removed from the portal, so deleting a user in CKAN does not remove that person from older backups. Set one retention period for each backup type, record the reason for keeping it, and delete dumps when it ends, including replicas and the isolated copy. The retention period also defines how long write protection applies, so set it before you configure write protection on the store. Run a deletion test to confirm that expired dumps are actually removed.

Log access to backup storage

Log every read, write, delete and permission change on the backup store, along with every dump and restore run against it. Send those logs where the backup administrator cannot edit or delete them, so no account can remove its own trail. Review the logs on a set schedule and alert on reads from accounts outside the named reader list. Confirm which events your storage platform records by default, since default logging varies by platform.

Testing CKAN backup and restore before you need it

A CKAN backup is unproven until a restore has been completed on a separate host running the same CKAN version and the same extensions. Until then, you hold files, not a recovery capability. The test should rebuild the portal from one backup set: the main PostgreSQL database, the DataStore database, the FileStore directory and the configuration file (ckan.ini) that points the restored instance at its databases, Solr, Redis and storage. Keep the restore host isolated from production. Disable scheduled jobs, harvests and outbound email so a test copy cannot write back to live sources or notify users. Decide in advance who owns the test, which backup set is used, and what counts as a pass. Match the PostgreSQL major version to production, and confirm how your team would handle a version change before relying on it during an incident.

A restore test should verify more than whether the restore command exited without error. Compare dataset and resource counts with the source at the time of the backup. Open a sample of datasets and confirm their metadata and custom fields are intact. Check that FileStore downloads match the originals by file size and checksum, and that DataStore resources answer queries through the Data API. Sign in as users with known roles and confirm that private datasets stay limited to the right organization. Then rebuild the search index, because a restored portal with empty search results looks broken even when the data is present. Record the evidence in a short report: the test date, CKAN, PostgreSQL and extension versions, the backup identifier and checksums, the commands and configuration used, the counts and checksums compared, each failure and its fix, and the name of the person who signed off.

How often to repeat the test depends on the obligations you answer to. CIS Safeguard 11.1 in Implementation Group 1 of CIS Controls v8.1 expects a documented data recovery process that is reviewed annually, so the restore test is the evidence that the process works, not only that it exists. For financial entities in scope of Regulation (EU) 2022/2554, Article 11(6) requires ICT response and recovery plans, including switchovers to backups, to be tested at least yearly and after substantive changes. Treat a CKAN upgrade, a PostgreSQL major upgrade or a change to FileStore storage as triggers for a new restore test. Ask your compliance team which obligations apply and which changes they consider substantive. DeployOpen can prepare the test evidence and the restore runbook, but independent auditors and certification bodies issue any assessment or attestation.

What to confirm before you rely on CKAN backup and restore

Six limits shape how a CKAN backup can be restored, and each one has a check you can run before an incident. Some come from PostgreSQL, some from CKAN's release policy, and some from your own data volumes and sector rules. Confirm them now, then write the answers into your restore runbook.

PostgreSQL major version support

The PostgreSQL versioning policy lists version 14 as supported only until the date shown here, and that date has already passed for any portal still running it. Check the major version of the server that hosts your CKAN database, including the DataStore database, and confirm it is still on a supported release. If it is not, pick an upgrade path from the PostgreSQL upgrade docs, such as dump and restore, pg_upgrade or logical replication. Run your restore test on the version you plan to keep, so the test reflects production.

PostgreSQL 14 support end
November 12, 2026
PostgreSQL versioning policy

Matching CKAN minor versions

A CKAN restore should go onto the same minor version that produced the dump, with matching extensions. Patch releases are designed not to break backwards compatibility and exclude schema changes, but minor releases may include backwards-incompatible changes. Read the release policy and the upgrade notes before you move a restored portal to a newer minor release. Confirm that each extension you run has a version for the CKAN release you restore onto, and record both versions in your backup metadata.

CKAN release policy

Failover is not automatic

PostgreSQL supports hot standby servers and both synchronous and asynchronous replication, but it does not detect a failed primary or notify the standby on its own. If a standby is part of your recovery plan, you need external tools or a documented runbook that decides when to promote it. A replica is not a backup, because a bad delete or a corrupted write reaches the replica too. Keep point-in-time recovery archives alongside any standby, and test promotion and CKAN reconnection on a schedule.

PostgreSQL failover docs

Search index, jobs and Redis state

A database restore brings back PostgreSQL data, but the Solr search index, queued background jobs and Redis state may reflect a different point in time. Datasets can be missing from search, or queued jobs can point at records that have changed since the backup. Decide for each component whether to rebuild, clear or keep it, and write that decision into the restore runbook. Time the rebuild on a copy of your portal, because the effort grows with the number of datasets and resources you hold.

Storage and bandwidth for retention

Each backup holds the main database, the DataStore database, the FileStore and configuration, so its size depends on your datasets, uploaded resources and how many versions you keep. Measure dump size, compression time and transfer time in your own environment across a full retention cycle, including the offsite copies you need. Confirm that your storage can hold the retention you require and that your bandwidth can move a full backup within your backup window. Ask your storage and network teams to check both before you set the schedule.

Sector rules for frequency and testing

Sector rules can set the backup frequency and test cadence for you. DORA Article 12 asks financial entities to document backup scope, a minimum frequency based on criticality or confidentiality, and restoration procedures. Article 11 asks for ICT response and recovery plans to be tested at least yearly and after substantive changes, including switchovers to backups. Ask your compliance lead which rules apply to the portal and its data, then set the schedule and test plan from those answers.

DORA Article 12 text

How much effort CKAN backup and restore takes, and what you need

What drives the cost of CKAN backup and restore work?

The main cost drivers are how many hosts and databases are in scope, how much discovery your environment needs, and how many restore paths must be proven. The work has five cost components. Planning and documentation covers the recovery scope (the main database, the DataStore database, FileStore and configuration), recovery priorities and who approves them. Scripting and scheduling covers dump jobs, file copies, retention rules and failure alerts. Storage covers where copies live and how they are kept separate from production. Restore testing covers building a restore environment and proving that a restore works. Ongoing support covers monitoring, script changes after CKAN upgrades and periodic retests. Planning and scripting are mostly one-time, while storage, monitoring and testing recur. When you request a written quote, ask for each component as its own line, the assumed environment, the restore environment, who runs each test, and what is excluded.

How long does CKAN backup and restore setup take?

No single duration applies, because the time depends on your environment and on how much of the backup setup already exists. The main factors are how many hosts hold CKAN's database, DataStore, FileStore and configuration, whether backup tooling is already in place, how well the current setup is documented, and whether the restore environment must be built from scratch. Approvals for access and storage targets often set the pace more than the scripting does, especially when security teams must review where copies are stored. Ask for a written plan that breaks the work into phases, such as discovery, scripting, a first full restore test and handover, with the dependencies for each phase. Confirm how long your internal approvals take before the plan is agreed, because those waits sit outside the technical build.

What does CKAN backup and restore need from our team?

Four things come from your side: access, storage targets, a restore environment and a named owner.

  • Access: accounts on the CKAN, PostgreSQL and file storage hosts with rights to run dumps and copy files, plus read access to the configuration.
  • Storage targets: a location for backup copies with encryption, retention settings and a separate copy that production administrators cannot change.
  • A restore environment: a non-production place where CKAN can be rebuilt from backups, with its own database, file storage and search index.
  • A named owner: one person who approves the recovery scope, accepts test results and stays accountable for the process after handover.

Confirm each item with your infrastructure and security teams early, because approvals often take longer than the technical work.

Can our own team set up CKAN backup and restore without a partner?

Often yes, if the team already runs PostgreSQL, Linux hosts and CKAN in production, but the work is more than copying files on a schedule. The team needs skills in PostgreSQL dumps and restores, file storage, scheduling, secrets handling and CKAN's configuration layout, plus time to write the recovery procedure and run a full restore test. The gaps that usually surface are the DataStore database, which is kept separate from the main database, and FileStore paths that differ between installations. Check whether the people who run the process can also change or delete backups, since separation of duties is a control question as well as a technical one. DeployOpen works on fixed-scope engagements, so scope, deliverables and timelines are agreed in writing before work starts, while your team keeps ownership of the procedure. Decide by listing the skills and time your team can commit, then comparing that list against the written scope.

How often should we test CKAN restores?

Test a restore on a schedule and after any change that could break it, so the first full test does not happen during an incident. The CIS Controls Assessment Specification for Control 11 expects a documented recovery process that is reviewed annually, and its Safeguard 11.2 expects automated backups weekly or more often, depending on data sensitivity. For EU financial entities, DORA Article 11(6) requires ICT response and recovery plans to be tested at least yearly and after substantive changes, including switchovers to backups. Treat CKAN upgrades, PostgreSQL major upgrades, search index changes and storage moves as triggers for a retest. A useful test restores all parts into the restore environment, then checks dataset counts, DataStore queries, resource downloads and user logins. Record what was restored, how long it took and what needed manual fixes, so the next test has a baseline.

Can CKAN backup files contain personal data that needs deletion rules?

Yes. A full database dump includes the user table, which can hold names, email addresses, account activity and API token records. DataStore tables and uploaded files can also contain personal data if publishers loaded it. Backup copies are often kept longer than live data, so a user deleted from the portal can still appear in older dumps until those dumps expire. Define the rule before the first dump: how long copies are kept, who can restore them, whether restored data is cleaned of deleted accounts, and how deletion requests are logged. Encrypt copies and restrict restore access so that every restore is controlled and traceable. Confirm the approach with your privacy and legal teams, because the right answer depends on your jurisdiction and the lawful basis you rely on.

How DeployOpen scopes, delivers and supports CKAN backup and restore

DeployOpen scopes CKAN backup and restore as a fixed-scope engagement, with the written scope naming each component to protect: the main database, the DataStore database, the FileStore and the configuration. We build the dump and restore procedures in your infrastructure, test them with restores, and hand over documented procedures for your team. Ongoing support and continuous testing are available as a retainer.

How we scope

  • The written scope lists each CKAN component to protect: main database, DataStore database, FileStore and configuration.
  • We confirm which dumps contain user data, such as account records, and where they will be stored.
  • The written scope also fixes deliverables, acceptance tests and the environments in scope before work starts.

How we build

  • Dump and restore procedures are built inside your cloud accounts, data centers or air-gapped networks.
  • Scheduled jobs cover PostgreSQL dumps, FileStore copies and configuration files, with backup storage access kept apart from portal credentials.
  • Encryption, retention and access rules for dumps are set in the design, checked against your own policies.

How we hand over

  • Restores are tested on a separate environment, and the test results are recorded with the handover.
  • Documentation covers dump and restore commands, schedules, storage locations, key handling and the restore runbook.
  • Your team walks through a restore with us so staff can run one themselves.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainer work can include periodic restore tests and review of backup jobs after CKAN or PostgreSQL changes.
  • Scope changes, such as a CKAN upgrade or a new storage location, are agreed in writing before work changes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.