|
| 1 | +# Migrating from bosh postgres jobs to cloudfoundry/postgres-release |
| 2 | + |
| 3 | +## Background |
| 4 | + |
| 5 | +The `postgres` and `postgres-13` jobs previously shipped inside the bosh release |
| 6 | +have been removed. PostgreSQL is now provided by the |
| 7 | +[cloudfoundry/postgres-release](https://github.com/cloudfoundry/postgres-release). |
| 8 | + |
| 9 | +This release ships PostgreSQL versions 15, 16, 17, and 18. |
| 10 | + |
| 11 | +## Switching from jobs/postgres (bosh release) |
| 12 | + |
| 13 | +In your director manifest, replace: |
| 14 | + |
| 15 | +```yaml |
| 16 | +releases: |
| 17 | +- name: bosh |
| 18 | + version: latest |
| 19 | + |
| 20 | +instance_groups: |
| 21 | +- name: bosh |
| 22 | + jobs: |
| 23 | + - name: postgres |
| 24 | + release: bosh |
| 25 | + properties: |
| 26 | + postgres: |
| 27 | + user: bosh |
| 28 | + password: secret |
| 29 | + database: bosh |
| 30 | + listen_address: 127.0.0.1 |
| 31 | + port: 5432 |
| 32 | + max_connections: 200 |
| 33 | +``` |
| 34 | +
|
| 35 | +With: |
| 36 | +
|
| 37 | +```yaml |
| 38 | +releases: |
| 39 | +- name: bosh |
| 40 | + version: latest |
| 41 | +- name: postgres |
| 42 | + url: https://bosh.io/d/github.com/cloudfoundry/postgres-release |
| 43 | + version: latest |
| 44 | + |
| 45 | +instance_groups: |
| 46 | +- name: bosh |
| 47 | + jobs: |
| 48 | + - name: postgres |
| 49 | + release: postgres |
| 50 | + properties: |
| 51 | + databases: |
| 52 | + version: 15 # match your existing on-disk data version |
| 53 | + port: 5432 |
| 54 | + max_connections: 500 |
| 55 | + databases: |
| 56 | + - name: bosh |
| 57 | + roles: |
| 58 | + - name: bosh |
| 59 | + password: secret |
| 60 | +``` |
| 61 | +
|
| 62 | +## Switching from jobs/postgres-13 |
| 63 | +
|
| 64 | +Same as above, but set `databases.version: 13`. |
| 65 | + |
| 66 | +## In-place cutover procedure |
| 67 | + |
| 68 | +1. Set `databases.version: 15` (or 13 if still on postgres-13). |
| 69 | + postgres-release detects the existing `/var/vcap/store/postgres-<version>` |
| 70 | + data directory and starts without reinitializing. |
| 71 | +2. Deploy. BOSH will restart the postgres process using postgres-release. |
| 72 | +3. To upgrade to a newer PostgreSQL major version, change `databases.version` |
| 73 | + to 16, 17, or 18 and redeploy. postgres-release handles `pg_upgrade`. |
| 74 | + |
| 75 | +## Property mapping |
| 76 | + |
| 77 | +| Old (`bosh` release) | New (`postgres-release`) | |
| 78 | +|---------------------------------|----------------------------------------------| |
| 79 | +| `postgres.user` | `databases.roles[0].name` | |
| 80 | +| `postgres.password` | `databases.roles[0].password` | |
| 81 | +| `postgres.database` | `databases.databases[0].name` | |
| 82 | +| `postgres.additional_databases` | additional `databases.databases` entries | |
| 83 | +| `postgres.listen_address` | `databases.address` (default `127.0.0.1`) | |
| 84 | +| `postgres.port` | `databases.port` (default `5432`) | |
| 85 | +| `postgres.max_connections` | `databases.max_connections` (default `500`) | |
0 commit comments