The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vB Database Backup Pro (Lite) for vb 3.6 Details »» | |||||||||||||||||||||||||
This modification is no longer available or supported. When vb 3.5 first came out I was using this backup system on my vb 3.0 - and having nothing better to use - I converted it to work on vb 3.5 (here) and since then I have cut it down and adapted it for vb 3.6. The original version was by Trigunflame and the rights to the code were bought by Zoints (D.Chapman) in January. A while ago David gave me permission to release my adaption, but until now I haven't got round to it. Trigunflame did mention a few months ago he was working on a new version, but nothing ever appeared. I have stripped out much of the extra stuff that I do not use (or indeed, could not get to work). This is a simple (lite) version that does a php based dump of your database either as one file, or one file per table. It's been in use on our forum since the day 3.6 was installed. Notes: * I will not add anything new to this, or spend vast amounts of time supporting it. * This is a Lite version to allow people to use the basic 3.0 backup functionality on 3.6. History: v2.10 : First internal version. v2.11 : Bug fixes, some code changes. v2.12 : Initial Public Release. Show Your Support
|
Comments |
#322
|
||||
|
||||
Yes, you may post them in this thread.
|
#323
|
||||
|
||||
Thanks .. works like a charm in vb 3.6.7 PL1 .
just 2 questions : 1 - it took a backup Table by Table . i mean it gave me many files not just one .SQL file , is it right ? 2 - for the next day is it anyway that new backup will save and overwrite to last one ?? Thanks |
#324
|
||||
|
||||
1. By default yes - you can change that in the config file.
2. No, each backup is kept (they are dated). |
#325
|
|||
|
|||
Because I do more than one backup a day, I changed the file saving format, so it saves it by year/month/day/hour/minute
So in mysqlbackupconfig.php, on the line which reads.. $backup['DATE'] I changed it to Code:
$backup['DATE'] = 'Y-m-d-G-i'; // Backup file date format Below this: Code:
// Unlock Tables if ($this->LOCK) { $this->MYSQL->query($unlock); } } } Code:
/* ------------- Remote FTP backup - added 6.11.07 ------ */ //If you want to move or replicate the folder hierarchy from your current server to another remote server. Then this will be helpful as this will browse the current server's directory and at the same time it will copy that file in the remote server in the same directory. //This script will copy all the files from this directory and subdirectory to another remote server via FTP // Source: http://us2.php.net/ftp function remoteBackup() { function rec_copy ($source_path, $destination_path, $con) { ftp_mkdir($con, $destination_path); ftp_site($con, 'CHMOD 0777 '.$destination_path); ftp_chdir($con,$destination_path); if (is_dir($source_path)) { chdir($source_path); $handle=opendir('.'); while (($file = readdir($handle))!==false) { if (($file != ".") && ($file != "..")) { if (is_dir($file)) { // choose only the current backup folder if($file != "propertyimages") { rec_copy ($source_path."/".$file, $file, $con); chdir($source_path); ftp_cdup($con); } } if (is_file($file)) { $fp = fopen($file,"r"); // this will convert spaces to '_' so that it will not throw error. -- VK ftp_fput ($con, str_replace(" ", "_", $file), $fp,FTP_BINARY); ftp_site($con, 'CHMOD 0755 '.str_replace(" ", "_", $file)); } } } closedir($handle); } } // make a FTP connection********************************** ADAM CHANGE THESE 2 LINES ********************************************************************************* $con = ftp_connect("XX.XX.XX.XX",21); $login_result = ftp_login($con,"USERNAME","PASSWORD"); // this is the root path for the remote server ******************** $rootpath = "/"; // this is the physical path of the source directory. actually u can also use the relative path. -- VK $sourcepath = realpath("/XXXX/XXXX/XXXX"); // this directory name will only change the top most directory and not the inner one -- VK $destination_dir_name = "XXXX/"; rec_copy ($sourcepath, $destination_dir_name, $con); if (function_exists("ftp_close")) { ftp_close($con); } } /* -------------- END FTP Remote Backup ----------------------*/ Additionally, you need to set the correct IP/hostname and the paths. So far for me, it's working a treat I've got it running every 3 hours to backup my database, gzip it, then ftp it to the server. Note: You will get a warning when the backup completes that the destination directory already exists I haven't fixed that bit yet |
#326
|
|||
|
|||
Ok, installed... I install all of Paul's mods... really nice programming...
Set it for 4:00am EST daily as I don't think there's a lot of folks up around those times, at least in North America.... Did a "Run Now" and it completed successfully..... :up: It created a nicely dated backup directory of files in a safe area... Thanks Paul... I'll sleep better knowing I'm no more than 24 hours out of date if I have a systems failure that needs recovery. Regards, Badger |
#327
|
||||
|
||||
Getting this error:
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.) Does it have to do with this? $backup['COMMAND'] = 'exec'; // exec, system or passthru I have exec disabled in php functions for security. Is there a workaround? |
#328
|
||||
|
||||
If you have exec disabled then all you can do is try the other two (system,passthru). ATM you have disabled the mods ability to create/modify/delete files & folders so it obviously isn't going to work (tbh, disabling exec seems a bit of overkill to me).
|
#329
|
||||
|
||||
I'm stilling getting the same error even after enabling exec
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.) My config file for the mod is: Code:
<?php /* Auto-Backup for vb 3.6 - Paul M - v 2.12 This version is adapted from the original vb 3.0 Hack by Trigunflame. */ // Forum Shutdown System $backup['SHUTDOWN'] = 1; $backup['MESSAGE'] = "The Forum is closed because a database backup is in progress."; // File Saving Information $backup['DATE'] = 'Y-m-d'; // Backup file date format $backup['PREFIX'] = 'Live-'; // Backup file prefix $backup['DUMP_PATH'] = '/private/'; // Path to backups folder, with trailing slash // Backup Options $backup['LOCK'] = 0; // Lock tables during dump $backup['REPAIR'] = 0; // Repair & Optimize tables before dump // Backup Type To Use $backup['TYPE'] = 2; // 1 = Only specified tables, 2 = All except specified tables $backup['TABLES'] = array(); // Table List - e.g. array('table1', 'table2') // Combine Tables into one file $backup['COMBINE'] = 0; // Backup Optimizations $backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4 $backup['INNODB'] = 0; // Set to 1 if you have Innodb Tables $backup['LOCKTABLES'] = 0; // Adds Lock commands to the backup file // Execution Function $backup['COMMAND'] = 'exec'; // exec, system or passthru ?> |
#330
|
|||
|
|||
The majority of those "Could not open Destination SQL file for writing" errors are due to permissions being incorrectly set for the destination folder and/or an incorrect path to the destination folder.
|
#331
|
||||
|
||||
I doubt that path is correct, unless you have a folder called private on the root of your server.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|