Welcome to Geeklog, Anonymous Saturday, April 20 2024 @ 06:18 am EDT

Question: How does Geeklog backup the database?

Answer: When clicking on the database backup link from the Admin menu, the following command is issued.

/usr/bin/mysqldump -hlocalhost -udbuser -pdbpassword -Q

localhost, dbuser, dbpassword and -Q are derived from your config.php

$_DB_host = 'localhost';
$_DB_user = 'dbuser';
$_DB_pass = 'dbpasssword';
$_CONF['mysqldump_options'] = '-Q';

So in your instance you would change those arguments to what your config.php says. The host is probably still localhost, but your dbuser and dbpassword will be different.

Also the command /usr/bin/mysqldump is derived from config.php. $_DB_mysqldump_path = '/usr/bin/mysqldump';

If you have phpMyAdmin with your server you can do a manual backup.

For an automatic solution using a cronjob, see this story: Backing Up Geeklog. This is also what we're using to backup the geeklog.net database.


Troubleshooting

mysqldump is an external application and on some setups, it's not possible to execute external applications from PHP scripts, e.g. when safe_mode=on, when open basedir restrictions are in effect and the path where mysqldump is located is not one of the allowed paths, or when your hosting service has disabled the PHP exec command.

All of the above are server-side settings, so try asking your hosting service for help (or change them yourself if it's your own server).

Hits: 182

FAQ » Usage » How does Geeklog backup the database?