View Full Version : Administrative and Maintenance Tools - vB Database Backup Pro (Lite) for vb 3.6
Paul M
09-17-2006, 10:00 PM
This modification is no longer available or supported.
When vb 3.5 first came out I was using this backup system (https://vborg.vbsupport.ru/showthread.php?t=78486) on my vb 3.0 - and having nothing better to use - I converted it to work on vb 3.5 (here (https://vborg.vbsupport.ru/showthread.php?t=112304)) and since then I have cut it down and adapted it for vb 3.6.
The original version was by Trigunflame (https://vborg.vbsupport.ru/member.php?u=19191) 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
$backup['DUMP_PATH'] = DIR.'/../../backups/'; // Path ( With trailing '/' )
Is what we need to edit, if so would this be right, e.g.
= 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
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.
Will this work on large boards? (300,000 posts)We have over 3/4 million posts.
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 ;
$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.
$backup['DUMP_PATH'] = 'e:/some/path/mybackups/'; // Path ( With trailing '/' )
Is there any option for upload the file automaticly via ftpNo.
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
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
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.
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.
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
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
$backup['DUMP_PATH'] = DIR.'/folder/forums/and/so/on'; // Path ( With trailing '/' )
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
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
If you just want to specify a direct path then do so - e.g.
$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
There seems to be a lot of confusion about this line ;
$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.
$backup['DUMP_PATH'] = 'e:/some/path/mybackups/'; // Path ( With trailing '/' )
bashy
09-20-2006, 05:11 PM
Just checked a backup and my custom avatars part is like this
/*!40000 ALTER TABLE `customavatar` DISABLE KEYS */;
INSERT INTO `customavatar` VALUES ('1','GIF89a\\\0^\0??\0 \0\Z--\r/0,\r-)&%&4?#\r6#3:/20Lc0N\r2n-8L(;i\ZEK7ll6\"E.O46f;PMNniN\Zhf+PQ.Op2iS3mlK\rQ\"J&N0-ld!`%l4/N<Ht>BOJ5Il7{ApF7rlzs.PPPKXmMqSMpmoQNf[cpkTmrn\r5‹:?\'9ŒG?G?i„,NŽ7R?0sŽ4b?6e?D[ŽDY?Nl?Ki?hy?gx?Na?3€\\;ˆhn‹7P…ZQŒoQ?|e‡[l?qr?x9„‘N?ŽU‘?X?ˆm‘Žo?+p?’t??xŸ?|??|??|??„%“3\0‡ .7?>!…9E”K”T7“q4?R ?N0?g?l.?RN?oSŒwn?ZQ?^h?mS+rl?R?P+?k?p0?W+?o\Z? s3?XC?mK?vh?[E?uGŒ{??x€š‹.??8??=—‹P?Œsœ?J„?|?’Q??o??O??p?‡
?‹0ϰ7?’?‰8????,ՏS?”qΰOάs?ŠK?–f??S??p????4?? :??O??p??|??N??i??U??pˆ‡†ˆŒ‘†—ˆ‰˜–”‰‡’?”–•‰——–Œš?Œ ??‘???“‹ ›??+“???ˆšō??™?⪸ѱ??’?™‘Ϫœ㹡?œ?ѱ?距?Դ?δ?? ??Ż???šŒ?—?ίŽȹ??˜???Š긨þ??????Œ?̴??œ????͍? ??Ž?????????????????????????????????????????????? ?????????????????????????????????????????????????? ??????\0\0\0\0\0\0\0\0\0!?
NETSCAPE2.0\0\0\0!?\0?\0,\0\0\0\0\\\0^\0\0?\ 0? ?\'? ?ƒ?$ȏ??{?? ?\'??=~????&p|??q?ǯž?z???T?1?K„0*X?aL˜?l?÷3\"?x?\n?ƒx‘›Œp8
?/?z?f?T(U??›?P^?:?aA????›g??z2\0H?#…?™??^?J??>‰uc2”6?)Iƒ??I??*—0V? @\0?+‰x?Y?{??L‚6?:??c…!i Sj?%?‡?d?€Pc\n:+4ˆW/F?”?Y?]P?(xb6m\Z?:t|??? 5b H#?\0??[Ȼ;n??n??`?`AŒ;y??`t?t?tj???fEd?™?;?š??›3‡?…B\Zi??B\r<??H.???C\r.??s?p]vUĝ ?3Y^???TS?́
,œ?‚
5??
All the custom avatar bit is like that, what does this mean?
I dont get that if i use phpmyadmin to backup!
Paul M
09-20-2006, 07:29 PM
It doesn't mean anything.
Open a GIF file in notepad and then ask again ;).
bashy
09-20-2006, 07:53 PM
lol, I know but this aint a gif file, and if i download from phpmyadmin the database dont show any of that....
Just wanting to make sure is all before i rely on it if ya know what i mean.
I just didnt want to find out when i really need it and it was corrupt or sommat :(
TheoMessinis
09-21-2006, 08:22 AM
Excellent!!!
/me clicks install
dimeola
09-22-2006, 07:53 AM
i have some problem. it works very good but when it tries to take post table`s backup, it stops. i changed timeout period but nothing changed. it doesn`t continue. so it doesn't take backups of tables after post table.
last taken table is Live-2006-09-21-post.sql
steadicamop
09-22-2006, 05:17 PM
i have some problem. it works very good but when it tries to take post table`s backup, it stops. i changed timeout period but nothing changed. it doesn`t continue. so it doesn't take backups of tables after post table.
last taken table is Live-2006-09-21-post.sql
I have the same issue.....
Paul M
09-23-2006, 03:47 AM
There is nothing I can really tell you. Our post table is fractionally under 500MB and it backs up in just over 4 minutes. I can't see any reason you could not backup much larger tables. I can think your problem is server related, maybe your host can help you.
Edit: Are you running in safe mode, or on windows (IIS), they both can affect the timeout.
Also, manually run the backup from the cron manager and see if you get a timeout error.
dimeola
09-23-2006, 07:06 AM
safe_mode Off Off
and my hosting plan is linux. i started backup from cron manager, but i don`t get any message :(
steadicamop
09-23-2006, 07:21 AM
Ditto same, no safe and linux - the only one thing I could suspect is the hosting - they may have set a short execution time for PHP (?)
The manual backup also causes the same issue - it's something other than the software, but damn frustrating.
Cheers,
Jason
realgoldtalk
09-23-2006, 07:30 AM
Hi Paul M,
Thanks for the modification How can i run it manually to test it?
Thanks and Regards,
Saad
Paul M
09-23-2006, 07:32 AM
Go to your Scheduled Task Manager in the ACP and run the cron job.
realgoldtalk
09-23-2006, 07:38 AM
Hi,
It is giving me this error
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
Saad
dimeola
09-23-2006, 08:00 AM
you must give full path for backup folder in mysqlbackupconfig.php.
like this /home/user/public_html/forum/databasebackup. after you give a permission mode 777 to this folder. After you can take backup.
realgoldtalk
09-23-2006, 08:32 AM
I did that :(
Saad
Paul M
09-23-2006, 08:42 AM
Well you haven't got it right - that is a simple permissions error, your web server does not have write permissions to the folder you have pointed the backups at.
dimeola
09-23-2006, 10:34 AM
safe_mode Off Off
and my hosting plan is linux. i started backup from cron manager, but i don`t get any message :(
Paul any different idea?
Catsgot9
09-23-2006, 02:49 PM
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
any idea why I am getting this?
Paul M
09-23-2006, 06:27 PM
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
any idea why I am getting this?Folder Permissions - Look back a few posts (to post #55).
Paul any different idea?Not really, it works fine if the server allows it to run. About the only thing I can change is to reset the timeout at the start of each table - but tbh, that's unlikely to make any difference as it seems as though your host has somehow set php to ignore the directive.
Catsgot9
09-23-2006, 08:59 PM
[QUOTE=Paul M]Folder Permissions - Look back a few posts (to post #55).
I chmodded my folder
/httpsdocs/backup (no trailing backslash) to CHMOD 777
Any other ideas?
Paul M
09-23-2006, 09:15 PM
Nope, it's a permissions error, only you (or your host) can fix them.
dimeola
09-23-2006, 10:17 PM
Processing poll : Total Rows = 24
Processing pollvote : Total Rows = 291
Processing post : Total Rows = 86239
it is cutting the process here.
I changed my time out period like this
max_execution_time 200
mysql.allow_persistent On On
mysql.connect_timeout 600 600
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
I think i have a different problem.
Paul M
09-23-2006, 10:49 PM
max_execution_time is set to 60 on our server, post has over 750,000 rows. Whatever your problem is, it's server related.
steadicamop
09-24-2006, 07:25 PM
I've been testing with mine, it reaches around 13mb mark before stopping, I managed to trim some old tables from the database, but it still doesn't reach the end - max_exec time is set to 60 on my server too - this is just so damn frustrating, i realise this isn't your problem, I'm just so desperate to be able to make daily backups automatically!
Thanks,
Jason
steadicamop
09-26-2006, 04:03 PM
Just did a short test on something; I used my phpMyAdmin to backup the database - it didn't complete it, cut off around the same place as it would with the VB Backup, then I used my host's version of phpMyAdmin which backed up it fully!!
Just for reference - my version backed up around 13mb, my hosts did a full 24mb.....
Antyrael
09-29-2006, 12:55 PM
Hello,
First I want to thank Paul M for this backup plugin, it's working very nice on my Windows server!
Now I got a request, or question, well actually 2:
I would like to compress (zip or rar) the folder containing the .sql files after the dumps have been completed.
Plus I would like to keep a history of atleast 6 previous backups on the server (I don't have the posibility to FTP/move the files to another location), and that the script automatically deletes the oldest backup.
Unfortunately I am unable to code this myself, is there anyone who can help me with this?
soletrader
09-29-2006, 05:49 PM
I have a newbie question. I get the following error:
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
I have chommoded the folder to 777. Did I not input the config.php file correctly?
here is what I have: DIR.'/home/sole/backups/
Is this correct? Thank you
Paul M
09-29-2006, 07:49 PM
No, DIR is the path to your forums, you are then appending that with another full path, change it to just '/home/sole/backups/'
Deimos
10-01-2006, 06:36 PM
Good system to have, just lacks the Gzip option, which is a shame.
alraqee
10-07-2006, 09:08 AM
Paul thanks for the mod
i have small problem, when i started to back up it reach up to Processing posthash : Total Rows = 0
Processing postindex : Total Rows = 585217
then stops !!!
any idea??
alraqee
10-07-2006, 09:10 AM
paul ... the problem solved :)
MySQL Backup was completed successfully with no errors.
thanks again
Paul M
10-07-2006, 09:12 AM
Glad you got it sorted, what did you do ?
Re timeouts in general (previous posts) - I'm pretty sure it's not a php timeout that is causing them to fail, I suspect some hosts have set timeouts on mysql queries and this is kicking in.
alraqee
10-07-2006, 09:50 AM
with me every thing going fine now
you are right about some hosts to set timeouts
i needs only to try it more than once befor it success ... mmmm i used the forumpath.php which comes with vbadvance to get the full path ....
i got this error at the begining: MySQL backup. Details (Could not open Destination SQL file for writing.)
then i made some modification on mysqlbackupconfig.php likr you said:
changing this:
$backup['DUMP_PATH'] = DIR.'/../../backups/';
to this:
$backup['DUMP_PATH'] = '/dir/to/backup/in/the/admincp/';
(full path wich comes in the forumpath.php
ofcourse I have chommoded the folder to 777....
when ever it stops you just need to refresh the frame only to start again
it works fine ... thank paul .... than you very much
paidtoshop
10-07-2006, 12:36 PM
Thanks Paul.
I have installed this on a windows platform. No problems what so ever. Workes a treat.
paidtoshop
mcyates
10-07-2006, 02:41 PM
i'm getting this error;
Warning: include_once(/home/myfootba/public_html/./includes/cron/databack.php) [function.include-once]: failed to open stream: No such file or directory in /weather/cronadmin.php on line 108
Warning: include_once() [function.include]: Failed opening '/home/myfootba/public_html/./includes/cron/databack.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /weather/cronadmin.php on line 108
Done
But i don't know why? Please help
Paul M
10-07-2006, 06:07 PM
databack.php is not a file related to this modification, it belongs to something else.
mcyates
10-07-2006, 11:12 PM
ok that must have been another one, but with yours i get this error:
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
hal05
10-08-2006, 02:26 AM
Works great! Is there an option to gzip the files?
Spikeman
10-08-2006, 03:12 AM
Thanks nice mod
Paul M
10-08-2006, 01:36 PM
Works great! Is there an option to gzip the files?No, there are no compression options in this Lite version.
This hack is great and solves many things with some web hosting providers that gives you backup and restore by money.
Thanks :)
da420
10-08-2006, 10:57 PM
Thanks Paul,
Works perfectly.
One question. What's the benefit/advantages of saving the MySQL backup in seperate files for each table? And, that of saving them all as one file?
Thanks again...
Paul M
10-09-2006, 12:29 AM
It makes it easier to restore just one table if you need to. If you need to restore all tables then one simple copy command will join all the files into one.
Barakat
10-10-2006, 03:34 AM
$backup['DUMP_PATH'] = '/home/barakat/public_html/gti/****/'; // Path ( With trailing '/' )
works finally in that way
da420
10-10-2006, 03:15 PM
Paul,
It shows that this hack has been updated since I installed when I look at the thread from the forum. I have 2.12. Is there an update that you added that you forgot to tell us about in this thread or am I just dilusional?
Paul M
10-10-2006, 04:48 PM
Nothing to worry about - I simply updated some comments in the config file to (hopefully) eliminate some of the repeating questions.
jgommel
10-16-2006, 12:05 AM
I just installed this in my site -- I made a few config changes and ran my first backup. All went well...or so I thought. When the script is done running, it doesn't re-activate the forums? My forums are still closed.
If I go into vBulletin's Admin-CP to turn the forums back on, they are listed as already being on. To "Truly" reactivate the forums, I just click on "yes" again and save.
Refresh the forums, and all is well.
Is there a fix/way to get the forums to turn back on after the backup?
Thanks!
Paul M
10-16-2006, 12:29 AM
If your backup completes okay then the forums will turn themselves back on, so I would guess your backup didn't complete ok.
jgommel
10-16-2006, 12:42 AM
If your backup completes okay then the forums will turn themselves back on, so I would guess your backup didn't complete ok.
Well, I didn't get any errors, I have a very large .sql file in my backup directory (changed my config to create one large file vs. multiple tables). Short of wiping out my database and uploading the backup from your application -- I'd say it worked just fine.
The same thing happened with prior releases as well -- I just never said anything. I figure it would get fixed in later releases.
Paul M
10-16-2006, 11:14 AM
I can't fix something that afaik works. If the backup completes okay then the last step turns the forum on, does your cron job actually log a completed ok message ?
I assume you know you can disable the option to close the forum if you want, it's not necessary for it to be closed.
Deimos
10-16-2006, 11:26 PM
Is it possible someone could modify this script to compress the forum backups?
It's an awesome script, but after a week of 100mb backups, it takes up ALOT of space
It's either 100mb per backup without compression, or 21mb with
Would it be ok for someone to do that Paul M?
Paul M
10-17-2006, 01:24 AM
Sorry, I won't support that - the problem with compression is that there isn't a common method that will work across all platforms - some servers will use gzip, others winzip. That's why it's not part of this lite version. (JFYI - My [daily] backups are 600MB).
Deimos
10-17-2006, 01:39 AM
Heh is that on the cable forum? I post there as AdamD
Yea, I can understand that.
Will you be bringing out a "non lite" version?
I'd pay for that, heh
Paul M
10-17-2006, 11:54 AM
Heh is that on the cable forum? I post there as AdamD
Yea, I can understand that.
Will you be bringing out a "non lite" version?
I'd pay for that, hehYes, that's CF's backups. :)
Nope, I won't be doing a non lite version. I don't have the time to write/support paid modifications.
aciurczak
10-20-2006, 11:26 AM
I'm having the same error as the earlier poster. The backup appears to be completed ok (no error messages in log), yet my forums are not turned back on afterwards. Forums are giving out a "forum closed" message to any non-administrators, but when I look in the admincp, the forums are already listed as "on". By just resaving with that setting, forums pop back on and all is well.
FWIW, it was working fine for a week or two (backups each morning) until I noticed this behavior for the first time yesterday morning (when my page-monitoring service started to squawk at me every 5 minutes).
I know I can disable the forums being turned off, but nevertheless it appears that there may be some issue with the current code, at least as applied to my own forum.
Paul M
10-20-2006, 04:23 PM
Code cannot work, and then not work, something must have changed.
Also, same question as I asked the other person - does your cron job actually log a completed ok message ?
Mentch
10-22-2006, 06:21 PM
Installed!
Thank you, I lost my database not too long ago due to a hosting problem. And I had no relevant backup that worked.
Works great. :)
Deimos
10-25-2006, 09:23 AM
I'm getting the same thing as well, it finishes, but leaves the forum closed, even though the admin panel says "on"
The log says
37074 Database Backup 11:04, 24th Oct 2006 MySQL Backup was completed successfully with no errors.
Paul M
10-25-2006, 05:54 PM
Sorry, but it works fine for me, I cannot replicate such an occurance, nor can I see any way for it to happen. I suggest you just don't use that option.
smoknz28
10-25-2006, 06:09 PM
Thanks Paul. Installed and working great! ;)
Necrosaro420
10-26-2006, 12:06 AM
Any ideas why I get this message every time I run it? Plus I dont have an option in the control panel anywhere for some reason to set my options, I have installed it correctly. Thanks
Error:
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
Paul M
10-26-2006, 03:06 AM
The message means either you have set the backup folder incorrectly, or the permissions on it are wrong. There are no ACP options for this, just the supplied config file.
Necrosaro420
10-27-2006, 12:39 AM
The message means either you have set the backup folder incorrectly, or the permissions on it are wrong. There are no ACP options for this, just the supplied config file.
How do I know where it is trying to back up to then? I dont see an option anywhere stating where it would go, so I can check the permissions =) Thanks
Paul M
10-27-2006, 12:49 AM
The setting is in the [supplied] config file.
Necrosaro420
10-27-2006, 03:07 AM
Any other ideas? I edited the correct backup directory, and I still get the same message...The DIR is also chmod 777
I tried
/domains/MYWEBSITE.net/public_html/backup/nightly/
as well as
/backup/nightly/
Paul M
10-27-2006, 03:14 AM
Try using a relative path, like ../backup/nightly/
Necrosaro420
10-27-2006, 01:15 PM
Try using a relative path, like ../backup/nightly/
Tried that as well, chmod to 777, still the same result
exilera
10-28-2006, 12:01 PM
Hey Paul, I'm getting this error when I try to run a backup manually.
Database Backup
Processing access : Total Rows = 0
Processing adminhelp : Total Rows = 1394
Fatal error: Call to undefined function mysqli_unbuffered_query() in /home/horizon/public_html/includes/class_core.php on line 1066
Any suggestions? :) Thanks a lot.
David
Edit: I see it also didn't turn the forum back on either.
Paul M
10-28-2006, 02:21 PM
That's a bug in vbulletin.
There is no such php function as mysqli_unbuffered_query().
The only thing you can do is use mysql, not mysqli.
It didn't turn the forum on because it failed.
exilera
10-28-2006, 02:39 PM
Hi Paul,
How can I use MySQL instead of MySQLi if I already specified MySQLi in the vBulletin config file when I setup vB?
Paul M
10-28-2006, 02:40 PM
Just change (edit) the config file.
exilera
10-28-2006, 02:47 PM
Hmm I went into config.php in the includes folder and changed mysqli (first option) to mysql, saved and now when I load the board, I just get a completely blank white page...
Any idea how I can fix this?
Thanks Paul,
David
Paul M
10-28-2006, 03:27 PM
Sounds to me like you may have made an editing error, so the config file isn't loading.
exilera
10-28-2006, 04:26 PM
I just changed mysqli to mysql. I changed it back to mysqli and everything came up normally.
Is there anything I have to do aside from changing mysqli to mysql?
gedsta
10-28-2006, 06:19 PM
Sorry to be a noob
i have a windows server and have created a folder called backups
c:\backups
what would the path be needed to save in this folde and not the forum folder
tia
Paul M
10-28-2006, 06:50 PM
"c:\backups\"
However, php may not have permission to write to it.
Necrosaro420
10-30-2006, 10:49 PM
Tried that as well, chmod to 777, still the same result
Any more ideas on this? It still will not work =( Thanks
Paul M
10-31-2006, 03:50 AM
Sorry, I can't help you with permission problems on your server. Speak to your host.
GoTTi
10-31-2006, 03:50 AM
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
Paul M
10-31-2006, 01:17 PM
Refer to post 117
Necrosaro420
10-31-2006, 07:03 PM
I got it working. For some reason it had to have a . in front of /backup/nightly, like ./backup/nightly/ no clue what the . means but it worked
Paul M
10-31-2006, 07:05 PM
"./" means the 'current' directory.
GoTTi
11-02-2006, 10:21 AM
Refer to post 117
i run the server. what kind of permissions do i need to set? what exactly does this error message mean?
Paul M
11-02-2006, 04:52 PM
The webserver user needs write permission to the folder (normally you would just set the permissions to 777) - also, you must make sure that no php open_basdir restrictions will prevent php from writing to the folder. The message means that apache/php did not have write permission to the backup folder you have specified, therefore it cannot create the backup file(s).
EasyTarget
11-05-2006, 10:20 AM
I have what seems to be an odd problem, maybe someone with coding knowledge would be able to explain it better.
When I run the script manually (run now) it works fine.. shuts the forum down, backs up the tables, turns the forum back on.
When it runs automatically it turns the forum off and I believe it stops at the post index table and does not progress and the forum stays off.
Why would it work fine with a manual start but not automatic? Does it execute in a different manner?
EasyTarget
11-08-2006, 02:00 PM
bump
Paul M
11-08-2006, 06:09 PM
There is no difference in how it runs.
Anomalies
11-08-2006, 11:16 PM
will be installing this, it will come in hand to have a daily backup. You never know when you need a backup.
mescalin
11-09-2006, 02:16 PM
yes it is not turning the board back to online!!! be carefull just use manual backup.. thanks for the mod but it would be better if it could turn back to online.. also a gzip would be good to store whole db..
EasyTarget
11-09-2006, 02:50 PM
There is no difference in how it runs.
so any idea why it would hang when its run automatically and not when its run manually?
Mudvayne
11-18-2006, 07:21 PM
// Backup Optimizations
$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4
How about MySQL 5? Does it compatible with that?
Paul M
11-18-2006, 08:46 PM
Yes, you can use that for MySQL5 as well.
All it does is add the DISABLE KEYS command while the data is being loaded (and then ENABLE them afterwards).
Mudvayne
11-23-2006, 06:26 PM
Ok.. Paul.. I just installed it.. I'm using MuSQL v5.0.24-standard-log.. I didn't change any value for this "$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4".. I mean keep it as it is.. Then run it from Schedule Task Manager without having any error.. Does that mean its working fine?
Paul M
11-24-2006, 07:28 AM
You won't know that until you restore a database using the output file.
kotlt99
11-29-2006, 03:08 AM
how does it work ??
I installed but i dont know how to backup database ?
Mudvayne
11-29-2006, 05:39 AM
It 'll take the backup automatically using cron.
JimmyN
11-29-2006, 11:28 PM
I have a few questions, first of
My database is 30mb, is there a way to keep get it smaller?
Also i would like to archive a few days of database backups and then have a cron script that will remove the old ones so i dont build up a few gig just in backups.
Also if i needed to restore one of these files, how would i do it?
Is there a way i can restore it from script /home/myname/forum_db_backup/
It would take a hour to download it from the server and iv never been able to restore it via php myadmin, (any file over 10mb) as it stops responding and looks up, probally due to timeouts etc.
Thats why id like the server side to restore to save me having to download and upload etc.
Anyone know how this can be done?/or make a script/cron for this hack
Thanks heaps :D
verbosity
12-07-2006, 05:35 PM
Thank you so much! Installed and just did a test run, works!
Bounce
12-07-2006, 11:50 PM
BRILLIANT !!!!
Works superbly on 3.6.4
Thanks Paul :)
Its taking around 7 mins to run so i've changed the forum off message to suit :)
The Forum is closed because a database backup is in progress.
Approx Time for this is 7 mins......
It will be getting run at 3am so shouldnae be many on so letting my forums stay closed whilst it completes it :)
*clicks install*
TonyGau
12-08-2006, 04:07 AM
When i test this mod on localhost(windows), it work successful, But when i publish this mod on my server(linux), it not work
I config like
$backup['DUMP_PATH'] = '/var/www/vhosts/mydomain/httpdocs/diendan/backups/';
and I chmod 777 to backups folder
I click run now Dbbackup in Scheduled Task Manager, display this error
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
But I browse backups folder , it create a folder like 2006-12-08 (?)
What this problem ? Can u support me ?
JimmyN
12-09-2006, 02:56 AM
Tonygau, check the config backup path is correct, and also chmod 777 the folder.
Eagle Creek
12-18-2006, 03:53 PM
Looks nice! Very nice!
Does it also work with the really big ones?
Paul M
12-18-2006, 05:00 PM
Define "really big".
Eagle Creek
12-18-2006, 05:32 PM
2GB + Databases.
200.000 + Posts.
Paul M
12-18-2006, 08:52 PM
Well our forum has about 850,000 posts and backs up fine, but the database isn't 2GB. The largest I've personally used it on was 1.4GB, I see no reason why size would matter though.
Eagle Creek
12-18-2006, 10:36 PM
Just wondering :-).
Because vBulletin advices to avoid the build-in backup option if you have a large database.
Thanks again Paul!
smoknz28
12-18-2006, 10:47 PM
Paul, is there a way to purge the backed up databases automatically after a certain day? Like, purge backed up databases after 5 days?
Thanks Paul for a great hack for us Admins. :up:
Paul M
12-19-2006, 12:55 AM
Sorry no, there is no such option, you have to do it manually.
Tigratrus
12-19-2006, 06:43 PM
Hey Paul/all. Thanks for this update... I'm a recovering Win2k person and I'm trying to get a handle on MySQL via command line, I've used Navicat for most of my MySQL work so far... The backup seems to work flawlessly, can anyone point me to a good way to restore it on another server? I've got a test server and I've copied the folder with all the .sql files in it. I downloaded a copy of the MySQL Administrator but it only seems to work with a single file at a time? I assume there's an easier way via the command line? ::sigh:: Thanks in advance for any assistance anyone can provide... Or for pointing me in the right direction ;-).
Paul M
12-19-2006, 07:18 PM
Connect to mysql from a command line using the "mysql" command, then connect to the database using the "use" command, then import the file using the "source" command.
Tigratrus
12-19-2006, 11:16 PM
I think I've puzzled out most of the details, thanks for pointing me towards the relevant commands. The one thing I haven’t been able to get working yet is the use of a wildcard for the source command? In a windows environment (my testbed) I dropped a copy of the backup folder created by this mod at the root of c:\ I connected and logged into the mysql utility with my target database active.
Then I tried:
source c:\2006-12-19\%.sql
but that threw an error.
I tried:
source c:\2006-12-19\*.sql
just for the heck of it but that threw an error as expected too.
IS there a way to feed in multiple files? Doing it individually works but that’s a LOT of files to run though. O.o
I’m quite sure I’m missing something very basic here, but it’s the dead bone simple things that are the hardest to figure out as none of the references mention them ;-). I really appreciate the help… I’m TRYING to get a handle on the command line vs GUI as I need to move in that direction to effectively work in Linux (my production server) but I’m not quite there yet.
Distance
12-20-2006, 12:32 AM
Amazing
Thanks
Paul M
12-20-2006, 04:19 AM
IS there a way to feed in multiple files? Doing it individually works but that?s a LOT of files to run though. O.o I don't think the source command will accept wildcards - join the files into one big one with the windows copy command.
RFViet
12-20-2006, 02:02 PM
Limited time = 3600 => what does mean 3600 ??
Tigratrus
12-20-2006, 02:08 PM
Thanks... I'm kind of surprised that there isn't wildcard functionality, you'd think it would make things a lot easier. ::shrug:: I did a quick
copy *.sql 2006-12-19.sql
And then
source c:\2006-12-19\2006-12-19.sql
And it seemed to restore fine. Thanks for the help... I thought it might be useful to post the specifics back in case any other non-linux fossils like myself come looking for an answer in the future ;-).
I assume there's a comparable command in linux to concatenate the files into a single .sql so that you can restore from a backup without going through (in the case of my particular DB) 182 source commands?
Adding a backup to single file option might be helpful, though I can see how having each table individually would be useful too...
Anyway, thx for the help!
Paul M
12-20-2006, 09:17 PM
Limited time = 3600 => what does mean 3600 ??3600 seconds (1 hour).
I assume there's a comparable command in linux to concatenate the files into a single .sql so that you can restore from a backup without going through (in the case of my particular DB) 182 source commands?
If there is I don't know what it is - I have to join them in windows.
Tigratrus
12-20-2006, 10:36 PM
::stunned shock::
How dreadfully ironic. In order to do a restore we have to ftp the files to a WINDOWS host to run a *command line* utility so we can put the file back up on the Linux host and run the restore? ::laughter::
I'd think the MySQL community would add wildcards just for that reason.
Sorry... I realize nobody else might find that amusing but I can't help it...
Thanks again Paul!
::wanders off chuckling::
BeaLzeBuB
12-29-2006, 07:29 AM
worked fine
thank you
clicked;)
ezekiel97
12-29-2006, 08:20 PM
I get this error,
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
What do I do? Make a file for it to write too?
Paul M
12-29-2006, 10:38 PM
No, it means your web server does not have write permission to the folder you have chosen.
ezekiel97
12-30-2006, 05:52 AM
Nevermind! THANKS!!
David Gillaspey
12-30-2006, 07:20 PM
The config file has a setting for closing the forum (or not). Is it, in fact, necessary to close the forum during the automated backup?
Thanks.
Sincerely,
David Gillaspey
Paul M
12-30-2006, 11:18 PM
If you run your backups in a quite period then no, it's not. I don't use that option.
David Gillaspey
12-31-2006, 03:16 AM
OK. Thanks, Paul.
Sincerely,
David Gillaspey
Joey805
01-01-2007, 08:48 PM
How does this handle the old backup files? Will it delete backups, say after a week old automatically? Or do they just keep getting placed in the backup folder and you have to go manually delete them so you don't eventually run out of disk space?
Paul M
01-01-2007, 09:30 PM
You must manually delete them.
BigJohnny
01-02-2007, 11:44 PM
You must manually delete them.
aww crap.... that was the best feature of the old version.......
oh well.... i like the way this backs up better though :)
Reven
01-07-2007, 12:11 AM
I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip. My database is about 35MB, and it's making it 5MB.
If you want to do the same, here is what to do. Please note, though, that this will only work if you have chosen to combine all data into one SQL file and not split each table into its own file.
File: ./includes/mysqlbackup.php
FIND (lines 525 to 527):
// Free Memory
$this->MYSQL->free_result($rows);
}
ADD BELOW:
// Compress file
if(extension_loaded('zlib') && $this->COMBINE)
{
echo "Creating gzip file from SQL file<br />"; vbflush();
$file = fopen($this->FILE, 'r');
$data = fread($file, filesize($this->FILE));
fclose($file);
$file = gzopen($this->FILE, 'w9');
gzwrite($file, $data);
gzclose($file);
rename($this->FILE, $this->FILE . '.gz');
}
You must also have the zlib extension compiled into PHP. Most shared hosts will have zlib installed as well as most PHP installations in general. The script will not attempt to compress the file unless zlib is installed. You can find out if you have zlib by entering the Admin CP and going to Maintenance > View PHP Info and looking in the Configuration Command section for '--with-zlib'.
Spun2U
01-07-2007, 01:00 AM
Very nice!!
Thanks Paul! :D
zetetic
01-12-2007, 10:03 PM
I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip.
Thanks!
TheFrienzNet
01-13-2007, 07:10 PM
I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip. My database is about 35MB, and it's making it 5MB.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 172643155 bytes) in /usr/local/psa/home/vhosts/frienz-network.com/httpdocs/includes/mysqlbackup.php on line 534
Hmph.. I guess the memory exhausted?
Hellraider
01-13-2007, 07:54 PM
I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip. My database is about 35MB, and it's making it 5MB.
Thanks, works fine for me.
Paul M
01-13-2007, 11:57 PM
If you want to do the same, here is what to do. Please note, though, that this will only work if you have chosen to combine all data into one SQL file and not split each table into its own file.If you don't mind I'll think about borrowing this code and adding some extra options at some point (when I'm not so busy).
92GreenGT
01-18-2007, 05:02 PM
I found this mod by searching for backup things, im just now learning about how to do them etc etc. So I will ask this before I post a reply saying I get some error message.hehe
$backup['DUMP_PATH'] = '/path/to/backups/'; // Path to backups folder, with trailing slash
I dont understand this, not the way everyone else has been asking questions about though. What I dont understand is, am I supposed to go into my FTP and make a folder called whatever I want for the backups to go into? I made a folder on the root I guess(sorry if my terms are wrong) but I made a folder named Backups. If this is correct how would I word the path for that? The rest I understand but this has me confused. Thanks
Menime
01-19-2007, 02:18 AM
When I try to run this I get the following error message:
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
madkeen
01-20-2007, 01:08 PM
Thank you
Installed and working fine
da420
01-20-2007, 02:29 PM
When I try to run this I get the following error message:
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
the location you are saving the file to is not writeable.
Menime
01-20-2007, 05:04 PM
the location you are saving the file to is not writeable.
The folder I have it set to is set at 777.
Paul M
01-20-2007, 05:38 PM
You may have other (php) restrictions in place.
Menime
01-20-2007, 06:22 PM
Could you be a little more specific about that Paul? I keep thinking I am missing something stupid and I can't figure it out.
Paul M
01-20-2007, 06:45 PM
Since I have no idea how your server/hosting is set-up then I can't be specific. My guess would be a php open_basedir restriction.
Ahsin1
01-22-2007, 09:32 PM
I mm getting this error
Database Backup
Parse error: syntax error, unexpected T_VARIABLE in /home/mohsin1/public_html/includes/mysqlbackupconfig.php on line 18
Help me
Ahsin
Paul M
01-23-2007, 01:36 AM
Fix the editing error you have made in mysqlbackupconfig.php
(possibly a missing semi-colon at the end of the dump path line you edited).
Terminatoronly
01-23-2007, 02:18 PM
great hack thanks paul installed ;)
TheWhite
01-23-2007, 02:29 PM
What are the benefits of using this instead of Mysqldumper?
92GreenGT
01-25-2007, 02:18 AM
Well I got the mod installed and ran the cron job to manually test it and it went through.
MySQL Backup was completed successfully with no errors.
Done
Since it said it was done with no errors that means im in the clear right? So if I pull this off my FTP and save it on my computer this will be all I need to run if something ever happens? Sorry for all the idiot questions but honestly this is the first back up I have ever done.:(
-Edit-
Just wanted to say that it closed my forums and opened them after the job was done no problem. Marked as Installed.:)
taydu
01-25-2007, 07:56 AM
how do I restore a large database without SSH
Ahsin1
01-25-2007, 09:27 PM
Installed working great :)
just wondring is that possible to get only 1 .sql file instead of whole bunch of files like when we back up from Admincp we get only 1 file is that possible with this one? :(
Ahsin
Paul M
01-25-2007, 11:04 PM
Just change the combine option in the config file.
Ahsin1
01-26-2007, 04:34 AM
aite thanks for ur reply working great now
Ahsin
shungo
01-26-2007, 05:01 AM
Thanks for this mod :)
taydu
01-26-2007, 08:28 AM
One question, after I restore the database and go to the forum it still say " Forums is close ...." shouldn't it turn on automatically? Just to make sure that i'm not doing anything wrong
Paul M
01-26-2007, 09:02 AM
No, you will have to turn it on manually if it's closed (because you backed it up closed).
taydu
01-26-2007, 06:19 PM
thanks Paul,
In the future will you include FTP option so it can upload the db to an external server for a second back up? This is a nice feature to have, hope to see it future version.
Thanks
verbs
02-03-2007, 05:45 PM
I apologize for being a newb here, but is there a step by step of how/where to install this on my database and then how to turn it on so that it backs up all the information I need automatically?
Quantnet
02-03-2007, 09:09 PM
which directory you guys backup to? I backup to the same server my forum resides but given that the backup folder is 777, other people will be able to read my database backup ?
TrIn@dOr
02-05-2007, 09:36 AM
Hey Paul, in our site the script halt on "Database Backup" and stays there.
In the FTP, the new date dir is created, but the site is not closed and a sql file is not generated.
3.6.4
Paul M
02-05-2007, 10:31 AM
Then you have a problem with your set-up.
Reven
02-05-2007, 06:05 PM
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 172643155 bytes) in /usr/local/psa/home/vhosts/frienz-network.com/httpdocs/includes/mysqlbackup.php on line 534
Hmph.. I guess the memory exhausted?
PHP obviously ran out of memory. If you have access to php.ini then you can manually increase the allocated memory for PHP, but backups by nature will always be resource intensive.
If you don't mind I'll think about borrowing this code and adding some extra options at some point (when I'm not so busy).
Sorry for not replying sooner. Yes, of course you can use the code.
oglsmm
02-05-2007, 07:28 PM
You can also create/edit the .htaccess file in your forum directory. Add the line:
php_value memory_limit 50M
If your host allows this you can boost the allowed memory.
kontrabass
02-07-2007, 02:21 PM
I really wish I could use this mod... Is there any chance of a MysqlHotCopy version of this? Or is there already something out there that I'm not finding?
With over 3.5 million post table records and no slave DB server, using mysqldump really isn't an option (downtime would be way too long). :(
Mysqlhotcopy can do the backup in 3 minutes, but I wish I could find a mod like this to shut down / open the boards automatically...
Paul M
02-07-2007, 03:05 PM
Sorry, I have no idea what MysqlHotCopy even is.
I have no plans to make any changes to this in the near future, and any that do get made will be minor.
Eagle Creek
02-16-2007, 06:18 AM
Why should I or should't I close down the forums?
Why should I or should't I lock the tables?
Does it make multiple backups? So when there's one in place, does it make a new one?
Can it backup to a FTP?
Paul M
02-16-2007, 10:56 AM
1 & 2 - Your choice - there is no should or shouldn't.
3. Backups are date based, so each day you get a new copy, run it twice on the same day and one will overwrite the other.
4. No.
Eagle Creek
02-16-2007, 12:24 PM
Loud and clear!
About the closing and locking: is there an advantage to do so?
Sjakie
02-16-2007, 02:50 PM
In the setting, should I use this location: /var/www/vhosts/mysite/httpdocs/dbbackup/ or from the root /dbbackup/
And does it also work with PHP 5
Mudvayne
02-16-2007, 03:32 PM
I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip. My database is about 35MB, and it's making it 5MB.
If you don't mind I'll think about borrowing this code and adding some extra options at some point (when I'm not so busy).
Any update Paul ? :).
In the setting, should I use this location: /var/www/vhosts/mysite/httpdocs/dbbackup/ or from the root /dbbackup/
And does it also work with PHP 5
/server_root/backup/. Like mine is /home/username/backup/
Yep I'm using PHP 5.2.0 so far its working :)
Paul M
02-16-2007, 04:25 PM
Any update Paul ? :).No, it's very low on my list of things to do.
patrice@patrice
02-18-2007, 12:30 PM
Thanks a bunch for this. :up:
I originally had problems because I was timing out when it hit my postindex table, so I just removed that table from the backup list and it works like a charm now.
Thanks again!
Patrice
projectego
02-28-2007, 09:38 AM
* projectego clicks install ;)
SkyCatcher
03-04-2007, 03:35 PM
If I read ONE MORE POST about how to set the path correctly or receiving the
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)Error I'm going to explode!
Setting the correct path for Linux Distributions
Original Line
$backup['DUMP_PATH'] = '/path/to/backups/'; // Path to backups folder, with trailing slashOn Linux servers / is the most parent path (i.e. This is the base where everything starts).
You should know the path to your forums. Most people will have a shared hosting account so you need to contact your host (or look into the original email sent to you when you purchased your hosting) to get the path.
If you are on a shared hosting the path names will differ a little but in essense they are the same.
==========================================
A typical path, for example, for suse will be:
/srv/www/vhosts/mysite.com/httpdocs/forumThat is the PATH (not web directory) to your forum.
When you log in with FTP you will probably be at
/srv/www/vhosts/mysite.com/OR
/srv/www/vhosts/mysite.com/httpdocs/Depending on how your host has setup your account.
==================================
If you change the original line to something like
/mybackupsIt's guaranteed to fail because you don't have access to that path unless you have root access to that server (unless you own it - you don't).
==========================================
So how do I actually know where to store the backup files?
You can use . or .. to change directories without knowing the actual path.
You know 100% that the script is in /forum/includes/ (or whatever your forum directory is called).
So let's take you back to YOUR parent base directory.
==========================================
../../../That means you have just gone back 3 directories.
From:
http://www.yoursite.com/forum/includesTo (remember you have an additional folder like httpdocs, hence 3)
http://www.yoursite.com/==========================================
In paths, this would be going from:
/srv/www/vhosts/mysite.com/httpdocs/forum/includesTo:
/srv/www/vhosts/mysite.com/httpdocs/So now you are at the base directory where you can upload files to the web.
==========================================
So use an FTP program and navigate to your base http folder where you can see the folder to upload files to the web where others can access them (httpdocs for example)
(Before)
Something similar to this...
/httpsdocs
/httpdocs - This is the folder (or similar) that I mean
/cgi-bin
/test
/stats
now create a new folder called mybackups and CHMOD it to 777
(After)
/httpsdocs
/httpdocs
/mybackups(This is the folder you created)
/cgi-bin
/test
/stats
==========================================
Now edit the config file and set the path to something like this:
../../../mybackups/
The script will automatically change directories and save your files there.
==========================================
If you get the "(Could not open Destination SQL file for writing.)" Error you need to check to make sure it's set to 777. If you still get the error you may need to change
the path to:
../../mybackups/
AND create the folder mybackups inside the httpdocs folder (same directory where /forum is) and CHMOD that to 777.
/forum
/mybackups(This is the folder you created)
/picturs
/whatever
============================
============================
Nice Hack. Installed and working with no problems. Thanks for this :)
djbaxter
03-04-2007, 04:09 PM
If I read ONE MORE POST about how to set the path correctly or receiving the
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
Error I'm going to explode!
:confused:
I'm not sure I understand. So what IS the correct path? :o
SkyCatcher
03-04-2007, 04:28 PM
:confused:
I'm not sure I understand. So what IS the correct path? :o
*poof* ;)
Kirk Y
03-07-2007, 10:50 PM
What's the importance of the postindex table -- is it a necessity to have in a backup or can it be skipped, as I notice my forum hangs and sometimes errors leaving the forum offline when the postindex table is being processed.
Paul M
03-07-2007, 11:46 PM
It's part of the vb search system, you don't need to back it up as you can rebuild it from within the ACP.
Kirk Y
03-08-2007, 12:12 AM
I just realized that I'd yet to switch to fulltext searching - I thought I did, so that cut my backup size down.
Thanks Paul, I'll remember that.
djbaxter
03-08-2007, 12:37 AM
I just realized that I'd yet to switch to fulltext searching - I thought I did, so that cut my backup size down.
Thanks Paul, I'll remember that.
:confused:
Switching to full text searching cuts the backup size down? I would have thought it would be the other way 'round...
Paul M
03-08-2007, 09:48 AM
Nope, indexes are never backed up.
Using FT searching means you can forget the word and postindex tables (or just empty them).
TrIn@dOr
03-08-2007, 10:40 AM
Ok, trying it (because needed) for the second time.
Inside my destination backup directory, after running the task manually, a dir is created.
That dir is Y-m-d format, but the task stoped and no SQL is generated.
Error: An error occurred during the MySQL backup. Details (Could not open Destination SQL file for writing.)
The dir is correct set, but why not the sql?
Thanks.
djbaxter
03-08-2007, 11:21 AM
Ok, trying it (because needed) for the second time.
Inside my destination backup directory, after running the task manually, a dir is created.
That dir is Y-m-d format, but the task stoped and no SQL is generated.
Error: An error occurred during the MySQL backup. Details (Could not open Destination SQL file for writing.)
The dir is correct set, but why not the sql?
Thanks.
That usually means:
1. you haven't set the backup directory to be wirteable, OR more likely
2. you haven't correctly specified the path to the directory: note that this is the "physical" path on your server, not the URL - read previous posts in this thread by Paul M for specific instructions
antiekeradio
03-08-2007, 01:20 PM
well; here is what I get.....
Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/../../db_backup/2007-03-08) is not within the allowed path(s): (/tmp:/home/etc/etc:/usr/lib/php:/var/etc/etc/etc) in /includes/mysqlbackup.php on line 225
and another 4 times an equivalent error
whatever i fill in the backup dir, the error remains the same....
is there something wrong with the server setup?
djbaxter
03-08-2007, 01:41 PM
No, there's something wrong with your path to the backup directory.
antiekeradio
03-08-2007, 01:48 PM
what i thought of as really strange is that the path i specify comes back twice within the ( and ), first time after (/tmp:/ and then after :/user/lib/php:/
anyways, i am going to try again (never had this sort of problems with paths before, and i used impex etc)
TrIn@dOr
03-08-2007, 01:53 PM
That usually means:
1. you haven't set the backup directory to be wirteable, OR more likely
2. you haven't correctly specified the path to the directory: note that this is the "physical" path on your server, not the URL - read previous posts in this thread by Paul M for specific instructions
The directory has 777 of permissions, thats why the Y-m-d directory is created.
The path used is the same used with vBadvanced (http://www.vbadvanced.com/) CMPS (phpinfo), thats why the Y-m-d directory is created too.Or?
antiekeradio
03-08-2007, 03:54 PM
OK well now I am 100% sure I have filled in the directory correctly.
why? it still doesn't work but if i manually add the dir that would be generated for todays backup, it gets deleted after the error messages. same for the sql file for the access table, in that directory.
there's an error somewhere else. either in the script or in the webhost's configuration.
our server runs PHP Version 5.1.6 with MySQL 4.1.14
Paul M
03-08-2007, 03:57 PM
is there something wrong with the server setup?Not exactly, openbasdir is a system in php that restricts what files it can write to, you can only write to files within the paths listed in the error. You really need to speak to your host, or use a path within those allowed.
antiekeradio
03-08-2007, 04:11 PM
i think the 'allowed' path gets screwed up because i see virtually the same path thice, separated by a colon.
will have to talk about this with the host (or uninstall until we found a better one ;-) )
anyways, thanks for your time and i WILL reinstall this when i can get it working!!
Aclikyano
03-17-2007, 08:14 PM
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
(when I selected run now)
djbaxter
03-17-2007, 10:26 PM
Database Backup
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
(when I selected run now)
Either
1. the path to your backup directory is incorrect; or
2. you forgot to write-enable the backup directory (7-7-7)
ascender
03-18-2007, 12:11 PM
Fantastic product, thanks for developing it and sharing.
stejoh
03-18-2007, 01:08 PM
Seems to work just great for me! Many thanks!
Have two questions about the config file:
What does the options below mean and what effects has the value 1 on these settings?
// Backup Options
$backup['LOCK'] = 0; // Lock tables during dump
$backup['REPAIR'] = 0; // Repair & Optimize tables before dump
// Combine Tables into one file
$backup['COMBINE'] = 0;
djbaxter
03-18-2007, 02:22 PM
Have two questions about the config file: What does the options below mean and what effects has the value 1 on these settings?
// Backup Options
$backup['LOCK'] = 0; // Lock tables during dump
$backup['REPAIR'] = 0; // Repair & Optimize tables before dump
// Combine Tables into one file
$backup['COMBINE'] = 0;
The first two are self-explanatory: LOCK prevents new data from being added to a tanle while it is being backed up and "REPAIR" checks for and fixes any errors before the backup.
The third combines all of the individual tables into a single SQL file if set to 1; if left at 0, you get separate files for each table in the database.
stejoh
03-18-2007, 03:12 PM
The first two are self-explanatory: LOCK prevents new data from being added to a tanle while it is being backed up and "REPAIR" checks for and fixes any errors before the backup.
The third combines all of the individual tables into a single SQL file if set to 1; if left at 0, you get separate files for each table in the database.
Aha, I understand then!
* It feels "safest to have LOCK and REPAIR set to 1, but is it really so?
* Are there any disadvantages to backup into one single SQL file?
djbaxter
03-18-2007, 03:20 PM
Aha, I understand then!
* It feels "safest to have LOCK and REPAIR set to 1, but is it really so?
I believe it is safer, yes.
* Are there any disadvantages to backup into one single SQL file?
If you are running your own MySQL queries that may have the possibility of messing up one of the tables, it's a good idea to do a backup first. If it's NOT a combined-file backup, it's easier to restore just that single table. Beyond that, it's normally easier to have the backup in one file for restore operations and for disk space reasons.
Paul M
03-18-2007, 08:48 PM
Points to note;
If you lock the tables then your forum will not be usable during a backup.
On larger databases, a repair can take a long time to run.
kontrabass
03-23-2007, 04:04 PM
Points to note;
If you lock the tables then your forum will not be usable during a backup.
On larger databases, a repair can take a long time to run.
Question: I didn't know that *not* locking the tables during a mysqldump was even an option... In your opinion is it relatively safe, provided that my board is OFF, to not lock tables during a dump? If so then this will be better than MysqlHotCopy for me, which locks the whole shebang and results in dropped/timeout connections even when the board is turned off, during a live backup)...
eoc_Jason
03-23-2007, 04:49 PM
Usually if your board is off / closed, the only inserts it will still try to make is for session stuff. Of course your staff needs to know that when the board is closed not to make posts or anything as that could lead to data inconsistencies.
kontrabass
03-23-2007, 05:25 PM
Thanks, that makes sense.
Last question I promise :)
Is this method of backing up recommended on dual-server setups (www + db)? I guess all the backup .sql ends up on the www server..
Paul M
03-23-2007, 10:58 PM
Is this method of backing up recommended on dual-server setups (www + db)? I guess all the backup .sql ends up on the www server..It ends up wherever you point the backup path.
cajunboy2208
03-24-2007, 09:13 AM
I don't think I am having problems. I am just totally confused. I installed it. I have it showing up on my Manage Products. I only changed one line in the mysqlbackupconfig.php, which was where I wanted my backups to go.
As to: Alter the timing of the cron job to suit.
I have no idea how to do that, or where to access it at.
Also I don't know how to access the profuct either, I don't see it anywhere on my ACP.
I would like to set it to where it backs up every day at a certain time, at like 4am if that is possible.
And one more thing... is this like the Database Backup, where it incudes every table and such?
EDIT: Ok, I didn't know it was under Scheduled Task Manager, I was looking in Scheduled Task Log.
I ran it, it ran good, but one thing, I don't want every single line of sql. I would like it to just be one file, just like on the Maintaince Database Backup. How do I go about that?
EDIT x2: Read up, and got my answer.
ONE LAST THING!
I ran the complete back up, and it came to be 12220k using the Task Manager backup.
When using the Maintaince Database Backup, it comes to be 12485k. Anything to be worried about here?
Paul M
03-24-2007, 06:55 PM
I ran the complete back up, and it came to be 12220k using the Task Manager backup.
When using the Maintaince Database Backup, it comes to be 12485k. Anything to be worried about here?Nope, nothing to worry about.
stejoh
03-26-2007, 06:05 AM
It ends up wherever you point the backup path.
I have a question about the backup path in the mysqlbackupconfig.php-file, I could not find the anwser in previous posts:
I currently use this code and it works just fine.
$backup['DUMP_PATH'] = DIR.'/backup/';
The DIR point to "www.domain.org/forum/" and my backups works just fine.
However, I would like to backup to a folder outside the forum-folder. But I have not managed to get the syntax right. Naturally, I created the folder 'backup' on the server before editing the config-file.
I get the following error messgae : An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)
I have tried several alternatives (see below) but none has worked.
$backup['DUMP_PATH'] = 'http://www.domain.org/backup/';
$backup['DUMP_PATH'] = '/www.domain.org/backup/';
$backup['DUMP_PATH'] = '/backup/';
Is it at all possible to make the script to write the backup outside the forum-folder, and if yes,
Paul M
03-26-2007, 11:37 AM
Use '../' to move 'up' a level.
e.g.
$backup['DUMP_PATH'] = '../backup/';
or
$backup['DUMP_PATH'] = '../../backup/';
stejoh
03-26-2007, 11:50 AM
Use '../' to move 'up' a level.
$backup['DUMP_PATH'] = '../backup/';
Thanks for quick help! Worked just perfect! :up:
2meplie
03-28-2007, 11:47 AM
Got this error when trying to run the backup:
Fatal error: Cannot instantiate non-existent class: mysqlbackup in /home/.../public_html/forum/includes/cron/cronbackup.php on line 19
Paul M
03-28-2007, 12:01 PM
Have you uploaded all the files, to the correct place ?
2meplie
03-28-2007, 12:09 PM
Yes
mysqlbackup.php
mysqlbackupconfig.php
in forum/includes
cronbackup.php
in forum/inlcudes/cron
Paul M
03-28-2007, 02:31 PM
Then I have no idea - the class is clearly defined in mysqlbackup.php
Have you edited any of the files ?
hotmasala4u
03-28-2007, 02:38 PM
So This Auto backup ur forums???
can u give me some more details like where it saves and other stuf plz
antiekeradio
03-28-2007, 08:05 PM
the whole thread (5 pages) is about this stuff.
you might want to read before you ask...
PS still have not got it working. figured out that the error message returns an array of possible write locations, separated by colons. Whatever I put into the 'dump to' path, the paths shown in the error message remain the same.
the array is as follows.
Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/my/correctly/set/path/incl/writeable/chmod) is not within the allowed path(s): (/tmp:/home/xirictrl/hosted/www/[my_account_dirs]:/usr/lib/php:/var/xirictrl/hosted/www/[my_account_dirs]) in /includes/mysqlbackup.php on line 225
I don't really think these dirs are hardcoded into the php configuration, so somewhere between php input and file output, things just go wrong...
weird thing is that the adminCP backup function works like a charm. file gets written to the root nicely (mind you, the root is in the array above! perhaps it would work if the cronbackup would try to save the files to my document root?)
Paul M
03-29-2007, 11:38 AM
open_basdir is a php setting that restricts what folders you webserver can write to - you need to speak to your host about that.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.