vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - vB Database Backup Pro (Lite) for vb 3.6 (https://vborg.vbsupport.ru/showthread.php?t=126925)

Paul M 09-17-2006 10:00 PM

vB Database Backup Pro (Lite) for vb 3.6
 
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.


rainyleaves 09-18-2006 02:03 PM

Install!!
Thanks Paul~~^^

rezapci 09-18-2006 02:15 PM

thanks so muchhhhhhhhh

awesome plugins.

bashy 09-18-2006 03:00 PM

Hi m8, just installed this version seen as the other version stopped working..

I get this error when i run it manually to check it...

An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)

What have i forgotten please

I take it
Code:

$backup['DUMP_PATH']        = DIR.'/../../backups/';  // Path ( With trailing '/' )
Is what we need to edit, if so would this be right, e.g.
Code:

= DIR.'/../../forums/mydbbackup/
or have i got it totaly wrong?

Or is it sommat else i forgot, sorry m8 but me aint 100% clued up on stuff like this yet!! :o

Paul M 09-18-2006 03:15 PM

Only you know where on your server you are going to store the backups.

DIR is the path to your forum root folder (without the trailing '/') - so what you have is probably wrong, I would guess you are trying to use a folder called mydbbackup in your forum folder, so it would be DIR.'/mydbbackup/' .

JFYI - Storing backups in your forum folder is a very bad idea, as anyone could download them.

seany1 09-18-2006 04:11 PM

Thanks

bashy 09-18-2006 04:17 PM

nah its ok m8 that was just an example so that i i had an idea as to what to put...its not gonna be in my forum folder, its actually going in the root :)

Thanks again

Ps you said without the trailing, yet you added a trailing in ya post, also the config file says with trailing as well
Which is it please?

voteforbird 09-18-2006 04:48 PM

Will this work on large boards? (300,000 posts)

Paul M 09-18-2006 04:52 PM

Quote:

Originally Posted by bashy
Ps you said without the trailing, yet you added a trailing in ya post, also the config file says with trailing as well
Which is it please?

I suggest you read it again. I said DIR is the path to your forum, with no trailing '/' in it.

Quote:

Originally Posted by voteforbird
Will this work on large boards? (300,000 posts)

We have over 3/4 million posts.

KoC 09-18-2006 05:06 PM

Is there any option for upload the file automaticly via ftp

Neal-UK 09-18-2006 05:10 PM

I have my backup off the root, but when I enter the same settings as when I do a manual backup I get the same error bashy gets.

In the config file, it does say DIR for the backup with trailing "/"

I've entered it like "/site/user/whatever/isit/dbbackup/"

phpdevrus 09-18-2006 05:17 PM

you just need to chmod the directory to make it writable. ;-) also remember to keep it out of public_html so that it is not viewable to the web.

also keep the directory within your sites dirs and not off of / but rather a local dir for that particular site ie. /site/user/what/backups/ or /home/whatever/backups.

your script will run as the user nobody or your account user, which will not allow it to write files off of root ie. /dbbackups

hope that helps.

----

i forgot to mention... nice... :-) works fine for me and i have 900k post. it might cause a load issue but it seems the same compared to when i run mysqldump from ssh.

Neal-UK 09-18-2006 05:21 PM

It's all set right then, the directory is chmod to 777 as i normally do a manual backup. It's one above public_html also for security reasons.

Can't get it to work.

EDIT: Replaced file with directory

phpdevrus 09-18-2006 05:22 PM

no i meant chmod the directory and not the file. let me know if that works or not.

Neal-UK 09-18-2006 05:28 PM

Yes the directory is chmod to 777, as I normally do a manual backup.

Weird, useful mod this too.

Snake 09-18-2006 05:57 PM

Thanks for this. Sounds interesting but do you have any screenshots?

Snake 09-18-2006 05:58 PM

Nevermind. Found one in the old thread.

mIRCnet 09-18-2006 06:13 PM

Paul ,
Sorry to ask you, My forum path is /home/user/public_html/forum
I want it to store the backup in this DIR /home/user/packups
can you help me please ?

