You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For technical reasons, we cannot load secrets from Vault during the initial database setup. Therefore, a Secret must be created in each namespace containing the initial database user passwords. These values should match those stored in Vault.
1. Users Setup script is located at /tools/postgres/init/00_postgresql-user-setup.sql
195
209
1. Initial database setup script is located at /tools/postgres/init/01_postgresql-schema-setup.sql
196
-
1. Openshift secret yaml is located at ./database-users.secret.yml
197
210
198
211
## IP Whitelist Management
199
212
@@ -266,69 +279,72 @@ This should be stored at:
266
279
267
280
Backups are generated daily by the "backup" deployment in each namespace and are saved as a gzipped SQL script containing the database structure + data.
268
281
269
-
Backups are verified nightly at 4 AM by creating a temporary database instance, restoring the backup into it, and checking for tables in the restored database. This is configured in the `backup.conf` file, mounted from the `met-db-backup-config` ConfigMap.
282
+
Backups are verified nightly at 4 AM by creating a temporary database instance, restoring the backup into it, and checking for tables in the restored database. This is configured in the `backup.conf` file, mounted from the `engagement-db-backup` ConfigMap.
270
283
271
284
Backups are also uploaded to S3-compatible storage for offsite retention.
272
285
273
-
## Restoring from S3
286
+
###Restoring from S3
274
287
275
288
**Note**: The backup container does not support restoring directly from S3. If a backup has already been removed from the local FS, you must download it from S3 to the local `/backups/` directory first, then restore using the standard process.
276
289
277
290
To restore a backup stored in S3:
278
291
279
292
```bash
280
293
# Connect to backup container
281
-
oc rsh deploy/met-db-backup
294
+
oc rsh deploy/engagement-db-backup
282
295
283
296
# Source S3 credentials
284
297
source /vault/secrets/s3
285
298
299
+
# Configure mc (MinIO Client) for S3 access
300
+
mc aliasset dell_s3 $S3_ENDPOINT$S3_USER$S3_PASSWORD
301
+
286
302
# List backups in S3 bucket
287
-
mc ls minio_s3/engagement-dev-backup/
303
+
mc ls dell_s3/engagement-dev-backup/
288
304
289
305
# Download the desired backup file
290
-
mc cp minio_s3/engagement-dev-backup/met-patroni-app_YYYY-MM-DD_HH-MM-SS.sql.gz /backups/
306
+
mc cp dell_s3/engagement-dev-backup/engagement-patroni-app_YYYY-MM-DD_HH-MM-SS.sql.gz /backups/
291
307
292
308
# Now proceed with normal restore process (see scenarios below)
293
309
```
294
310
295
-
## Scenarios
311
+
###Scenarios
296
312
297
-
### 1. Normal Production Restore (Roles Exist)
313
+
####1. Normal Production Restore (Roles Exist)
298
314
299
315
**Use case**: Restoring to existing Patroni cluster where roles are already defined.
300
316
301
317
```bash
302
318
# Connect to backup container
303
-
oc rsh deploy/met-db-backup
319
+
oc rsh deploy/engagement-db-backup
304
320
305
321
# Add credentials to environment
306
-
source /vault/secrets/met-patroni
322
+
source /vault/secrets/engagement-patroni
307
323
308
324
# List available backups
309
325
./backup.sh -l # press Enter if prompted for password
310
326
311
327
# Restore with -I flag to ignore duplicate role errors
**Why `-I`?**: The backup contains `CREATE ROLE` statements at the end. Since roles already exist in production, these will fail but can be safely ignored.
316
332
317
333
---
318
334
319
-
### 2. Emergency Restore (Fresh Database)
335
+
####2. Emergency Restore (Fresh Database)
320
336
321
337
**Use case**: Restoring to a completely new PostgreSQL instance that has no existing roles.
0 commit comments