restore dump not works from other running netbox into docker instance #862
Replies: 3 comments 3 replies
-
OK, I fixed 1st issue with making replication on standard new netbox app without docker, However when I run the Upgrade Script, I got another error and env was not created. :/opt/netbox/netbox$ sudo PYTHON=/usr/bin/python3.8 /opt/netbox/upgrade.sh Applying database migrations (python3 netbox/manage.py migrate)... The above exception was the direct cause of the following exception: Traceback (most recent call last): Any idea what is wrong ? |
Beta Was this translation helpful? Give feedback.
-
FYI: I am migrating netbox from v2.8.6 to uptodate 3.3.5 |
Beta Was this translation helpful? Give feedback.
-
ok, I fixed this with pip install markupsafe==2.0.1 and migrate script finished, also app is running now (venv) root@:/opt/netbox/netbox# python3 manage.py migrate so Final step is to upgrade to to uptodate version |
Beta Was this translation helpful? Give feedback.
-
Hi
I was trying to replicate already running netbox app to my docker Lab env.
I use Docker Desktop for Windows.
I successfully run new netbox container app in docker via https://github.com/netbox-community/netbox-docker/wiki/Getting-Started
Then I was trying to restore data according this below steps, but I got some errors, and data was not restored.
https://github.com/netbox-community/netbox-docker/wiki/Troubleshooting
Restore that database:
Stop all NetBox instances that access the db
docker compose stop netbox netbox-worker netbox-housekeeping
Restore the DB dump
gunzip -c db_dump.sql.gz | docker-compose exec -T postgres sh -c 'psql -U $POSTGRES_USER $POSTGRES_DB'
Here are my errors:
SET
ERROR: relation "auth_group" already exists
ALTER TABLE
ERROR: relation "auth_group_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "auth_group_permissions" already exists
ALTER TABLE
ERROR: relation "auth_group_permissions_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "auth_permission" already exists
ALTER TABLE
ERROR: relation "auth_permission_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "auth_user" already exists
ALTER TABLE
ERROR: relation "auth_user_groups" already exists
...
COPY 640
ERROR: duplicate key value violates unique constraint "auth_permission_pkey"
DETAIL: Key (id)=(1) already exists.
CONTEXT: COPY auth_permission, line 1
ERROR: duplicate key value violates unique constraint "auth_user_pkey"
DETAIL: Key (id)=(1) already exists.
CONTEXT: COPY auth_user, line 4
ERROR: insert or update on table "auth_user_groups" violates foreign key constraint "auth_user_groups_user_id_6a12ed8b_fk_auth_user_id"
DETAIL: Key (user_id)=(10) is not present in table "auth_user".
COPY 0
COPY 0
ERROR: column "connected_endpoint_id" of relation "circuits_circuittermination" does not exist
invalid command .
COPY 0
COPY 0
ERROR: column "termination_a_id" of relation "dcim_cable" does not exist
invalid command .
ERROR: syntax error at or near "1"
LINE 1: 1 2020-07-01 2020-07-01 07:15:40.693781-05 277 229 mmf-om1 c...
invalid command \N
invalid command \N
invalid command \N
Beta Was this translation helpful? Give feedback.
All reactions