Backup and Restore

The Enterprise Solid Server (ESS) uses a PostgreSQL database to store Resource Description Framework (RDF) data and non-RDF data. By default, ESS stores data in a database named ess.

Prerequisites

The following examples assumes the use of PostgreSQL environment variables for the various connection settings:

  1. Set the following PostgreSQL environment variables:

    • PGHOST for the database server hostname.

    • PGPORT for the database server port (default 5432).

    • PGDATABASE for the database name (default ess).

    • PGUSER for the username.

  2. Set the user password in a password file.

Refer to the your configuration settings to determine the values used for your deployment.

Note

  • For pg_dump and psql, you can specify command-line connection parameters instead.

  • For pod_datastore, you must specify the connection settings via the environment variables and password file.

Backup and Restore a Solid Pod

ESS stores each Pod in its own collection of tables in the ess database. ESS provides the pod_datastore to backup and restore a Pod.

pod_datastore --pod <pod_name> [--data-location <directory>] <backup|restore>
Backup a Pod using pod_datastore

To backup a Pod, you can use the pod_datastore command-line tool. For example, the following operation creates a backup of a Pod whose URL is https://pods.inrupt.com/mypod and places the backup in the /opt/backup/mypod directory:

pod_datastore --pod mypod --data-location /opt/backup/mypod/ backup
  • You must include the --pod option.

  • You can include the --data-location option, specifying the back up directory path. If unspecified, the default value of backup_<pod_name> is used for the directory path.

Restore a Pod using pod_datastore

To restore a Pod, you can use the pod_datastore command-line tool. For example, the following operation restores a Pod whose URL is https://pods.inrupt.com/mypod from the backup in the /opt/backup/mypod directory:

pod_datastore --pod mypod --data-location /opt/backup/mypod/ restore
  • You must include the --pod option.

  • You can include the --data-location option, specifying the back up directory path from which to restore the Pod. If unspecified, the default directory backup_<pod_name> is used.

See also: pod_datastore.

Backup and Restore the ESS Database (pg_dump/psql)

Backup using pg_dump

For PostgreSQL database, you can use the pg_dump command-line tool to extract the content of the specified database.

For example, to dump the ESS database named ess, you can use pg_dump with a compression tool to create a compressed database dump file backup.2020-11-30.sql.gz:

pg_dump ess | gzip > backup.2020-11-30.sql.gz
Restore using psql

For PostgreSQL database, you can use the psql command-line tool to restore the ESS database from the dump files. You can use psql with an unzip tool to restore from a compressed dump file backup.2020-11-30.sql.gz:

gunzip -c backup.2020-11-30.sql.gz | psql ess

For information on PostgreSQL database backup/restore, refer to the PostgreSQL documentation.