Operations

Backup & Recovery

A Structr installation stores data in two separate locations: the graph database (Neo4j) holds all objects and relationships, while binary file contents and configuration are stored in the Structr installation directory. A complete backup must include both.

What to Back Up

Component Location Contains
Database Neo4j data directory All objects, relationships, schema, users, permissions
Structr directory Structr installation directory Binary files, configuration, certificates, scripts

The Structr directory contains several important subdirectories and files:

The database and Structr directory must be backed up together to maintain consistency. A file referenced in the database must exist in the files/ directory, and vice versa.

Application Backup

To back up your application structure without data, use the Deployment Export feature. This creates a portable folder containing schema definitions, pages, templates, components, and configuration files that can be stored in version control.

Application backups are useful for:

See the Application Lifecycle chapter for details on deployment exports.

Full Backup (Cold Backup)

A cold backup taken with all services stopped is the most reliable way to back up a Structr installation. It guarantees consistency between the database and binary files.

Server Installation

  1. Stop Structr: systemctl stop structr
  2. Stop Neo4j: systemctl stop neo4j
  3. Back up the following:
  1. Start Neo4j: systemctl start neo4j
  2. Start Structr: systemctl start structr

Docker Installation

  1. Stop the containers: docker-compose down
  2. Back up the Docker volumes:
  1. Start the containers: docker-compose up -d

You can find your volume locations with docker volume inspect <volume-name>.

VM Snapshots

If Structr and Neo4j run on the same virtual machine, creating a VM snapshot is the simplest backup method. Stop both services before taking the snapshot to ensure consistency.

Restore

Server Installation

  1. Stop Structr: systemctl stop structr
  2. Stop Neo4j: systemctl stop neo4j
  3. Replace the Neo4j data directory with the backup
  4. Replace the Structr installation directory with the backup
  5. Start Neo4j: systemctl start neo4j
  6. Start Structr: systemctl start structr

Docker Installation

  1. Stop the containers: docker-compose down
  2. Replace the volume contents with the backup data
  3. Start the containers: docker-compose up -d

Backup Strategy Recommendations

Related Topics