User:Kelson/Memo

From Wikimedia UK
Jump to navigation Jump to search

MySQL

# Get table list with prefix
mysql -N information_schema -ufoouser -pfoopass -e "SELECT table_name FROM tables where table_schema='foodb' AND table_name like 'prefix_%'" > tables.txt

# Dump only a subselection of table in a DB
mysqldump -ufoouser -pfoopass dbname `cat tables.txt` | xz > dbname.sql.xz

# Dump DB without triggers
mysqldump --skip-triggers -ufoouser -pfoopass foobar | xz > foobar.notriggers.sql.xz

# Dump only trigger
mysqldump --no-create-info --no-create-db --skip-opt --no-data -ufoouser -pfoopass foobar | xz > foobar.triggers.sql.xz

# Rewrite trigger SQL dump
cat db.triggers.sql.xz | xz -d -c | sed -e 's/`user`@/`newuser`@/g' | sed -e 's/`dbname`\./`newdbname`./g' | xz > newdb.triggers.sql.xz

# Drop specific tables
for TABLE in `cat foobar.tables` ; do echo "SET foreign_key_checks = 0;  DROP TABLE $TABLE" | mysql -ufoouser -pfoopas foobar ; echo $TABLE ; done

CiviCRM

Cleanup Caches and Update Paths
/civicrm/admin/setting/updateConfigBackend?reset=1
Configure Paths
/civicrm/admin/setting/path?reset=1
Upgrade
/civicrm/upgrade?reset=1