Backup and restore#
Everything in Empowerment Center is in the own database. This page explains how to back it up with your engine's tools (those of PostgreSQL or, if the own database is in Oracle, those of Oracle), what has to be kept besides the backup, how to restore it and what the copies are that ECenter keeps on its own of workbooks, templates and metadata.
What has to be backed up#
| What | Where | How |
|---|---|---|
| The own database | The db-data volume of the db service, or the PostgreSQL server. In Oracle, the ECenter schema |
With pg_dump or with continuous backup (below). In Oracle, with RMAN or with Data Pump (see With the own database in Oracle). |
ECENTER_SECRETS_KEY |
deploy/.env |
Separately, in a secrets manager or a safe. |
| The configuration | deploy/.env and your own application.yml |
Separately, with the same protection as the key. |
The own database stores the metadata, security, workbooks with their backups, lists, groupings, portal publications and templates, geographic layers, scheduled tasks, subscriptions and alerts, service credentials, sessions, the audit and the license.
Warning
Without ECENTER_SECRETS_KEY, a database backup can be restored but the connections' passwords cannot be decrypted and they all have to be typed again. And whoever has the backup and the key has those passwords: keep both with the same protection, but not together.
What is not in the backup#
ECENTER_SECRETS_KEY, the.envfile and your ownapplication.yml, which are kept separately.- The clients' databases, which have their own backup. The work tables ECenter creates in them (lists, groupings, external data) are filled again when refreshed or used.
- Jobs in progress and their results, which live in the backend's memory: after restoring, users calculate again.
- The routing engine's graph, which rebuilds itself.
Back up the own database#
What follows is for the own database in PostgreSQL. With the sample Docker Compose installation, the backup is made with the database superuser from inside its container, with the application running (pg_dump gives a consistent backup even while it is in use):
docker compose -f deploy/compose.yaml exec -T db \
pg_dump -U postgres -Fc ecenter > ecenter-$(date +%F).dump
The resulting file is compressed (-Fc) and is restored with pg_restore. Schedule the backup daily with the system scheduler and keep several, off the server.
Note
Make the backup with the superuser (postgres), as in the example. The ecenter user cannot read the tables the PostGIS image creates for its auxiliary extensions, and pg_dump with it fails with “permission denied for schema tiger”. The superuser has no password: it only gets in from inside the container, as in the example.
With a lot of activity, a continuous backup is better (PostgreSQL's WAL archiving, with point-in-time recovery), or the managed service's backup, if the own database is in one. In a managed service, use its backup or run pg_dump with a user who can read all the tables of the database.
Restore the own database#
To go back to a backup, on the same server or on another:
-
Stop the backend, so nobody writes during the restore:
-
Drop the database and create it empty, with
ecenteras owner: -
Restore the backup with the superuser, which also creates the extensions:
-
Start the backend:
The restored tables keep ecenter as their owner. On startup, the backend applies the missing migrations if the backup is from an earlier version.
On another server, prepare the installation first (steps 1 and 2 of Install with Docker Compose) with the same ECENTER_SECRETS_KEY as the source installation, start only the database (docker compose -f deploy/compose.yaml up -d db) and follow the steps above.
Important
Restoring replaces everything: what was done after the backup (saved workbooks, created users, audit) is lost. Before restoring, back up what is there now.
After restoring#
- The license travels with the backup: it is in the own database with the installation identifier. If you restore on another server and the old one is still in use, each one needs its license.
- Sessions are also in the backup, but will almost always have expired (30 minutes without use): users sign in again.
- Scheduled runs that were running at the time of the backup are treated as interrupted on startup.
- If
ECENTER_SECRETS_KEYis not the same, Administration › Connections shows on each connection “The saved password cannot be decrypted: enter it again.”. Click Change password… on each one. The remote targets of the file export also warn of it: type their credential again with Edit….
With the own database in Oracle#
If the own database is an Oracle schema (see The own database in Oracle), backups are made with the Oracle tools, not from ECenter or with pg_dump. There are two ways:
| Way | How |
|---|---|
| With the database backup | The ECenter schema goes into the backup of the organization's database (RMAN), with its data. |
| The schema alone | It is exported with Data Pump: expdp ecenter schemas=ECENTER …, with the directory and dump file of your standards. |
- Restore with the backend stopped, as in PostgreSQL, so nobody writes during the restore.
- What is not in the backup is the same:
ECENTER_SECRETS_KEY, the.envfile and your ownapplication.yml, which are kept separately (see What is not in the backup). - After restoring applies equally: the license, the sessions, the scheduled runs and the passwords that cannot be decrypted if the key is not the same.
- The copies ECenter keeps of workbooks, templates and metadata (below) are in the schema, so they go into its backup.
What grows most in the schema is the audit, the kept data of cubes, the frozen versions of the portal and geographic layers with their tiles.
The copies ECenter keeps#
Besides the database backup, ECenter keeps copies on its own that serve to undo a change, not to recover the installation. They are all in the own database, so they go into its backup:
| Copies | When they are made | Where they are restored |
|---|---|---|
| Of each workbook | On saving it, of what was there before. | With the workbook's Backups… (see the User manual). |
| Of each portal template | On saving it, of what was there before. | With the template's Backups…. |
| Of the metadata of each connection | Before each import onto a connection with metadata, before each restore and on request. | With Backups… in Administration › Metadata (see Metadata). |
Of each one, the last 10 of today and the last one of each of the 7 previous days are kept. It is changed in ecenter.workbooks.backups-*, ecenter.portal.layouts.backups-* and ecenter.metadata.backups-* (see Operations, audit and scheduling).
Exporting the metadata of a connection as a package serves to take it from one environment to another (from development to production) or to keep it in a repository, not to recover an installation: it carries no users, connections or anything specific to the installation. See Metadata.