w3easyBackup Manual

Backup Script

w3easyBackup Manual

Postby admin » 07.12.2011 14:42

(C) 2011 Joachim Haack, http://w3easy.org
The major part of the script is written by Vikas Patial (ngcoders.com/) who used a 'class to dynamically create a zip file (archive)' by Rochak Chauhan (rochakchauhan.com/blog/) and a 'MySQL database backup class' by Vagharshak Tozalakyan (tozalakyan.com/), all licensed under the GPL.
I added the functionality to backup also the root files that was not implemented so far and created a 'GUI' for the nice tool.

GNU General Public License, Version 3

PHP 5 (maybe also PHP 4 will do), NO DATABASE required.

- The database backup function is not well tested by me
- There were problems reported concerning database charset / collation (utf-8)
(I tested it with the w3easy forum database - and it worked fine...!)
- It is not recommended for larger backups
- It is not recommended for the backup of larger files like media files or large images
- It is not recommended to include the 'w3easyCMS/upload/' folder with the images and media files in a backup job.
- I experienced problems to backup items with 'malformed URI references' like f.e. images with blanks in the image name.

We strongly recommend to test the script well before using it!!!

With the w3easyBackup script you can easily store all the folders, files and databases you have chosen in the settings in a zipped backup file. This file can be stored in a backup folder on your server and can also be sent as a mail attachment to a mail account of your choice. In this case the backup file can even be deleted automatically.

First unpack and then upload the script folder to your webspace. Make sure that only you have access to the scriptfolder (if the folder is not yet protected, you could do it right now with our w3easyProtect script). Make sure that you have permission to edit the config file (depending on your server settings chmod file to 0666, 0664 or 0644 if necessary.)

Open the index.php and submit the form with checked 'show config' radio button. Specify the config settings as discribed there. Use always full path statements. Make sure that you put your settings always in quote marks! If you don't need a category but want to keep the example line, make sure to outcomment this line with 2 slashes at the beginning of the respective line.

Code: Select all
$domain          = 'yourdomain.tld'; // domain (no 'http://', no slash!)
$path_to_root    = '../../'; // path to root
$path_to_admin   = '../'; // path to admin area (if exists)
$charset         = 'UTF-8'; // charset 'UTF-8' or 'ISO-8859-1' or ?

Code: Select all
// general backup settings
$configBackupDir = 'backup/'; // backup directory
$configEmail     = ''; // email address for backup file

// files and folders to backup resp. to skip
// root files
$root_files      = 'yes'; // backup rootfiles? 'yes' or ''

// directories/files to backup (relative path, trailing slash)
$configBackup[]  = '../test/';

// directories/files to skip (relative path)
// $configSkip[] = '../content/drafts';

// Databases you wish to backup, can be many (if tables array contains table names, only those tables will be backed up)
// $configBackupDB[] = array(
'server'   => 'localhost',
'username' => 'root',
'password' => 'password',
'database' => 'databasename',
'tables'   => array()
// or alternatively:
// 'tables'   => array('table_1', 'table_2', 'table_3')

Now save your settings by submitting the form with checked 'edit config' button and close the config file by pressing the 'hide config' button'.
Make sure that the script has write permission in the 'backup folder' that you have specified (depending on your server settings chmod folder to 0666, 0664 or 0644 if necessary.)

In the settings you have already specified which folder, files and databases to backup and which to skip. Now you only have to select how to handle the backup file. If you simply choose 'backup', the backup zipfile will be stored on your server in the specified backup folder. If you choose 'backup, mail', the backup file will be stored and also be send to the specified email address. If you choose 'backup, mail, delete', the backup file will be deleted on your sever after been send to your mail address.

That's it!
Have fun and take it w3easy & zorry for my bad English...
User avatar
Posts: 21
Joined: 17.03.2011 17:36

Return to w3easyBackup

Who is online

Users browsing this forum: No registered users and 1 guest