Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Vbulletin Database Backup Pro (Cron Support) Details »»
Vbulletin Database Backup Pro (Cron Support)
Version: 1.9, by Trigunflame Trigunflame is offline
Developer Last Online: Nov 2019 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-20-2005 Last Update: 03-29-2005 Installs: 338
 
No support by the author.

VBulletin Database Backup Pro


NOTICE: 02/03/2006
This system is being "ReBorn" into a new product "Vbulletin Backup Pro" working from a New Codebase and hopefully implementing all the features and fixing all the bugs that were present in the previous releases.
This will be developed specifically for the vbulletin 3.5 system but will probably maintain compatabilty with the pre-existing 3.0 versions.



Summary:

Vbulletin Database Backup Pro is just what it says; a professional tool for your Vbulletin installation. This script will handle the automated backup of your forums in a secure, data-conscious and optimized way.


Introduction:

I want to interest all of you in the ultimate solution for automated database backup from within Vbulletin crontab system.
And potentially more so than a standard crontab.

It's been said, backing up without direct shell access is futile. Wrong. This script is optimized to work just fine with even the largest of databases. (Note: If you have an extremely large database, make sure to use the mysqldump binary option that is selected by default.)

The reason for the creation of this script was due to needing a better system of automated backup. I think me and a lot of people have used either a standard cron system, or brad.loo's small database cron; while they can be somewhat effective, they do not provide the functionality or a total solution without having to extensively mod it.

This system has automatic failovers for MySQLdump, as well as the compression programs used where applicable. All in all, this script is a one stop shop for handling your backup needs on a automatic basis or from the control panel without having to use shell and do a dump manually.


Features:
  • Absolutely NO Vbulletin File Modifications
  • Fully automized backup using the Vbulletin Cron system.
  • Remotely store backups on another srever via builtin FTP libraries.
  • Keep Remote FTP Server directory SYNC'd with Local Filesystem.
  • Dump using shell based, MySQLdump
  • Dump using an optimized PHP based Dump
  • System will Failover from MySQLDump binary straight Into a PHP Dump
  • Various other Failovers for file/dir creations & deletion.
  • Automatic pruning & control of a Specified max backups at any one time.
  • Do a Full database dump OR just the tables you want. Such as post, forums, threads & users.
  • Combine individual tables from a dump into 1 SQL File.
  • Some optimizations for InnoDb tables AND MySQL 4
  • System LOCKS tables while dumping, to prevent database corruption.
  • Can Shutdown forum while backup is in progress. And then REOPEN it automatically.
  • Customized Errors are Logged back into the Vbulletin Cron Log
  • Log path for MySQLDump Errors are customizable as well as Dump Path
  • Customize the Full Paths to binarys that will be used if needed.
  • Customize which execution command to use from PHP if using MySQLdump & certain compressors.
  • Specifiy the Dump Switches MySQLDump will use if selected.
  • Choose the option to Compress your Backups or not.
  • Choose from gzip, bzip2, tar, tar gz, tar bz2, zip for compressions.
  • And Many Many More...

