I have using Kiwi TCMS System in development, so I have created more test data. Now I want to delete all the test data, so I tried to reset the Kiwi DB tables using the following command as suggested in the article, https://kiwitcms.org/blog/atodorov/2018/07/30/how-to-backup-docker-volumes-for-kiwi-tcms/
First taken the backup,
docker exec -it kiwi_web /Kiwi/manage.py dumpdata --all --indent 2 > database.json
Then deleted all table records,
docker exec -it kiwi_web /bin/bash -c '/Kiwi/manage.py sqlflush | /Kiwi/manage.py dbshell'
I know this command has deleted everything including initial setup data completely from DB, so I have tried to apply the initial setup using the following commands,
docker exec -it kiwi_web /Kiwi/manage.py migrate
docker exec -it kiwi_web /Kiwi/manage.py createsuperuser
docker exec -it kiwi_web /Kiwi/manage.py refresh_permissions
The First 2 worked fine, but the last refresh_permissions was throwing an error, Refer to the error screenshot
This leads, some of the permission-related settings like groups are not restored.
Seems I'm doing some wrong way to delete all data and restore with the required initial setup. pLease correct me what would be the best way here.