Vinay M

#02-06 Silahis Apartments
121 Lorong K Telok Kurau
Singapore - 425762

Please send us a message and
we will get back to you within 1-2 working days.

Simple Expression Engine Database Backup

Posted by on 01 July 2011 in Read Later

A simple Expression Engine database backup solution using php in templates and Codeigniter database Utilities.

All you have to do is create a EE template and enable php. Add the following code and modify the "SERVER_PATH" variable and viola, visit the url in your browser and download the full database backup.


$this->EE =& get_instance();

// Load the DB utility class

// Backup your entire database and assign it to a variable
$backup =& $this->EE->dbutil->backup();

// Load the file helper and write the file to your server
write_file('SERVER_PATH/mybackup.gz', $backup);

// Load the download helper and send the file to your desktop
force_download('mybackup.gz', $backup); 


You can customize the filename, tables etc. Follow this guide :

Do remember to password protect the template to prevent unauthorized access.

Good luck