Skip to content

Commit 1c57ee1

Browse files
Update codefresh-on-prem-upgrade.md (#574)
1 parent 945733d commit 1c57ee1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

_docs/installation/codefresh-on-prem-upgrade.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ cd psqlbackup
496496
docker run --rm --name postgresql-backup -e PGPASSWORD=$PGPASSWORD -v $(pwd):/app --net="host" bitnami/postgresql:13 pg_dump -Fc --dbname audit -h host.docker.internal -p 5432 -f /app/audit.dump
497497
```
498498

499+
> The above command is true for Windows and macOS, for Linux users `host.docker.internal` has to be replaced with `127.0.0.1`
500+
499501
Here:
500502
* The *--net* parameter lets the Docker container use the host's network stack and thereby gain access to the forwarded port.
501503
* The *pg_dump* command connects to the PostgreSQL service and creates backup files in the */app* directory, which is mapped to the current directory (*psqlbackup/*) on the Docker host with the *-v* parameter.
@@ -519,6 +521,8 @@ cd psqlbackup
519521
docker run --rm --name postgresql-backup -e PGPASSWORD=$PGPASSWORD -v $(pwd):/app --net="host" bitnami/postgresql:13 pg_restore --Fc --create --dbname postgres -h host.docker.internal -p 5432 /app/audit.dump
520522
```
521523

524+
> The above command is true for Windows and macOS, for Linux users `host.docker.internal` has to be replaced with `127.0.0.1`
525+
522526
#### Backup and restore via Helm hooks
523527

524528
You can also run Postgresql database migration with `pre-upgrade` and `post-upgrade` helm hooks.
@@ -578,6 +582,8 @@ cd mongobackup
578582
docker run --rm --name mongodb-backup -v $(pwd):/app --net="host" bitnami/mongodb:4.2 mongodump --host="host.docker.internal:27017" -u root -p $MONGODB_ROOT_PASSWORD -o /app
579583
```
580584

585+
> The above command is true for Windows and macOS, for Linux users `host.docker.internal` has to be replaced with `127.0.0.1`
586+
581587
Here:
582588
* The *--net* parameter lets the Docker container use the host's network stack and thereby gain access to the forwarded port.
583589
* The *mongodump* command connects to the MongoDB service and creates backup files in the */app* directory, which is mapped to the current directory (*mongobackup/*) on the Docker host with the *-v* parameter.
@@ -600,6 +606,9 @@ kubectl port-forward --namespace codefresh svc/cf-mongodb 27017:27017 &
600606
cd mondgobackup
601607
docker run --rm --name mongodb-backup -v $(pwd):/app --net="host" bitnami/mongodb:4.2 mongorestore --host="host.docker.internal:27017" -u root -p $MONGODB_ROOT_PASSWORD /app
602608
```
609+
610+
> The above command is true for Windows and macOS, for Linux users `host.docker.internal` has to be replaced with `127.0.0.1`
611+
603612
1. Stop the service port forwarding by terminating the background process.
604613
1. Connect to the new stateful set and confirm that your data has been successfully restored:
605614
```shell

0 commit comments

Comments
 (0)