steadicamop 09-18-2006 07:29 PM

This works very well, but I have a problem which I think isn't solveable - I think the php execution time is set at around 30 seconds, which often times out when it's backing up a table, and will only ever reach postindex before it ends, never carrying out a full backup - is there any way around this? I really would like this as it's damn handy to have daily backups!!!

Plus as I've just discovered, it leaves the forum offline!

Alrasam 09-18-2006 08:26 PM

Thanks Paul:)

Neal-UK 09-18-2006 10:01 PM

Is doing that safe though? Could it not be "found" by spiders and what not?

Paul M 09-18-2006 10:56 PM

There seems to be a lot of confusion about this line ;

PHP Code:

 $backup['DUMP_PATH'] = DIR.'/../../backups/';  // Path ( With trailing '/' ) 

Please note that the DIR is on the righthand side of the equals, and is a constant created by vbulletin - it is the full path to your forums root folder.

For example (in windows) it might be "d:/wwwroot/forum" - it has NO trailing '/' at the end, so the rest of the path definition adds one - so in this example the path defined above is "d:/wwwroot/forum/../../backups/" - which with the two '../' translates into "d:/backups/" a folder outside your public html folder. That backups folder must be writable by the webserver.

If you just want to specify a direct path then do so - e.g.

PHP Code:

 $backup['DUMP_PATH'] = 'e:/some/path/mybackups/';  // Path ( With trailing '/' ) 

Quote:

Originally Posted by KoC
Is there any option for upload the file automaticly via ftp

No.

Quote:

Originally Posted by steadicamop
This works very well, but I have a problem which I think isn't solveable - I think the php execution time is set at around 30 seconds, which often times out when it's backing up a table, and will only ever reach postindex before it ends, never carrying out a full backup - is there any way around this? I really would like this as it's damn handy to have daily backups!!!

Plus as I've just discovered, it leaves the forum offline!

The script timeout on this is 3600 (1 hour). You can set the close forum option to 0 if you don't want it to close your forum during backups. It won't open the forum again until it completes ok.

dbarry 09-19-2006 01:51 AM

Great Hack, thanks!
FWIW, the DIR thing made me go DOH too. So I opted to take the junior path and hard-code the backup directory:"
$backup['DUMP_PATH'] = '/home/electr/www/backups/'; // Path ( With trailing '/' )

Works great, less filling! :rolleyes:

steadicamop 09-19-2006 05:59 AM

Quote:

Originally Posted by Paul M
The script timeout on this is 3600 (1 hour). You can set the close forum option to 0 if you don't want it to close your forum during backups. It won't open the forum again until it completes ok.

Ok, that's not a problem but it's not doing a full backup - only gets to around half way through postindex before ending, and it did leave my forum closed after a failed partial backup.....

shuichi_akai 09-19-2006 06:37 AM

How can I restore my backups?

Pagandream 09-19-2006 06:50 AM

nice hank, thank you!

shuichi_akai 09-19-2006 06:56 AM

I think the backup needs to be gziped before will be better ;-)

Snake 09-19-2006 07:56 AM

I have a question. Does this mod backups up the database the way that phpMyAdmin does?

aciurczak 09-19-2006 08:20 AM

I've been waiting for this since 3.0. Thanks for porting it Paul, you rock! :cool:

Paul M 09-19-2006 11:01 AM

Quote:

Originally Posted by steadicamop
Ok, that's not a problem but it's not doing a full backup - only gets to around half way through postindex before ending, and it did leave my forum closed after a failed partial backup.....

You can change the timeout if you want (in cronbackup.php) - but tbh, if you have such a large postindex file then I would consider switching to using the vb fulltext search method and clear the postindex table out.

Quote:

Originally Posted by Snake
I have a question. Does this mod backups up the database the way that phpMyAdmin does?

No idea, afaik phpmyadmin has many different ways it can backup.

Quote:

Originally Posted by shuichi_akai
I think the backup needs to be gziped before will be better ;-)

Sorry, not going to happen with this, you can always manually zip them up yourself.

