Login   Register  
PHP Classes
elePHPant
Icontem

Large Database Backup: Backup large MySQL databases into multiple files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-05-18 (7 months ago) RSS 2.0 feedStarStarStarStar 65%Total: 3,782 This week: 4All time: 789 This week: 384Up
Version License PHP version Categories  
backupmysql 1.0GNU General Public Lice...4.0Databases, Systems administration
Description Author  

This class can be used to backup large MySQL databases into multiple files.

It can list the tables of a given MySQL database and generate SQL statements to create and insert records with the current values of the table rows, as if it was creating a new database. The class stores the generated SQL statements in files.

A full backup process can be split in multiple iterations to not exceed PHP default script execution time limit. Each iteration dumps a limited number of table rows. An iteration can be executed by a script that redirects the page request to itself at the end to proceed to the next iteration.

Innovation Award  
PHP Programming Innovation award nominee
July 2007
Number 2


Prize: One downloadable copy of PhpED Professional
There are many pure PHP solutions for taking backup copies of MySQL databases.

Most solutions are suitable to run on restricted PHP hosting environments. However, if you have a large database it may take more time to create a backup copy than the default 30 second PHP script execution time limit. The backup process may not finish before the script is aborted.

This class provides a clever solution that avoids that problem. It splits the backup process into multiple steps, each extracting a limited number of table rows. This way, each step may take less time than the PHP execution time limit.

Manuel Lemos
Picture of Nadir Latif
Name: Nadir Latif is available for providing paid consulting. Contact Nadir Latif .
Classes: 12 packages by
Country: Pakistan Pakistan
Age: 31
All time rank: 921 in Pakistan Pakistan
Week rank: 103 Down3 in Pakistan Pakistan Down
Innovation award
Innovation award
Nominee: 7x

  Files folder image Files  
File Role Description
Accessible without login Plain text file connection_details.csv Data Contains configuration details
Accessible without login Plain text file db_backup.php Example sample file
Plain text file mysql_backup.php Class Contains all functions
Accessible without login Plain text file readme.txt Doc. Help file
Accessible without login Plain text file backup_details.csv Data Data file

 Version Control Unique User Downloads Download Rankings  
 0%Total:3,782All time:789
 This week:4This week:384Up
User Ratings User Comments (3)  
 All time
Utility:85%StarStarStarStarStar
Consistency:82%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:71%StarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:460
 
A very useful class.
5 years ago (Xav)
72%StarStarStarStar
Thanks for your script.
6 years ago (gao hong ying)
77%StarStarStarStar
Instructions are limited, and the backup repeatedly times out
6 years ago (Kent Parker)
7%Star