FREE Script for taking OXID Database Dumps
To prepare for that day of  disaster when your server crashes and your web-shop gets erased from the face of the Internet, we are happy to be giving away a free script for taking database dumps in an automated fashion (using cron) of your OXID e-Shop databases.
The script is written in Python, and has been tested to run on any LINUX machine supporting the language.
The code can be downloaded from code.google.com.
USAGE
shell$: eb_takedbdump.py -e <env> -s <shoproot>
Where
<env> = Any environment label to signify the environment where the shop is running. Â Typically you’d set prod, dev, staging, vm and such values. Â This value is then appended to the filename of the dump that is produced.
<shoproot> = the root folder where the core/ shop files reside (along with config.inc.php, .htaccess etc)
Working
Once the script runs successfully, you can expect 2 things:
- A database dump file with the name dbname_env.sql (See Usage above for <env>). Â dbname is the shop’s database name from config.inc.php
- A log file called eb_takedbdump.log in <shoproot>/log/
You will have to make sure to set the permissions on database/ and log/ directories appropriately in case the script is being as a different user than the one owning the shop-directories.
REQUEST to Users
If you use the script, we would be thankful if you can mention (by email or comment below) in which server-environment and hoster you are successfully (or unsuccessfully) running this script.
We’ve got it to run on below environments until now:
- Linux server000-han 2.6.99.8intel #1 SMP Sun Oct 30 22:38:04 CET 2011 x86_64 GNU/Linux (Profihost hosting account)
- Linux xxx 2.6.26-2-amd64 #1 SMP Mon Jun 13 16:29:33 UTC 2011 x86_64 GNU/Linux (dedicated Debian 5.0.9 Server)
- OXID Virtual Machine 2.0
Next Steps
As todos for the next version we are collecting the following list:
- Support mentioning log-level as a CLI input parameter
- Support a CLI parameter for rsync-ing the dump-file with an rsync-server
- zip or gz the dump so that it’s more transportable (ex. to a back-up server by rsync et al)

euroblaze is a German e-Commerce company that specializes in delivering end-to-end
Web-Solutions for online merchants. We are experts and a Certified Solution Partner for the
cutting-edge, robust, modular and beautiful OXID e-Sales platform.
English

One of the identified problems is around line-28, where logging.debug(DUMP_COMMAND) is outputing the SQL-dump. This will expose the database password in the SHOPROOT/log folder, which could potentially be read by any UNIX user on the system.
To avoid such risks, comment this logging.debug() line out (and delete/ambiguate the log-entries).
In future we will mask the password value.