> For the complete documentation index, see [llms.txt](https://help.sentinelsoftware.com/sentinel-help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sentinelsoftware.com/sentinel-help-center/installation-and-updates/postgresql-backups.md).

# PostgreSQL Backups

Sentinel is using PostgreSQL database for all analytics/reports/history data. PostgreSQL should be done on regular bases to eliminate possible data losses in case of disasters.

## Standalone Hot Backup

This is the standalone backups which provide fast and consistent data snapshot. These are backups that cannot be used for point-in-time recovery, yet are typically much faster to backup and restore than `pg_dump` dumps. This backups can not be used for PostgreSQL version migration and can created and restored only on the same major version.&#x20;

**1. Find your PostgreSQL service name** (if you don't already have it):

```
sudo systemctl list-units --type=service | grep -i postgres
```

**2. Stop Sentinel and PostgreSQL:**

```
sudo systemctl stop sentinelsudo systemctl stop [YOUR_POSTGRES_SERVICE]
```

**3. Find your PGDATA path:**

```
sudo -u postgres psql -c "SHOW data_directory;"
```

**4. Clear the existing data directory** (replace the path with your PGDATA path from step 3):

```
sudo -u postgres rm -rf /your/pgdata/folder/*
```

**5. Go to your backup folder** (replace the date with your backup folder name):

```
cd /data/pg_backup/2025-07-17
```

**6. Extract the base backup:**

```
sudo -u postgres tar -xzf base.tar.gz -C /your/pgdata/folder/
```

**7. Extract the WAL files into the `pg_wal` subfolder:**

```
sudo -u postgres tar -xzf pg_wal.tar.gz -C /your/pgdata/folder/pg_wal/
```

**8. Remove the standby marker file:**

```
sudo -u postgres rm -f /your/pgdata/folder/standby.signal
```

> Without this step, PostgreSQL will start in read-only replica mode and refuse all writes. There is no obvious error — the service appears healthy but nothing can be saved.

**9. Fix permissions:**

```
sudo chown -R postgres:postgres /your/pgdata/folder/sudo chmod 700 /your/pgdata/folder/
```

**10. Start the services:**

```
sudo systemctl start [YOUR_POSTGRES_SERVICE]sudo systemctl start sentinel
```

<br>