Change log:
  • 3/30/2005 - Patch v1.9
  • Added configuration directives to control the PHP Dump optimizations for MySQL4, InnoDB, and Locking Tables. Some people were having some reported problems with restoring dumps; I believe this may have been the cause, I was using optimizations hardcoded directly for MySQL 4+ support, they are now MySQL 3/4+.
  • 3/25/2005 - Patch v1.8
  • Lots of bug fixes regarding directory paths. If dump path was null, the script would translate the path as starting at / root.
  • Incorporated Full Remote FTP Support.
    This includes remote offloading of dumps, keeping them rotated in sync with local backups, as well as removing Local backups after transfer to Remote Server.
  • 3/23/2005 - Patch v1.7
  • Added ability to Repair & Optimize tables before backup.
  • 3/23/2005 - Patch v1.6
  • A few configuration changes, I didn't save in the mysqlbackupconfig.php
  • 3/22/2005 - Patch v1.5
  • Made the LOCK Tables mechanism optional.
    Note: Use the shutdown Forums option, if you disable the LOCK Tables.
  • Made some adjustments to the cronbackup.php might help with the array_merge errors, and it may not..
  • Took the eval out for the parsing the configuration, they are referenced in hardcode now.
  • Modified the date feature for backups. Remember just use 'mdy' or 'm_d_y'.
  • 3/22/2005 - Patch v1.4
  • Added Backup Rotating (Pruning) support to limit max backups at any one time.
  • Make sure to replace all files, even the mysqlbackupconfig.php as it contains 3 new configuration options.
  • 3/21/2005 - Patch v1.3
  • Added some optimization code for InnoDB. Will help when you reload the database.
  • Reason: Thought about Erwin, I believe he mentioned he used InnoDB.
  • 3/21/2005 - Patch v1.2
  • Modified previous sql/directory cleanup. Better code.
  • 3/21/2005 - Patch v1.1
  • Fix for table prefixes, updated config with info about it.
  • Bug located by: Nexialys
  • 3/21/2005 - Initial Patch v1.0
  • Forgot to add unbuffered streams for fwrite(), this will speed up the compression of the database backup.
  • 3/21/2005 - Initial release. v1.0
  • Script was just released today, waiting on bug reports or any features that may need added to the script that I have missed.

To-Do:
  • AdminCP Based Dump Control Panel to Test & Run Customized Configurations
  • Create a Database Restore Tool, that works through Shell or PHP.
  • Redesign the error system for better debugging, with severity levels.
  • Finish implementing shell based support of Secure SSH SCP File Transfer Support
  • Full Backup of Directory Tree for all of your Files
  • Fix the bug regarding serializing/unserializing on some PHP Setups

Known Issues:
  • Need to work on some of the Raw Windows Commands.
  • Some of the stuff isn't reporting the errors as correctly as they should.

Instructions:
  1. Download the zip file.
  2. Place mysqlbackupconfig.php, mysqlbackup.php, ftp.lib.php, pclzip.lib.php in the forums 'includes' folder.
  3. Place cronbackup.php in your 'includes/cron' folder.
  4. Add a New Cron Task in your Scheduled Task Section. Refer to the screenshot if you need help.
  5. Read and Modify the configuration data in the mysqlbackupconfig.php
  6. Go back to the Scheduled Task section, and run the task. See what messages you get.
  7. Note: pclzip.lib.php is an Modified Version of this open source GPL Php Zip Library.http://www.phpconcept.net
  8. CHMOD 0777 the Directory you will be saving Dumps/Logs to !!!
  9. IF POSSIBLE. YOU OR YOUR HOST SHOULD TURN OFF SAFEMODE/OPENBASEDIR


Help Debugging:

This may come as a surprise to some people.. but I do all my code in notepad, thus it may not look formatted right for people that use editors. If you want to view the code in "my" style, how its supposed to look.
Open my files in Notepad, with Font size 10-Regular-Lucida Console.

As for An errors you may get, when you post;
Post your PHP Version, MySQL Version, and the Error as is Shown Please.


Further Info:

I would like a lot of people to try this script and give me feedback on what you would like changed, what Needs changed and so on and so forth. With the size of this script, it more than likely not gonna work perfect on every system.. so just tell me whats wrong and I will try to get it fixed.


Show Your Support

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

Comments
  #112  
Old 04-04-2005, 06:14 AM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any particular reason it's showing up in the logs 4 times?

Code:
10296  	DB Backup  	03:10, 4th Apr 2005  	MySQL Backup was completed successfully with no errors.
10295 	DB Backup 	03:07, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
10294 	DB Backup 	03:06, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
10293 	DB Backup 	03:05, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
Also I have it set to run at 2am sunday, and it's running at 3am Monday morning.

Actually I think this was my fault, It was running more than once, I had set only the 2AM, and not the Minutes.

So it was * 2 * * Sun for the cron instead of 00 2 * * Sun

EDIT:

It's showing the file ownership as not being me. and I can't do a 'chown' on it, because of course I'm not root, but I do own the folder it's in. How do I make the script use me as the file owner?

I'm having a small problem extracting it. I'm using tgz, so I'm extracting like this
Code:
tar xvz MM_DD_YY.tar.gz
and it just sits there doing nothing.

That is the right command yes?
Reply With Quote
  #113  
Old 04-04-2005, 08:37 AM
almqdad almqdad is offline
 
Join Date: Jul 2003
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does this thing work with 3.06
Reply With Quote
  #114  
Old 04-04-2005, 01:10 PM
Greebo Greebo is offline
 
Join Date: Dec 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by almqdad
does this thing work with 3.06
Should, I've got it on 3.0.7 and it works fine.
Reply With Quote
  #115  
Old 04-04-2005, 05:30 PM
cybermomcafe cybermomcafe is offline
 
Join Date: Mar 2003
Location: Ohio
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

//Fixed Problem// the vb3_threadviews table was showing as in use and had crashed... just ran the repair/optomize twice and it took care of it.

Working great on two of my forums, not sure what the problem is on the third though...

I'm getting this error when I try to run the script from the Scheduled Task Manager:

at the very bottom: 'vb3_threadviews.MYI' where's it getting that from?

Quote:
Database error in vBulletin 3.0.3:

Invalid SQL: LOCK TABLES `vb3_access` READ, `vb3_adminhelp` READ, `vb3_administrator` READ, `vb3_adminlog` READ, `vb3_adminutil` READ, `vb3_announcement` READ, `vb3_attachment` READ, `vb3_attachmenttype` READ, `vb3_attachmentviews` READ, `vb3_avatar` READ, `vb3_bans` READ, `vb3_bbcode` READ, `vb3_calendar` READ, `vb3_calendarcustomfield` READ, `vb3_calendarmoderator` READ, `vb3_calendarpermission` READ, `vb3_connections` READ, `vb3_cpsession` READ, `vb3_cron` READ, `vb3_cronlog` READ, `vb3_customavatar` READ, `vb3_customprofilepic` READ, `vb3_datastore` READ, `vb3_deletionlog` READ, `vb3_editlog` READ, `vb3_event` READ, `vb3_faq` READ, `vb3_forum` READ, `vb3_forumpermission` READ, `vb3_gamechallenges` READ, `vb3_gamenews` READ, `vb3_games` READ, `vb3_gamesessions` READ, `vb3_holiday` READ, `vb3_icon` READ, `vb3_ignors` READ, `vb3_imagecategory` READ, `vb3_imagecategorypermission` READ, `vb3_language` READ, `vb3_mailqueue` READ, `vb3_messages` READ, `vb3_moderation` READ, `vb3_moderator` READ, `vb3_moderatorlog` READ, `vb3_passwordhistory` READ, `vb3_phrase` READ, `vb3_phrasetype` READ, `vb3_pm` READ, `vb3_pmreceipt` READ, `vb3_pmtext` READ, `vb3_poll` READ, `vb3_pollvote` READ, `vb3_post` READ, `vb3_post_parsed` READ, `vb3_posthash` READ, `vb3_postindex` READ, `vb3_profilefield` READ, `vb3_ranks` READ, `vb3_regimage` READ, `vb3_reminder` READ, `vb3_reputation` READ, `vb3_reputationlevel` READ, `vb3_rooms` READ, `vb3_rss_settings` READ, `vb3_rss_user` READ, `vb3_search` READ, `vb3_session` READ, `vb3_setting` READ, `vb3_settinggroup` READ, `vb3_smilie` READ, `vb3_stats` READ, `vb3_strikes` READ, `vb3_style` READ, `vb3_subscribeevent` READ, `vb3_subscribeforum` READ, `vb3_subscribethread` READ, `vb3_subscription` READ, `vb3_subscriptionlog` READ, `vb3_template` READ, `vb3_thread` READ, `vb3_threadrate` READ, `vb3_threadviews` READ, `vb3_upgradelog` READ, `vb3_user` READ, `vb3_useractivation` READ, `vb3_userban` READ, `vb3_userfield` READ, `vb3_usergroup` READ, `vb3_usergroupleader` READ, `vb3_usergrouprequest` READ, `vb3_usernote` READ, `vb3_userpromotion` READ, `vb3_usertextfield` READ, `vb3_usertitle` READ, `vb3_utt_store_action` READ, `vb3_utt_store_asvs` READ, `vb3_utt_store_bank` READ, `vb3_utt_store_history` READ, `vb3_vbookie_bets_placed` READ, `vb3_vbookie_groups` READ, `vb3_vbookie_item_options` READ, `vb3_vbookie_items` READ, `vb3_vbookie_news` READ, `vb3_word` READ;
mysql error: Can't open file: 'vb3_threadviews.MYI'. (errno: 145)

