New in phaf 26.11.1: Windows installer, CSV, Email and REST connectors. Release notes → A Spectro Web Solutions product ↗ EN PL

Installation guide · Windows Server

Backup and restore

What to back up, how often, and how to restore on a new server.

Everything phaf needs to come back after a failure is in three places: the data folder, config.json and, if you use it, the SQL Server database. Back them up regularly and test a restore once.

What to back up

ItemWhereWhy it matters
Encryption keyC:\phaf\data\phaf.master_keyWithout it, no stored password can be read. Keep an extra copy outside the normal backups (see below).
Data folderC:\phaf\data\Users, security settings, workspaces and flows, certificates, shared connections, messages and — with SQLite — the database.
ConfigurationC:\phaf\app\config.jsonData folder, port and database connection.
SQL Server databaseYour SQL ServerTransactions, logs and audit, if you use SQL Server. Include it in your normal SQL Server backup plan.
IIS siteC:\phaf\iis\web.config and the certificateThe HTTPS front end.

You do not need to back up C:\phaf\app itself: you can always reinstall it with the installer of the same version. Keep the installers of the versions you install.

The encryption key

Copy phaf.master_key once after the first start, and keep it apart from the normal backups — in a password vault or an encrypted offline medium, with access restricted to administrators. It does not change over time, so one copy is enough.

Treat the key like a password

Anyone who holds both a backup of the data folder and the key can read the passwords stored in phaf. Never store the key in the same place as the data backups without encryption.

How to back up

With SQLite

Copy the data folder with the phaf service stopped, so the database file is consistent. A daily copy usually takes seconds:

PowerShell
$svc = (Get-Service | Where-Object DisplayName -like 'phaf*').Name
Stop-Service $svc
$stamp = Get-Date -Format 'yyyy-MM-dd'
Compress-Archive -Path C:\phaf\data, C:\phaf\app\config.json -DestinationPath "E:\Backups\phaf-$stamp.zip"
Start-Service $svc

Schedule this at a quiet hour, or include the folder in your backup software with a pre-backup step that stops the service and a post-backup step that starts it.

With SQL Server

The database is backed up by SQL Server while phaf keeps running. Back up the data folder and config.json with your file backup software; phaf does not need to stop. Take both at about the same time, so the files and the transaction history match.

How often

  • Daily — data folder, config.json and the SQL Server database.
  • After every important change — new flows, certificates or users.
  • Before every upgrade — always.
  • Once — the encryption key, in its separate safe place.

Keep at least 14 days of backups, or follow your own retention policy.

Restore on the same or a new server

  1. Prepare the server as in Requirements.
  2. Run the installer of the same phaf version, then stop the phaf service.
  3. Restore C:\phaf\data and config.json. Check that phaf.master_key is in the data folder.
  4. With SQL Server: restore the database, or point config.json to the restored copy. The ENC:v1: password keeps working because the key is the same.
  5. Set the service account and the folder permissions again (The Windows service).
  6. Start phaf in Safe Mode the first time, to check everything before files start moving: add "safeMode": true to config.json, start the service, check flows and connections, then remove the line and restart the service.

Test it once

Restore a backup on a test server after the installation. It is the only way to know that the backup is complete and that the key matches.