Topics

User Functions

Events

There are no upcoming events

What's New

Stories last 2 weeks

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Thursday, April 24 2014 @ 06:39 AM EDT

How does Geeklog backup the database?

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).

FAQ Manager » Usage » How does Geeklog backup the database?