[help wanted]:MySQL backup system - Page 2 [help wanted]:MySQL backup system - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[help wanted]:MySQL backup system

Started by nova, October 21, 2003, 03:32:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

would be great - better than what we have now (nothing except smart-ass geek instructions on how to use phpMyAdmin's backup/dump). If you could come up with a solution that will work for newbies I'd appreciate it a lot (remember that half of it will be a newbie-proof documentation on how to use such a tool).

I'm looking forward to your contribution.

GauGau

Casper

:lol: There's no such thing as 'newbie proof'.
 Just look at half the questions you get here, would not be asked if the newbies had read the docs, and that includes me when I first came here. :oops:  :wink:
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

yeah, I (sadly) have to agree - but a good documentation will keep the other half from asking :wink: (hopefully)...

GauGau

jason

Quote from: "gaugau"I'm looking forward to your contribution.

ok, keep squinting....i'll post back when im ready for some outside testing.
jason

mikis

Maybe this can be used as a start... I picked it up on a forum some time ago. It is a simple script for restoring MySQL dump files. Restore (dump) file should be in the same dir as the script, or you can change its name and path; you can for example upload dump files with FTP.


<?
/* change this to fit your configuration: */
$hostname = "localhost";
$username = "myusername";
$password = "mypassword";
$dbname   = "mydbname";
$filename = "mydbname_db.sql";

/* Code begins here */

$connect = mysql_pconnect($hostname, $username, $password) or die(mysql_error());

echo "Import Started...<br>\n";
$handle = fopen ($filename, "rb");
$contents = fread ($handle, filesize ($filename));
$contents .= "\n\n";
fclose ($handle);
mysql_select_db($dbname);
$queries = explode(";\r\n", $contents); // if dump file is in Unix format, change ";\r\n" to ";\n"
$querycount = count($queries)-1;
for($i=0; $i < $querycount; $i++) {
    $result = mysql_query($queries[$i]);
    if(mysql_errno() != 0)
        echo '<br>' . mysql_errno() . ": " . mysql_error(). "\n";
}
echo "Import finished!<br>\n";
?>


From here, you can easily add file uploading via browser, or something like that. Creating dump file is much harder though. I tried using code form phpMyAdmin, but got lost in the way :)


loboclerk

I used to code my own forum. And have implemented the backup this way:

1) Use mysqldump and zip with the date appended to the file name. Backup includes table structures and data.

2) Option of download or storage of the zip file into a specific backup folder.

3) User can manage (download, delete) all the stored zip files. Deletion is done for older archives to save space.

4) To restore database, just choose the zip file identified by date, or upload the zip file.

I chose zip as it compresses text files very well. Saving the zip file to a backup folder is helpful especially if HTTP/PHP timeout occurs when backing up large databases. For those limited by host space, they would choose the normal download and upload method to backup and restore respectively.

Joachim Müller

Sounds promising. Do you have a script ready that accomplishes this?

Joachim

loboclerk

Lost my scripts long ago when I moved to phpBB. :P

Perhaps could code it again, should not be a big problem.

Will keep you updated :)

donnoman

This project looks like a possibility for some to use, makes no mention of the specific license it is released as.

http://www.absoft-my.com/pondok/backup.php

wildwalker

This idea is really great.

Like everyone else on this forum, I would like to be able to backup my databases. However, I would like to be able to backup directly to my backup web server, so if one server is down, the other is still running (although I would not allow uploads on the backup server)

A backup system on the next version of coppermine would be really really handy though.

havoc615

I can do a little php coding, so if u guys needa ny help lemmie know

Stramm

I'm using http://www.mysqldumper.de/en/index.php

from the webpage:
multilingual
Backup and restore of MySQL-Databases
Automatic sending of backups via Email or FTP
Automatic deleting of backups on the server following your own rules
Using a Perlscript as a Cronjob
Administration and manipulation of databases
Backup of database-structures (without data)
Backup and restore of tables
establishing of .htaccess to protect your backups
many details about your PHP-Version, MySQL-Version and more are shown
easy installation
easy handling
Multipart-Backup for very big databases
Multidatabase-Backup!


François Keller

Hi all,

I have adapted a backup script to make a coppermine plugin.
see mi post here: http://forum.coppermine-gallery.net/index.php?topic=40439.0
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog