Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
vBulletin Cron Based Database Backup Details »»
vBulletin Cron Based Database Backup
Version: 4.2.0.2, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.2.x Rating:
Released: 12-27-2009 Last Update: 11-25-2013 Installs: 1434
Uses Plugins
Additional Files Translations  
No support by the author.

As of 23 Nov 2017 this modification has been withdrawn.

This is a cut down version based on a backup system written by Trigunflame for vb 3.0. It is a simple vBulletin cron trigged php system that does a dump of your database - either as one complete file, or as one file per table. Especially useful now that IB removed the old ACP backup option in vBulletin 4. Files can be (G)Zipped to save space.

All the options are located in the ACP in vBulletin Options >> vBulletin Automatic Backup

To install, download and unzip the files, and follow the instructions in the text file.


History:

v4.0.1 : 28-Dec-2009 : Initial release for vb 4.0.0 Gold.
v4.0.2 : 29-Dec-2009 : Added ability to block process larger tables.
v4.0.3 : 27-Jun-2010 : Added Gzip option.

v4.1.0 : 04-Dec-2010 : Updated for vBulletin 4.1.0.

v4.1.7.0 : 16-Oct-2011 : Updated for vBulletin 4.1.7.

v4.2.0.0 : 24-May-2012 : Updated for vBulletin 4.2.0.
v4.2.0.1 : 17-Mar-2013 : Removed vboptions from backup call..
v4.2.0.2 : 25-Nov-2013 : Fix php 5.3 deprecated warnings, added mysqldump backup.

Show Your Support

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

Comments
  #762  
Old 12-06-2012, 11:20 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LouiseWilson View Post
You should not really be putting anything in the public_html folder for security
In your VB options

Backups Path:-
/home/yourname/backups/

create folder outside of your public_html IE backups and chmod to 777

job done
Not all servers are configured equal.

On some servers, the security configuration may not permit the forum software to access folders outside of the public_html folder for that domain.
Reply With Quote
  #763  
Old 12-07-2012, 03:56 PM
smirkley smirkley is offline
 
Join Date: Apr 2008
Posts: 627
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Paul,...all I can say is,...SWEEET !!

Started playing with this on my VPS last night and could only get it to work in a public_html directory. Got tired and shut it down and went to bed.

This morning read each and every post trying to get this to work in a non-public directory and found that "../backups/" was what worked for me (not "../../backups/") (renamed "backups to something I prefer) and now stores in non-public directory. I feel better now that nobody can get to it.

I set the timestamp to numerical day of month (d) so since I have the storage space, will allow me to keep the last 30 (or so by month) days copies of backups before they start to overwrite when the month rolls over, which I prefer. This way when I do my weekly or so downloads of backing up my files, I can capture all 30 db backups in one process and store them offsite.

edit to add - Also changed my cron time to reflect a time trigger in an area where I know someone will be trafficking my site to avoid dead times that will not trigger the backup. (only takes ~60 seconds and I lock and repair tables settings on to keep the data stable) My visitors will barely notice that 1 minute.

Tested, Locked, and Loaded.

Thank you for this solution.
Reply With Quote
  #764  
Old 12-07-2012, 08:49 PM
Gary_Oak Gary_Oak is offline
 
Join Date: Oct 2012
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djbaxter View Post
What files did you put there?
The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the cronbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.
Reply With Quote
  #765  
Old 12-08-2012, 12:28 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary_Oak View Post
The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the mysqlbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.
Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.
Reply With Quote
  #766  
Old 12-08-2012, 12:59 AM
smirkley smirkley is offline
 
Join Date: Apr 2008
Posts: 627
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, tell me this aint weird.....

I tested exclusively by triggering the cron manually, and everything worked sweet.

So since those were tests, I deleted those backup gzips that were created under test, set a time for the trigger in the cron for 6pm.

Just checked and the cron says it ran 52 minutes ago (when I looked), so I checked in my backup directory and nothing was there.

So I did a manual run of the cron, and the backup showed up like before when I tested it.

Why wont it work when it says it will automatically. I have only changed the cron trigger time.
Reply With Quote
  #767  
Old 12-08-2012, 01:02 AM
smirkley smirkley is offline
 
Join Date: Apr 2008
Posts: 627
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by patrick91 View Post
It works fine that path manual! But have the problem is does not autobackup!? Is there an option that needs to be enabled to let this work or something on the server that need to be enabled?
Exactly what I just discovered !!

Paul, waas sapnin' here?
Reply With Quote
  #768  
Old 12-08-2012, 02:35 PM
Gary_Oak Gary_Oak is offline
 
Join Date: Oct 2012
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djbaxter View Post
Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.
I did that 2 weeks ago and it didn't work. public_html/includes/mysqlbackup.php and public_html/includes/cron/cronbackup.php . If I am wrong in my assumption that public_html is the forum root, then what would the forum root be?

Edit; I also tried putting it in www/includes/mysqlbackup.php and www/includes/cron/cronbackup.php but that didn't work either.
Reply With Quote
  #769  
Old 12-08-2012, 02:59 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What does "didn't work" mean? What error message did you get when you ran it manually?

If your forum is the only site on that domain, then yes it will probably be in /home/public_html/ would be the root.

But you also need to specify a folder to save the backups AND that folder needs to have write permissions (usually 777 although sometimes 666 will work).
Reply With Quote
  #770  
Old 12-08-2012, 03:39 PM
Gary_Oak Gary_Oak is offline
 
Join Date: Oct 2012
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.
Reply With Quote
  #771  
Old 12-08-2012, 03:47 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary_Oak View Post
I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.
In Settings, make sure the folder is specified as follows (assuming it is also in public_html):

Code:
AutoBackups/
Note: this is case sensitive.

The cron job should have been added automatically when you installed this add-on.

varname: cbu_crontask
Title: Automatic Database Backup for vBulletin
Filename: ./includes/cron/cronbackup.php
Product: Automatic Database Backup
Reply With Quote
Reply

Thread Tools

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 04:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06476 seconds
  • Memory Usage 2,329KB
  • 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
  • (1)bbcode_code
  • (6)bbcode_quote
  • (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
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (14)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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