mysql error number: 1016

Date: Monday 04th of April 2005 02:26:54 PM
Script: http://www.***********.com/vb/admin/...cron&cronid=14
Referer: http://www.**********.com/vb/admin/
Username: *******
IP Address: ************
Reply With Quote
  #116  
Old 04-04-2005, 08:29 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If this has been covered, sorry... I just don't have time right now to read through all the posts... It is working for me but I am getting the following error...

Failover was initiated for MySQLDump Binary, but dump completed successfully.

Any way I can fix this??
Reply With Quote
  #117  
Old 04-04-2005, 10:40 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by neocorteqz
Any particular reason it's showing up in the logs 4 times?

Code:
10296  	DB Backup  	03:10, 4th Apr 2005  	MySQL Backup was completed successfully with no errors.
10295 	DB Backup 	03:07, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
10294 	DB Backup 	03:06, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
10293 	DB Backup 	03:05, 4th Apr 2005 	MySQL Backup was completed successfully with no errors.
Also I have it set to run at 2am sunday, and it's running at 3am Monday morning.

Actually I think this was my fault, It was running more than once, I had set only the 2AM, and not the Minutes.

So it was * 2 * * Sun for the cron instead of 00 2 * * Sun

EDIT:

It's showing the file ownership as not being me. and I can't do a 'chown' on it, because of course I'm not root, but I do own the folder it's in. How do I make the script use me as the file owner?

I'm having a small problem extracting it. I'm using tgz, so I'm extracting like this
Code:
tar xvz MM_DD_YY.tar.gz
and it just sits there doing nothing.

That is the right command yes?
Try using

tar xzvf MM_DD_YY.tar.gz it worked fine me in test, if not just change it to use straight .gz encoding.

then just use

gunzip MM_DD_YY.gz



-------------

As for it showing up in your log at multiple times, I can not yet explain that... it has not occured for me on any of the forums I have tried this on, make sure you dont have multiple cron entries for the backup either.

As for the CHMOD problem, I will add into the script to CHMOD the file after it is saved, that should fix the problem hopefully...
Reply With Quote
  #118  
Old 04-04-2005, 10:45 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cybermomcafe
//Fixed Problem// the vb3_threadviews table was showing as in use and had crashed... just ran the repair/optomize twice and it took care of it.

Working great on two of my forums, not sure what the problem is on the third though...

I'm getting this error when I try to run the script from the Scheduled Task Manager:

at the very bottom: 'vb3_threadviews.MYI' where's it getting that from?
Yes that would be a problem with that table.

Note: I do have the option in the configuration to enable repair/optimize before the dump is initiated.
Reply With Quote
  #119  
Old 04-04-2005, 10:46 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RichieBoy67
If this has been covered, sorry... I just don't have time right now to read through all the posts... It is working for me but I am getting the following error...


Failover was initiated for MySQLDump Binary, but dump completed successfully.


Any way I can fix this??
It just means that you dont have access to the mysqldump binary via shell commands, probably because of safemode.

In this case, it is failing over into a manual PHP dump mode. As long as it is saving your dumps correctly, all is ok. But you might want to get safemode turned off if possible.
Reply With Quote
  #120  
Old 04-05-2005, 02:26 AM
rinkrat's Avatar
rinkrat rinkrat is offline
 
Join Date: Jan 2002
Location: Long Beach
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed in a heartbeat and spit out a perfectly compressed backup very quickly. Great stuff! Thanks for the great hack
Reply With Quote
  #121  
Old 04-05-2005, 03:40 AM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rinkrat
Installed in a heartbeat and spit out a perfectly compressed backup very quickly. Great stuff! Thanks for the great hack
You're very welcome , when I finish I hope for this to be integrated into Vbulletin permanently.
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 08:02 PM.


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.06773 seconds
  • Memory Usage 2,346KB
  • 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
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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