Updated Updating (markdown)

kkthxbye 2023-07-28 22:01:37 +02:00
parent 6debf791e2
commit 04c17f84e8

@ -16,7 +16,7 @@ This is the folder where the `docker-compose.yml` file is.
Now, stop all the containers that are running:
```bash
docker-compose down
docker compose down
```
Then, to update to the latest release, fetch all updates to the project files from the release channel:
@ -31,14 +31,14 @@ _NOTE: If you instead want to update to a specific version, [see the respective
Now you need to tell Docker to fetch the latest NetBox Docker Container and also to fetch new version of the dependencies, such as a new Redis or PostgreSQL:
```bash
docker-compose pull
docker compose pull
```
Now it's time to start all the containers again.
This will also migrate the NetBox database schema automatically.
```bash
docker-compose up
docker compose up
```
Once NetBox has started, you should be ready to go.
@ -60,16 +60,16 @@ The easiest way to perform such an update is to backup the database on the old v
cd <path_to>/netbox-docker
# Stop all containers
docker-compose down
docker compose down
# Only start the DB
docker-compose up -d postgres
docker compose up -d postgres
# Take a DB backup
docker-compose exec -T postgres sh -c 'pg_dump -cU $POSTGRES_USER $POSTGRES_DB' | gzip > db_dump.sql.gz
docker compose exec -T postgres sh -c 'pg_dump -cU $POSTGRES_USER $POSTGRES_DB' | gzip > db_dump.sql.gz
# Stop the database
docker-compose down
docker compose down
# Remove the database volume
#
@ -80,12 +80,12 @@ docker volume rm netbox-docker_netbox-postgres-data
# Update NetBox Docker files and containers
git checkout release && git pull -p origin release
docker-compose pull
docker compose pull
# Restore the database
docker-compose up -d postgres
gunzip -c db_dump.sql.gz | docker-compose exec -T postgres sh -c 'psql -U $POSTGRES_USER $POSTGRES_DB'
docker compose up -d postgres
gunzip -c db_dump.sql.gz | docker compose exec -T postgres sh -c 'psql -U $POSTGRES_USER $POSTGRES_DB'
# Start all other containers
docker-compose up
docker compose up
```