Add README for steps to load data into test instance. fix error in code. add requirements.txt

This commit is contained in:
Cassowary Rusnov 2022-02-02 21:13:07 -08:00
parent b8c6cc2ddf
commit ac85a81bd1
4 changed files with 15 additions and 13 deletions

View File

@ -1,13 +1,9 @@
# Command line to dump
FinancialType
PaymentProcessor
ContributionPage
Contact
Relationship
Group and Field tables
OptionValue and OptionGroup
Resources urls and directories (sysetm settings)
# Command line to load above dump
- Needs working local CiviCRM from caat-crm-installer
- In confdump path, `virtualenv confdump.venv`
- Load the virtualenv `. confdump.venv/bin/activate`
- Install pre-dependencies for MySQL client https://pypi.org/project/mysqlclient/ on dpkg based linuce: `python3-dev default-libmysqlclient-dev build-essential`
- Install requirements `pip -i requirements.txt`
- Fill out example.env for the production, test or development server you'll retrieve the data from.
- Execute dump to retrieve base data: `env $(cat example.env) python ./confdump.py dump -o mydata INSTANCEPATH` where INSTANCEPATH is something like https://crm.dev.caat.org.uk/.
- Load data into running local instance with: `python confdump.py mysql -i mydata/ -p 63306`
- Clear the cache in CiviCRM from the caat-crm-installer directory with `make shell`, and then inside `cd /app; ./vendor/bin/drush cc all`

View File

@ -227,6 +227,7 @@ def main() -> int:
row['payment_processor'] = STANDIN_PAYMENT_PROCESSOR_ID
for row in indata:
query = dict_to_insert(table_name, row)
cursor.execute(query)
cursor.execute("SET FOREIGN_KEY_CHECKS=1;")
cursor.close()

2
example.env Normal file
View File

@ -0,0 +1,2 @@
CIVICRM_USERNAME=yourusername
CIVICRM_PASSWORD=yourpassword

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
-e git+https://git.autonomic.zone/cas/civicrmapi4#egg=civicrmapi4
phpserialize
mysqlclient~=1.4.6