...
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:
Code Block echo -e 'truncate table django_prbac_role cascade;\ntruncate table django_content_type cascade;\n' | SKIP_PRBAC_CHECKS=1 canopy-manage dbshell
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:
Code Block |
---|
Run: SKIP_PRBAC_CHECKS=1 canopy-manage shell_plus
Paste:
from django.apps import apps
for model in apps.get_models(): model.objects.all().delete()
ctrl-d to exit the shell |