# # Helper Makefile cmdphp = bin/* PHP ?= `which php` PEAR = ./bin/pear DBUSER=gerd DBPASSWD=gerd123 DBNAME=schaufelberger PROJECT=schaufelberger2019 SERVER=exit0.net SERVER_PARENT=www dump: @echo -n "Dump table structure" @mysqldump -u $(DBUSER) --no-data $(DBNAME) --password=$(DBPASSWORD) \ | LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ | head -n -1 >doc/table.sql @echo -n " primary data" @mysqldump -u $(DBUSER) --password=$(DBPASSWORD) --ignore-table=$(DBNAME).wbgenericview --ignore-table=$(DBNAME).wbpageview --ignore-table=$(DBNAME).wbsessionview --ignore-table=$(DBNAME).wbvfsfileview $(DBNAME) \ | LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ | head -n -1 >doc/dump.sql @echo " done" @echo -n "Tar VFS ..." @tar zcf vfs.tar.gz var/vfs @echo " done" dumpstat: @echo -n "Dump statistic data ..." @mysqldump -e $(DBNAME) wbtagview wbgenericview wbpageview wbsessionview wbvfsfileview \ | LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ | head -n -1 >doc/dumpstat.sql @echo " done" deploy: @echo "********************************************************************************" git pull make flushcache @echo "********************************************************************************" install: dirs perms installdb: echo SHOW GRANTS FOR `$(DBUSER)`@`localhost`; echo GRANT USAGE ON *.* TO '$(DBUSER)'@'localhost' IDENTIFIED BY PASSWORD password("$(DBPASSWD)"); echo CREATE DATABASE `$(DBNAME)` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; echo GRANT ALL PRIVILEGES ON `$(DBNAME)`.* TO `gerd`@`localhost`; echo FLUSH PRIVILEGES; echo USE `$(DBNAME)`; mysql $(DBNAME) <../wombat3/doc/table/base.sql mysql $(DBNAME) <../wombat3/doc/table/blog.sql mysql $(DBNAME) <../wombat3/doc/table/cms.sql mysql $(DBNAME) <../wombat3/doc/table/vfs.sql mysql $(DBNAME) <../wombat3/doc/table/statistic.sql # mysql $(DBNAME) <../valueAce/doc/table.sql # mysqldump -w 'domain NOT IN ("wombat", "patForms")' otherdb wbnlsmsg | mysql $(DBNAME) mysql $(DBNAME)