Backup plugin fails with large SQL table

Found a bug? Tell us!!
Post Reply
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Backup plugin fails with large SQL table

Post by gwilsonmail »

I've been using the backup plugin and all has been well for some time.

I updated to the latest s9y 1.2-beta2 via svn and checked to see if the backups were occurring locally. According to the logs the html backup is working regularly but the sql table backup is not.

When i use the "Start Backup ..." button (to backup the sql tables) from the s9y admin home page -> backup interface ->

I get
Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/.domani/xxxxx/pixelgadgets.com/blog/include/db/mysql.inc.php on line 84

Fatal error: Cannot use string offset as an array in /home/.domani/xxxxx/pixelgadgets.com/blog/plugins/serendipity_event_backup/serendipity_event_backup.php on line 400
Also the backup is set for every 6 hrs, but i only get one backup file per day.
Last edited by gwilsonmail on Wed Jun 27, 2007 7:54 pm, edited 1 time in total.
gw
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Backup plugin fails

Post by garvinhicking »

Hi!

That SQL error message seems to say that the result set is too large to be transfered to PHP. Seems your database size has exceeded the magic boundary and can no longer be fetched within the PHP mechanism of the backup plugin... :-/

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Post by gwilsonmail »

Thanks gavin. suspect that limit is around 12 MB on my server.

Any option to save the database in sections?
gw
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

That would mean a rework of the backup plugin, but it currently has no maintainer (also because it's butt-ugly).

I really recommend using crontab-scheduled mysqldump commands, or using phpmYAdmin to export dumps. :-/

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Post by gwilsonmail »

what would teh command syntax look like for a cron job?

i can set these up easily using my hosting control panel.

thanks,
gw
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

simply

Code: Select all

mysqldump --add-drop-table --add-drop-database --add-locks --complete-insert --create-options --host=[your host] --password=[your password] --user=[your username] [your serendipity database name] > your_dumpfile.sql
You need to enter your DB details there, and you might need to enter the complete path to mysqldump. And you will need to indicate your cronjob how often it should run. I don't know your control panel, but in an /etc/crontab file it would look like:

Code: Select all

30 2 * * * root /usr/local/mysql/bin/mysqldump > mydumpfile.sql

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply