...
Stop Canopy:
Code Block systemctl stop canopy canopy-celery
If database structure is outdated or non-existent then configure a production DB:
Code Block canopy-manage setupdb --prod --drop-tables
Delete data in DB:
Code Block canopy-manage flush
Remove remaining remnants that are autogenerated:
Note this may delete files in /var/opt/checksec/canopy/ if their respective objects are still in the DB
Code Block echo -e 'truncatefrom table django_prbac_role cascade;\ntruncate table django_content_type cascade;\ndjango.apps import apps\nfor model in apps.get_models(): model.objects.all().delete()' | SKIP_PRBAC_CHECKS=1 canopy-manage dbshellshell
Load db.json:
Code Block SKIP_PRBAC_CHECKS=1 canopy-manage loaddata db.json
Extract Canopy files:
Code Block tar -xvf canopy_files.tgz -C /
Set ownership of files:
Code Block chown -R canopy: /var/opt/checksec/canopy
Start Canopy:
Code Block systemctl start canopy canopy-celery
If any issues are encounter with steps 3 or 4 then replace them with the following:
...