Backups and restores (Windows)
How to back up and restore the Informer PostgreSQL database from PowerShell on Windows.
What should I back up?
Informer has four main components:
- Informer: where the application itself lives.
- Elasticsearch: where Datasets are indexed and stored.
- PostgreSQL: where the Informer metadata, system settings, and workspaces are stored.
- Redis: where cached elements of the application are stored.
At a minimum, back up the PostgreSQL database, since it is the only component that cannot be easily recovered. You may also want to back up Elasticsearch so you do not have to refresh every Dataset after a restore; see the Elasticsearch snapshots documentation for how.
All Informer components except PostgreSQL must be stopped before restoring from backup, or you risk corrupt data.
These commands use the default Postgres username (postgres) and port (5432), and assume the backup is a file named backup_all.sql. If your values differ, adjust the commands. You can confirm the values in the db block of the Informer config.json.
Backing up PostgreSQL
The supported method is PowerShell. (You can also copy the PostgreSQL data files or use a snapshot procedure, but this article covers the PowerShell method.)
This method backs up every database on the PostgreSQL server. If PostgreSQL serves other applications and you do not want to back them all up, contact Support for alternative methods.
-
Make sure the Informer process is stopped.
-
In an elevated PowerShell prompt, navigate to the folder where you want the backup to reside.
-
Run:
pg_dumpall -c -U postgres -p 5432 -f backup_all.sqlPassword promptsThis command may prompt for a password once per database on the server, so with password authentication you may type it several times. For example, with five Datasources configured, the password is requested five times.
-
Verify the backup file has contents, by opening it or checking the file size.
If you back up by another method (File Explorer, and so on), the default location of the PostgreSQL data files is C:\Program Files\PostgreSQL\version\data.
Restoring PostgreSQL
-
Make sure the Informer process is stopped.
-
In an elevated PowerShell prompt, navigate to the folder with your backup.
-
Run:
psql -U postgres -p 5432 -f .\backup_all.sql
If you backed up by a method other than the one above, restore using that same method.