Login   Register  
PHP Classes
elePHPant
Icontem

Retrieving, executing and saving partial data from SQL dump

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author  
Picture of Alexander Selifonov
Name: Alexander Selifonov is available for providing paid consulting. Contact Alexander Selifonov .
Packages: 14 Browse all classes by Alexander Selifonov Browse all classes by
Country: Russian Federation Russian Federation - PHP jobs in Russian Federation
Age: 50
All time rank: 622 in Russian Federation Russian Federation
Week rank: 35 Up3 in Russian Federation Russian Federation Down
Innovation award
Innovation award
Nominee: 11x

Winner: 2x


  Detailed description   Download .zip .tar.gz  
This class can be used to extract table dumps from full MySQL database dumps.

It can parse a MySQL full database and extract the SQL CREATE and INSERT statements just for given tables.

The extracted SQL statements may be executed immediately or saved to a new database dump file.

Sometimes database administrators or programmers need to restore or copy only a few data tables from one server to another, but all they have is a full DUMP file created by standard utilities like 'dump' (for MySQL).
For production systems it can be really HUGE file, so the task seems to be not so simple.

CDataFromDump class aimed to resolve the problem: it parses source dump file and grabs only data for desired table list. These CREATE TABLES and INSERT operators can be instantly executed on connected database or saved into a new SQL file, for editing and/or executing later.

Currently the class has following features:
- During the first scan, it tries to creates "metadata" file for processed dump, so next retrieving jobs will be much faster.
- Grabs only SQL operators for the tables from passed list
CREATE TABLE operators can be executed/included into result SQL file or NOT, according to passed parameters.

  Classes of Alexander Selifonov  >  Retrieving, executing and saving partial data from SQL dump  >  Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Retrieving, executing and saving partial data from SQL dump
Base name: data-from-dump
Description: Extract table dumps from full MySQL database dumps
Version: 1.0
PHP version: 5.0
License: BSD License
All time users: 317 users
All time rank: 6039
Week users: 0 users
Week rank: 2040 Equal
 
  Groups   Screenshots Screenshots   Freshmeat project  
  Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Databases Database management, accessing and searching View top rated classes
Group folder image Systems administration System configuration and management View top rated classes

  Files folder image Screenshots  
Screenshot
File Role Description
Accessible without login Image file dfd-screenshot.png Screen Screenshot


  Innovation Award  
PHP Programming Innovation award nominee
September 2010
Number 7

Prize: One downloadable e-book of choice by O'Reilly
mysqldump is a tool for taking backups of MySQL databases. It is part of the distribution of MySQL. It works by generating SQL statements that can be used to recreate the database later.

There are several PHP components that do practically the same as the mysqldump command. However, to restore a backup taken with mysqldump usually you execute all the contained SQL statements, and so you have to recreate the whole database.

This class makes the process of restoring MySQL database backups more convenient. It allows recreating only list of database tables of your choice, instead of recreating all.

It even allows saving the relevant SQL statements into a separate file instead of executing them right away. This way you can recreate only the needed tables in multiple steps, eventually in different machines.

Manuel Lemos

  Freshmeat project  
Project record: datafromdump
Popularity score: 17.66
Vitality score: 31.7

  User ratings  
Not yet rated by the users

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file datafromdump.php Class Main class source
Accessible without login Plain text file grabsql.php Example Using example
Accessible without login HTML file datafromdump.en.htm Doc. Documentation (English)
Accessible without login HTML file datafromdump.ru.htm Doc. Documentation (Russian)

Download all files: data-from-dump.tar.gz data-from-dump.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.