Backup module cannot backup the database

palazis - June 28, 2007 - 21:56
Project:backup
Version:5.x-3.0
Component:Code
Category:bug report
Priority:normal
Assigned:dmuth
Status:active
Description

I have tried the Backup module several times but...
Each and every time the drupal files are backed up perfectly, but the database backup file has nothing in it (size 0).
I receive no error messages.
Always "Database backed up successfully".
and "Files backed up successfully".
Any ideas?
Thanks in advance.

#1

dmuth - June 28, 2007 - 21:59
Assigned to:Anonymous» dmuth

I can't think of anything off the top of my head, but I would like to suggest grabbing the newest copy (5.x-4.0) and see if the problem persists.

-- Doug

#2

palazis - June 30, 2007 - 08:48

Thank you.
I can see that the the newest copy 5.x-4.0 is not ready yet (still dev version) but I will try it and let you know.
I haven't mentioned that I use sub-domains (e.g. site1.example.com, site2.example.com, etc). Each sub-domain uses its own database which for example is configured under sites/site1.example.com in settings.php file (NOT under sites/default).

#3

palazis - June 30, 2007 - 13:00

Unfortunately the use of 5.x-4.0 (dev version) creates more side-effects - I had to switch back to 5.x-3.0 again.
With dev version I received an error message and only "Database backed up successfully". The drupal files are NOT backed up anymore, but the backup file consists of the database only (again with size 0).
If this helps, I have installed drupal in a sub-directory (named drupal) and not in root.

#4

palazis - July 5, 2007 - 09:44

The error message that i receive after using dev version is:
backup_files(): Command 'tar cfz /tmp/backup-htdocs-Ae1uMH update.php CHANGELOG.txt includes INSTALL.txt cron.php misc cgi-bin xmlrpc.php UPGRADE.txt robots.txt INSTALL.pgsql.txt MAINTAINERS.txt session_mm_cgi33013.sem themes install.php index.php scripts .htaccess INSTALL.mysql.txt modules profiles php.ini LICENSE.txt sites drupal-backup-db-20070705044214-531498826.sql.gz ' returned value: 2

#5

starbork - March 29, 2008 - 17:00

I'm also having this issue, where the files are backed up fine but the DB is size 0. I'm using 5.x-40.

#6

jshuster@drupal.org - April 6, 2008 - 06:38

Here's one possible cause: note that in your settings.php file, if your database name or password contain certain special characters, such as "@" or "+", you're instructed to encode these as a "%" followed by two digits. (The special characters you need to encode are listed in the comments immediately above where you define your database.)

If these characters aren't decoded before being passed to the mysqldump command, mysqldump can't connect to the database. This happens in functions.inc at line 54, in the backup_database function.

The fix is to run the database URL through the php rawurldecode function before passing its pieces to mysqldump. An easy place to do this is at the top of the backup_database function, near line 25, changing:

$db_data = parse_url($GLOBALS["db_url"]);

to

$db_data = parse_url(rawurldecode($GLOBALS["db_url"]));

(My line references are based on Backup 5.x-3.0.)

#7

palazis - April 10, 2008 - 05:05

Thank you very much.
I will try that as soon as I find the time.
It's been a long time since I had this issue though...
So I am now using another module for database backups (dba module).
I have read somewhere that drupal 6 would include a backup module in core.
But this didn't happen.
Anyway.. Thanks for the info.

 
 

Drupal is a registered trademark of Dries Buytaert.