From 127e4eb38f087e1749f6082ca9efa54d70071bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=A4der?= Date: Sun, 15 Mar 2020 16:13:58 +0100 Subject: [PATCH] Updated Troubleshooting (markdown) --- Troubleshooting.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Troubleshooting.md b/Troubleshooting.md index 54ccaca..19d3369 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -44,7 +44,7 @@ Enter the Netbox shell, e.g. to get access to `./manage.py`: docker-compose exec netbox /bin/bash ``` -### Database operations +### Database Operations Access the database: @@ -64,6 +64,22 @@ Restore that database: gunzip -c db_dump.sql.gz | docker exec -i $(docker-compose ps -q postgres) sh -c 'psql -U $POSTGRES_USER $POSTGRES_DB' ``` +### File Operations + +Backup of the _media_ directory, which contains uploaded images. + +```bash +docker-compose exec netbox tar c -jf - -C /opt/netbox/netbox/media ./ > media-backup.tar.bz2 +``` + +Restore of the _media_ directory: + +> ⚠️ This may overwrite files in the media directory! + +```bash +docker-compose exec -T netbox tar x -jvf - -C /opt/netbox/netbox/media < media-backup.tar.bz2 +``` + ### Nginx doesn't start As a first step, stop your docker-compose setup.