# Start Here

This folder contains the extracted files you are most likely to use.

## 1. Initial install

Use:
- `one-command-installer/scripts/install-node.sh`
- `one-command-installer/examples/db1.env`
- `one-command-installer/examples/proxy1.env`

Run on each VPS after editing the matching env file:

```bash
sudo bash scripts/install-node.sh /path/to/your.env
```

## 2. Add/remove DB nodes and auto-update HAProxy

Use:
- `haproxy-auto-update/scripts/cluster-node-haproxy.sh`

Examples:

```bash
./cluster-node-haproxy.sh add-replica db4 10.20.0.14 root@db4.example.com root@proxy1.example.com
./cluster-node-haproxy.sh remove-replica db4 root@db4.example.com root@proxy1.example.com
```

## 3. Backups + WAL archiving

Use:
- `backup-wal/scripts/setup-backup.sh`
- `backup-wal/scripts/restore-example.sh`
- `backup-wal/examples/repo.env`
- `backup-wal/examples/db.env`

Recommended order:
1. configure backup repo host
2. configure each DB node
3. copy postgres SSH keys to backup repo host
4. patch Patroni config with archive settings
5. restart Patroni one DB node at a time
6. create stanza and take first full backup

## 4. Migration / cluster maintenance

Use:
- `migration/MIGRATION_PLAYBOOK.md`
- `migration/scripts/cluster-node.sh`

## 5. Earlier generated bundles

If you want the original intermediate packages, see `../bundles` and `../legacy`.
