Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Database Backup Pro (Lite) for vb 3.6 Details »»
vB Database Backup Pro (Lite) for vb 3.6
Version: 2.12, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.x Rating:
Released: 09-17-2006 Last Update: 10-09-2006 Installs: 582
Auto-Templates
Re-useable Code Additional Files Translations  
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #322  
Old 06-11-2007, 09:56 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, you may post them in this thread.
Reply With Quote
  #323  
Old 06-12-2007, 03:07 PM
Mecho's Avatar
Mecho Mecho is offline
 
Join Date: Aug 2006
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #324  
Old 06-12-2007, 03:23 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1. By default yes - you can change that in the config file.

2. No, each backup is kept (they are dated).
Reply With Quote
  #325  
Old 06-12-2007, 03:27 PM
Deimos Deimos is offline
 
Join Date: Oct 2002
Posts: 529
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
To add remote server backup ability, my coder added this in the mysqlbackup.php file

Below this:

Code:
			// Unlock Tables
			if ($this->LOCK)
			{
				$this->MYSQL->query($unlock);
			}
		}
	}
Add this:

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 ----------------------*/
You need to change the "USERNAME" and "PASSWORD" bit
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
Reply With Quote
  #326  
Old 06-13-2007, 02:29 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #327  
Old 06-14-2007, 03:03 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #328  
Old 06-14-2007, 07:02 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #329  
Old 06-14-2007, 10:48 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

?>
Reply With Quote
  #330  
Old 06-14-2007, 11:21 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #331  
Old 06-14-2007, 11:29 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I doubt that path is correct, unless you have a folder called private on the root of your server.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05084 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete