Manually backup a wiki

From Organic Design wiki
Revision as of 16:52, 29 February 2012 by Nad (talk | contribs) (See also: Backup)
Procedure.svg Manually backup a wiki
Organic Design procedure

There is a backup script you can run called /var/www/backup.pl which currently backs up and compresses all the mysql databases for all wikis into one compressed file and names them all-yyyy-mm-dd.sql.7z. This will soon be updated to allow a parameter to specify a specific database and optional table prefix, and also an optional filename if the default file name is not appropriate.

Each database may contain more than one wiki, these will be uniquely identified using table prefixes.

First principles using mysqldump

Backup and compress DB & FS
7za a -si backupfile.sql.7z # Backup

tar cf - directory


{{{1}}}

Character encoding issues

There can be some problems with MySQL dumps concerning character encodings. Most of these problems are covered here. It seems that to ensure you have a proper UTF-8 encoded text file you must set the character set to latin1. When importing this dump you may need to manually change the /*!40101 SET NAMES latin1 */ to /*!40101 SET NAMES utf8 */.

These problems don't always seem to occur - I have usually had no trouble with non latin1 exports being reimported again with special characters working fine even though looking at the dump in a text editor shows mangled characters. But sometimes - perhaps depending on the versions of the MySQL servers being imported and exported between - these special steps need to be taken.

See also