This is a basic PHP script which invokes mysqldump
to dump a MySQL database.
Error handling is rudimentary. The script assumes that the configured databases
are indeed MySQL databases and mysqldump
is available.
Please note: This is mostly used internally, but I am happy if anyone finds this useful or provides improvements.
- Detects most database configurations for the following applications:
- Joomla! (
configuration.php
) - JTL Shop (
includes/config.JTL-Shop.ini.php
) - Magento 1.x (
app/etc/local.xml
) - TYPO3 CMS (
typo3conf/LocalConfiguration.php
, but notAdditionalConfiguration.php
) - WordPress (
wp-config.php
)
- Joomla! (
- Connection options can be overriden by GET or POST parameters
- Returned files are gzipped and named after the database
- Secured by basic HTTP auth (configure at head of script!)
- Adjust user and password at top of
mydumper.php
. - Upload to application root directory.
- Open
https://example.com/mydumper.php
in browser, withcurl
orwget
(provide user name/password!). - Store dump.
Optionally append some or all GET parameters (POST works, too) to provide or override configuration, e.g.
https://example.com/mydumper.php?debug=1&user=John&password=J0hn&db=db123&host=localhost&port=3307&mysqldumper=/usr/sbin/mysqldumper
Debug information — if enabled — is stored in mydumper.err.txt
and contains confidential database connection information and mysqldump
's error output.
Automatic detection of applications can be turned off by passing no_detect=1
.
Thomas Luzat - luzat.com
This project is licensed under the ISC License.