steadicamop 09-19-2006 11:24 AM

Quote:

Originally Posted by Paul M
You can change the timeout if you want (in cronbackup.php) - but tbh, if you have such a large postindex file then I would consider switching to using the vb fulltext search method and clear the postindex table out.

Sounds like a plan! I'm not too sure how to enable vb fulltext search, I had a quick look in the AdminCP and couldn't find anything, sorry to be a pain but any chance you could tell me where to find this?

Thanks!

Jason

Paul M 09-19-2006 02:17 PM

In the vbulletin options menu there should be two links - one for the options, and one for search type.

bashy 09-19-2006 03:02 PM

Hi Paul, yeah i know what ya said m8 but the actual file says, with trailing /, bit misleadin if your saying without trailing /
Thats what im on about m8

Code:

  $backup['DUMP_PATH']    = DIR.'/folder/forums/and/so/on';  // Path ( With trailing '/' )

Quote:

Originally Posted by Paul M
I suggest you read it again. I said DIR is the path to your forum, with no trailing '/' in it.


Paul M 09-19-2006 05:32 PM

There is nothing misleading, you are not reading it correctly - as already explained elsewhere, DIR is a constant defined by vbulletin, it has no trailing '/' in it. If you still don't understand then please PM me, not clutter up this thread.

steadicamop 09-19-2006 06:04 PM

Quote:

Originally Posted by Paul M
In the vbulletin options menu there should be two links - one for the options, and one for search type.

It's an elusive option I'm not totally sure what I'm looking for, I did find one called Duplicate Search Index Information on Thread Copy? but not sure if that's the right one.

I cleared out the postindex table, but again, it doesn't complete a full back up, it just gets further down the tables (it doesn't actually reach the user table). This is a little frustrating, I'm beginning to think my host is the issue here, I've had backup problems before.

Thanks,

Jason

Paul M 09-19-2006 06:34 PM

I think you are looking in the wrong place for the search option, see screenshot.

steadicamop 09-19-2006 06:58 PM

<font color="Navy">*puts glasses back on, squints</font> -- aaaah yes I'm so stupid to miss it there!!!

Thanks, done that, but I am still having that issue with it not completing a full back up, I do have a few extra tables in the database, but it's only around 20mb or so, I just can't understand why it never backs up completely :ermm: :ermm:

exilera 09-19-2006 07:34 PM

Does this add-on allow for a partial backup? If I wanted to just backup a part of the database related to user accounts, would that allow me to do so?

Jealousy10312 09-19-2006 07:54 PM

Quote:

Originally Posted by Paul M
If you just want to specify a direct path then do so - e.g.

PHP Code:

 $backup['DUMP_PATH'] = 'e:/some/path/mybackups/';  // Path ( With trailing '/' ) 


So where you put the "e:/" that's for Windows servers?

Also, the path /some/path/ .. is that inluding your root? Or is that the path of the folder you're currently in? For example, say I wanted to install it in includes/ folder, I would put "e:/includes/mybackups"

?

Thanks

bashy 09-19-2006 08:15 PM

Thanks a lot paul, sorted now and working well, your explanation help no end, Sorry for being a bit thick :o

Quote:

Originally Posted by Paul M
There seems to be a lot of confusion about this line ;

PHP Code:

 $backup['DUMP_PATH'] = DIR.'/../../backups/';  // Path ( With trailing '/' ) 

Please note that the DIR is on the righthand side of the equals, and is a constant created by vbulletin - it is the full path to your forums root folder.

For example (in windows) it might be "d:/wwwroot/forum" - it has NO trailing '/' at the end, so the rest of the path definition adds one - so in this example the path defined above is "d:/wwwroot/forum/../../backups/" - which with the two '../' translates into "d:/backups/" a folder outside your public html folder. That backups folder must be writable by the webserver.

If you just want to specify a direct path then do so - e.g.

PHP Code:

 $backup['DUMP_PATH'] = 'e:/some/path/mybackups/';  // Path ( With trailing '/' ) 




All times are GMT. The time now is 07:13 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.01689 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete