Saltar a contenido

PDF-004D Staging Postgres Backup Baseline Execution

Fecha local: 2026-06-19

Estado: BASELINE BACKUP EJECUTADO / GO PDF-004E RESTORE DRILL / NO-GO PDF-004 DDL NEGOCIO / NO SECRETS / NO DDL-DML / SANDBOX INTACTO

portal_visible = yes

Scope: tenant

tenant_id: alpuntodeventa

Owner: Gabi / Carlos Canu

Fuente de verdad: docs/tenants/alpuntodeventa/business-observer/production/PDF-004D-STAGING-POSTGRES-BACKUP-BASELINE-EXECUTION.md

1. Objetivo

Ejecutar y documentar el primer backup baseline logico real del PostgreSQL staging-vps de Business Observer, como checkpoint operativo previo a cualquier DDL de negocio.

Este backup cubre solo el catalog bootstrap postgres, porque la DB de negocio openclaw_business_observer_staging todavia no existe.

2. Safe point

Control Valor
workspace C:\APV\openclawai
rama main
HEAD/origin observado al iniciar ffc2b86ac75ef7ea2d5830226b3094e85b87794c
ultimo commit observado al iniciar docs: preflight business observer staging postgres real target
decision SAFE POINT PASS / BACKUP BASELINE ONLY

3. Validacion local de arranque

Control Resultado
git status -sb PASS ## main...origin/main
git rev-parse HEAD PASS ffc2b86ac75ef7ea2d5830226b3094e85b87794c
git diff --check PASS limpio al iniciar
MkDocs strict PASS con .\\.venv-portal\\Scripts\\mkdocs.exe build --strict

Nota operativa local: la ruta literal ..\\.venv-portal\\Scripts\\mkdocs.exe no existe desde C:\APV\openclawai; la venv disponible para este repo es .\\.venv-portal.

4. Preflight VPS

Comandos remotos ejecutados por ssh -o BatchMode=yes openclaw-vps:

  • hostname
  • uptime
  • df -h /
  • free -h
  • docker ps del contenedor staging
  • docker inspect de health y HostConfig.PortBindings
  • docker volume inspect
  • docker network inspect
  • stat del secret file, sin leer contenido
  • psql en transaccion READ ONLY para catalogo
Control Observado
hostname srv977009
uptime up 18 days, 12:19
disco / 96G total, 28G usado, 68G disponible, 30%
memoria 7.8Gi total, 5.8Gi available
swap 4.0Gi total, 4.0Gi free
contenedor target openclaw-business-observer-postgres-staging
estado target running
health target healthy
imagen postgres:16.14-alpine
network openclaw-bo-staging-internal internal=true
volume openclaw_bo_postgres_staging_data
host port binding {}
secret file validado por stat como root:root 600, sin cat
sandbox guardrail openclaw-postgres-sandbox running healthy

5. Target fingerprint no sensible

text srv977009|openclaw-business-observer-postgres-staging|openclaw-bo-staging-internal|openclaw_bo_postgres_staging_data|no-host-port-binding|postgres|postgres|PostgreSQL 16.14

6. Backup baseline

Campo Valor
timestamp UTC 20260619T170037Z
ruta operacional /opt/backups/openclaw/business-observer-staging/postgres/baseline/20260619T170037Z/
filename openclaw-bo-staging-postgres-baseline-20260619T170037Z.dump
checksum file openclaw-bo-staging-postgres-baseline-20260619T170037Z.dump.sha256
formato pg_dump -Fc
database postgres
metodo docker exec -u postgres openclaw-business-observer-postgres-staging pg_dump -Fc -d postgres > backup_file
password inline NO
backup en Git NO; queda fuera del repo bajo /opt/backups/...
permisos directorio root:root 700
permisos backup root:root 600
permisos checksum root:root 600
tamano 1032 bytes
sha256 402dce45fe93936b12f17a54ee437d637b3c573d02a3ff5c506d83e48a3860c4
duracion aproximada 1s

7. Validacion pg_restore --list

Validacion ejecutada sin imprimir contenido del backup:

text pg_restore --list = PASS total_lines=15 metadata_lines=15 toc_entries=0

Interpretacion:

  • el archivo custom format es legible por pg_restore --list;
  • el catalog bootstrap postgres no contiene objetos de negocio;
  • no se copio ni versiono el dump.

8. Post-check sin DDL/DML

Validacion de catalogo ejecutada en transaccion READ ONLY despues del backup:

Control Resultado
transaction_read_only on
openclaw_business_observer_staging ABSENT
schema business_observer ABSENT
roles staging de negocio ABSENT
matches DB %business_observer% 0
matches roles openclaw_bo_staging% o %business_observer% 0

Confirmado:

  • no se ejecuto CREATE DATABASE
  • no se ejecuto CREATE ROLE
  • no se ejecuto CREATE SCHEMA
  • no se ejecuto CREATE TABLE
  • no se ejecuto ALTER
  • no se ejecuto GRANT
  • no se ejecuto REVOKE
  • no se ejecuto DROP
  • no se ejecuto INSERT
  • no se ejecuto UPDATE
  • no se ejecuto DELETE
  • no se ejecuto COPY
  • no se ejecuto TRUNCATE
  • no se ejecutaron scripts SOURCE-003
  • no se leyo el contenido del secret file

9. Health final

Control Resultado
backup file existe fuera de Git PASS
checksum existe fuera de Git PASS
backup legible por pg_restore --list PASS
staging Postgres health running healthy
staging host port binding {}
sandbox health running healthy
sandbox intacto PASS

10. GO / NO-GO

text GO = PDF-004E RESTORE DRILL NO-GO = PDF-004 DDL NEGOCIO NO-GO = CREAR DB/ROLES/SCHEMA/TABLAS HASTA COMPLETAR RESTORE DRILL Y AUTORIZACION EXPLICITA

11. Rollback / cleanup candidate

No ejecutado.

Candidate si se ordena limpiar este baseline:

bash rm -rf /opt/backups/openclaw/business-observer-staging/postgres/baseline/20260619T170037Z

Guardrail: no ejecutar cleanup mientras PDF-004E restore drill dependa de este artefacto.

12. Proximos safe points

  1. PDF-004E restore drill
  2. PDF-004F DDL execution candidate/preflight
  3. autorizacion explicita y separada para PDF-004 DDL de negocio

13. Conclusion

text PDF-004D PASS BACKUP BASELINE = CREATED OUTSIDE GIT SHA256 = 402dce45fe93936b12f17a54ee437d637b3c573d02a3ff5c506d83e48a3860c4 PG_RESTORE_LIST = PASS STAGING HEALTH = RUNNING HEALTHY HOST PORT BINDING = {} BUSINESS DB = ABSENT BUSINESS SCHEMA = ABSENT BUSINESS ROLES = ABSENT SANDBOX = INTACT NO DDL/DML EXECUTED NO SECRETS EXPOSED GO = PDF-004E RESTORE DRILL NO-GO = BUSINESS DDL