Open carmenriddel opened 1 year ago
Previous JIRA ticket: https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-1651
EDIT: for public documents, export S3_WELL_BUCKET=gwells-docs
EDIT: S3_PUBLIC_ACCESS_KEY and S3_PUBLIC_SECRET_KEY are mixed up for Private/Public (Minio associated with Private).
Can be closed.
If a list of private/public attachments is needed in the future, we can request then. It will be useful to make the attachments searchable in GWELLS --we can leave this for future enhancement.
There is a file called manage.py located in gwells/app/backend You will need to have your env setup before you can run. I found it easiest to install Django version 3 (3.2.15) instead of 4.
First set the following env vars depending on whether you want private or public documents
Then run the manage.py file:
python manage.py export_wtn_documents_csv --cleanup=1 --upload=1
This will upload a csv list of either public or private GWELLS attachments to the associated bucket
Note: Don't set these variables on staging on prod, and be careful setting them on a dev environment. Make sure it clear them once you're done to remove the link.