I have a Django website with 3 environments (Local, Staging, Production).
Production contains some data that I don't want my developers to have access to (Personal data and financial data of users).
Doing a DB backup restore is not an option for compliance reason.
However we also have some content pages on this website that we manage with Wagtail CMS.
I am looking for a way to sync production data (only some models but specifically the wagtail pages) back to Staging and Developers local environment when they need to.
Ideally I would have a manage command that I can run in another environment to copy data:
Example: ./manage.py sync_from_prod BlogPost this would find all missing blog post in the local or staging environment and would create them in the database. I cannot find any library doing this for Wagtail or Django doing this.
This seems like a common problem and I am surprised to find no Stackoverflow questions or opensource libraries fixing this problem.
If nothing exist I will probably try to write my own django-model-sync (Found this project, but is 3 year old and compatible until django 1.7 and I am on python3 django 1.11)
In order to manage security, a secret could be used by a dev to access a production API exposing the data (over ssl) for example