Database backup -> close/open forum

hcmagix

Active member
For vBulletin I has write a full automatically backup script. Same I would write for xF.

In the old script I close the Forum with this line
mysql -u${DBUSER} -p${DBPASS} -hlocalhost -e "UPDATE ${DBNAME}.datastore SET data = REPLACE(data,'bbactive\";i:1','bbactive\";i:0') WHERE title = 'options'"
after the backup done I open the vBulletin with this line
mysql -u${DBUSER} -p${DBPASS} -hlocalhost -e "UPDATE ${DBNAME}.${PRAEFIX}datastore SET data = REPLACE(data,'bbactive\";i:0','bbactive\";i:1') WHERE title = 'options'"

is it possible to do the same with xF ?
Can somebody tell me the code to close/open the xF Forum via mysql?

If yes the backups script coming soon.
 
When you change an option,... apart from updating the entry in xf_option table, a whole bunch of other caches are rebuilt: the option cache, last modified date for all styles, style cache, and last modified date for admin templates.

The option cache (data_key = 'options') in xf_data_registry is important, since xenforo looks there first. I'm not sure about the other settings and caches... you might skip updating those altogether, without breaking your forum.
 
All the tables are InnoDB so if you start a transaction you get it at that point and there is no half done stuff in the tables.

You shouldn't need to close the forum as long as you use

--single-transaction in mysqldump
 
Top Bottom