Several ways to create your backups, they can save you tons of time in case
of a crash. So if you like a script and use it, make as mall donation here:
It helps reducing the yearly server burden and is greatly appreciated!
.:
PHP MySQL Backup V 2.2 :.
A simple solution if you want to make sure that you loose
no data if the server screws up.
Version 2 is a totally overhauled version.
Suitable for Windows and Unix !!
THERE WAS A SMALL ERROR IN FIRST RELEASE changed per 5/5/2004
(Always 1 table short). Now ok in Win and **x.
Version 2.1 offers fully selectable tables, and option to
backup structures only.
Better error protection, so less mistakes are possible.
You can backup to a file, and than download the file from
the server if you want a 'home' copy.
It is very advisable to make a regualer copy of your database, who guarantees
that your host is doing it??
I experienced this myself on a big host, that says they backup every 3
days........
They got hacked and the only backup they had was 3 month old.
The script has Backup / Restore / Delete / Download sections
.
Works with PHP 4.1++ and a unix server, has been tested on Windows/Apache(win32). If windows is giving problems change backup.php
and restore.php according to instructions in the files.
It will create the backup in a subdirectory DUMP of the
directory in which you put the scripts.
The script is created for backing up the whole database, or any tables
you want.
You can select 1 or more tables to back-up , just take out the tables
you dont want, as all tables in the database are shown.
Do this with caution, as all backup's are named backup.sql,
and only the contents differ.
Only Gzipped backup copies have a name you can change.
In will create a backup in the directory /dump, this is
a .sql file. (unzipped)
The script's /dump directory must be 777 so protect it properly.
You can download the backup either as sql file or as gzip
(sql as backup.sql and gzip with any name).
In case the server crashes totally (data lost, worst case scenario!).
The database will have to be recreated first.
Than make sure that the backup program is restored.
Run a fake backup in order to recreate the backup data file.
Upload an extracted version (backup.sql) of the backup.gz to
the server, or upload backup.sql.
Run the restore.
Version 2.2 contains backup_fulltext.php to handle fulltext indexes.
This is untested as i dont use these myself, but i think it works without problem.
This is basically the same as MySqlBackup, but you can backup
multiple databases on 1 server.
The only drawback is that you CANNOT select tables. All tables in a database
will be backed-up.
A backup selection for the databases is provided.
Aall backup's are named database_name.sql.
Gzipped backup copies have dbase_name+creation_date name.
The script will create a backup in the directory /dump, this
is a .sql file. (unzipped)
The script's /dump directory must be 777 so protect it properly.
The script has Backup / Restore / Delete / Download sections .
Works with PHP 4.1++ and a unix server, has been tested on Windows/Apache(win32).
.:
Cron MySQL Backup V 1.4 :.
Cron backup is based on the above package.
It can be run as a cron job. After running it will send an email to you
and have the backup as attachment.
The attachment is a zipped .gz file.
In case of an error it will send you an email stating the error.
Excellent for lazy people who always forget to make back-up's.
A restore module is included, so in case of trouble you can restore very
fast.
Version 1.0 has a problem with mail() it seems that mail() does not like attachments.
I use Manuel Lemos' classes now so that works even with POP before SMTP.
Version 1.2 solves a firing problem if you use PhpJobscheduler.
This was giving a path error. Now working ok. Also new setting for exclusion
trables.
If you do NOT have access to the cron settings on the server, you can use a
trick to trigger the backup.
If you have enough visitors, just add a 1x1 pixel oic to a page you know gets
at least 1 or 2 visitors per hour. Than let this 'pic' trigger the backup the
same way BiTLOG uses bit.php.
There is a script using this method jobscheduler.
Very easy to use.
I changed the script so it has presetting for hours (daily) and hours+day (weekly).
Furthermore it will send an email once the task has been completed.(can be switched
off)
You can find it here.
This page also contains tips how to run a php job in the background and since
cronbackup has no output, it can. Can make use of PHP exec() function. (Requires
some PHP knowledge).
Version 1.3 contains cronbackup_fulltext.php to handle fulltext indexes.
This is untested as i dont use these myself, but i think it works without problem.
Version 1.4 has file deletion added to the restore page.
This makes file handling more easy.
If you get a memory allocation error when sending email,
try to add ini_set("memory_limit","20M") or more to the top of backup.php. Version 1.5 will contain a possibility to split a large backup into several smaller pieces.
The size can be set in the config. The pieces are cut pieces of the gz file.
You will have to recombine them (Can use HJ-Join) to combine them to 1 .gz file.
Bear in mind that service providers also put limits on their mailbox sizes!
Files are numbered like dd-mm-yyyy.gz.001, dd-mm-yyyy.gz.002 ....