yii-dump-db Another extension that allows to create backups of mysql database (structure and data)

  1. Requirements
  2. History
  3. Usage
  4. Resources

Extension that allows to create backups of mysql database (structure, data and FK's)

Requirements

Yii 1.1 or above.

History

v0.2 - dumping of views, dump of remote mysql DB;

v0.1 - inicial version;

Usage

  1. Download the extension on bitbucker: https://bitbucket.org/rodzadra/yii-dump-db/downloads
  2. Extract yii-dump-db to extensions directory

On controller:

(to download the generated sql file)

Yii::import('ext.dumpDB.dumpDB');
   $dumper = new dumpDB();
   echo $dumper->getDump();

(to show the generated sql)

Yii::import('ext.dumpDB.dumpDB');
   $dumper = new dumpDB();
   echo $dumper->getDump(false);

(to save a dump file)

Yii::import('ext.dumpDB.dumpDB');
   $dumper = new dumpDB();
   $bk_file = 'FILE_NAME-'.date('YmdHis').'.sql';
   $fh = fopen($bk_file, 'w') or die("can't open file");
   fwrite($fh, $dumper->getDump(FALSE));
   fclose($fh);

(dumping an remote mysql db)

Yii::import('ext.dumpDB.dumpDB');
   $dumper = new dumpDB('mysql:host=[HOTS];dbname=[DATABASE]','[USERNAME]','[PASSWORD]');
   $dumper = new dumpDB();
   $dumper->setRemoveViewDefinerSecurity(TRUE);
   echo $dumper->getDump();

Resources

  1. https://bitbucket.org/rodzadra/yii-dump-db

  2. http://www.yiiframework.com/extension/database-dumper/

2 0
9 followers
0 downloads
Yii Version: 1.1
License: GPL-3.0
Category: Database
Developed by: rodzadra
Created on: Apr 25, 2012
Last updated: 9 years ago

Related Extensions