BIJ1 CiviCRM
Requirements
Usage
download
version=5.53.0
plugins=./wordpress/wp-content/plugins/
mkdir -p $plugins
wget -O $plugins/civi.zip https://download.civicrm.org/civicrm-$version-wordpress.zip
wget -O $plugins/civi-l10n.tar.gz https://download.civicrm.org/civicrm-$version-l10n.tar.gz
unzip ./$plugins/civi.zip -d $plugins
tar -xf ./$plugins/civi-l10n.tar.gz -C $plugins/civicrm
run
make start
sleep 2 # give the containers time to spin up
make install
# http://localhost/wp-admin/admin.php?page=CiviCRM
# civi
# password123
deploy
docker swarm init
docker stack deploy -c ./deploy/staging/stack.yml civi
docker stack ps civi
docker stack rm civi
back up db
DB=exampledb
USER=exampleuser
PW=examplepass
DBHOST=127.0.0.1
mkdir -p sql
# we'll back up civicrm tables containing settings, not tables containing user data, credentials or ephemeral stuff
# make sure to use bash as zsh bugs out on this list variable assignment
# handling skipped tables here rather than in .gitignore so that sensitive data wouldn't even get downloaded
tables=`mysqlshow -h $DBHOST -u $USER --password="$PW" $DB | tail -n +5 | grep --only-matching --extended-regexp 'civicrm_[_a-z]+' | grep -v '_cache' | grep -v 'log_civicrm_' | grep -v '_log' | grep -v '_contact\>' | grep -v '_address\>' | grep -v '_cxn' | grep -v '_mailing_event' | grep -v '_pledge' | grep -v '_trxn' | grep -v '_contribution\>' | grep -v '_contribution_recur' | grep -v '_contribution_soft' | grep -v '_discount' | grep -v '_domain' | grep -v '_email' | grep -v '_entity_batch' | grep -v '_email' | grep -v '_entity_batch' | grep -v '_entity_file' | grep -v '_entity_financial_account' | grep -v '_entity_financial_trxn' | grep -v '_entity_tag' | grep -v '_financial_account' | grep -v '_financial_item' | grep -v '_grant' | grep -v '_group_organization' | grep -v '_im' | grep -v '_line_item' | grep -v '_loc_block' | grep -v '_mail_settings' | grep -v '_mailing_job' | grep -v '_mailing_recipients' | grep -v '_mailing_spool' | grep -v '_membership\>' | grep -v '_membership_payment' | grep -v '_note' | grep -v '_openid' | grep -v '_participant\>' | grep -v '_participant_payment' | grep -v '_payment_processor\>' | grep -v '_payment_token' | grep -v '_pcp' | grep -v '_phone' | grep -v '_relationship\>' | grep -v '_saved_search' | grep -v '_sms_provider' | grep -v '_subscription_history' | grep -v '_uf_match'`
for tbl in $tables; do mysqldump --column-statistics=0 -h $DBHOST -u $USER --password="$PW" $DB $tbl 2>/dev/null | head -n -2 > ./sql/$tbl.sql; done
restoring a db backup
for file in `ls -d sql/*`; do mysql -h $DBHOST -u $USER --password="$PW" $DB < $file; done