Log in

View Full Version : Administrative and Maintenance Tools - vB Database Backup Pro (Lite) for vb 3.6


Pages : 1 [2] 3

dfe
03-30-2007, 04:21 AM
What is the preferred method for the most successful VB backups and restores, tables as single files, or all tables in a seperate files?

Installed and working a dream on Win2003 installation!

Paul M
03-30-2007, 10:52 AM
I use seperate files so I can easily restore just one table if necessary. For a full restore you can just join all the files into one.

odie3
03-30-2007, 08:40 PM
Freaking Nice! Thanks for this MOD, I am feeling a lot better with this running daily!

:)

djbaxter
03-30-2007, 10:11 PM
One thing that would be nice would be auto-deletion of backups after a certain length of time.

odie3
03-30-2007, 11:07 PM
agreed! +1 On Auto Delete after certain length of time.

anarx
03-31-2007, 01:11 AM
Hi!
First of all, thank you for the hack and for your great support.

Now to my problem.

I got this error:
Database_Backup

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

The folder with the "date" is built in my backup folder but there is no sql file in it.

santimariani
03-31-2007, 01:52 AM
Help!

I have tried dozens of times to do backups manually, but I get the error that many are getting. What else can I do?

My backups folder is in the root. What I have, then, is something similar to this:

$backup['DUMP_PATH'] = '/home/sub/scxxxx/backups'; // Path to backups folder, with trailing slash

I have chmoded the folder to 777. I have tried disabling and enabling the product again. I have completely uninstalled it, only to install it again. I have moved the folder all over the place, changing the path appropriately, and still nothing. I followed SkyCatcher's suggestions in post 210, and still nothing. What else is there to do?

Thanks SO much! :)

dfe
03-31-2007, 04:52 AM
This morning was the first automated one that happened, all went well, the only problem I had, or am having it did'nt turn the forums back on, I just realised now at 8am that the forums were still turned off after a 5am backup!

How can I check and ensure that does'nt happen again?

Paul M
03-31-2007, 10:50 AM
Help!

I have tried dozens of times to do backups manually, but I get the error that many are getting. What else can I do?

My backups folder is in the root. What I have, then, is something similar to this:

$backup['DUMP_PATH'] = '/home/sub/scxxxx/backups'; // Path to backups folder, with trailing slash

I have chmoded the folder to 777. I have tried disabling and enabling the product again. I have completely uninstalled it, only to install it again. I have moved the folder all over the place, changing the path appropriately, and still nothing. I followed SkyCatcher's suggestions in post 210, and still nothing. What else is there to do?

Thanks SO much! :)
Look at what it says ;

$backup['DUMP_PATH'] = '/home/sub/scxxxx/backups'; // Path to backups folder, with trailing slash
Now look at the path you have entered and correct it. :)

dfe
04-01-2007, 07:29 AM
This morning was the first automated one that happened, all went well, the only problem I had, or am having it did'nt turn the forums back on, I just realised now at 8am that the forums were still turned off after a 5am backup!

How can I check and ensure that does'nt happen again?

Yip 2nd automated backup and I have to manually re-activate the forum using options, again the backup worked like a dream, but left the forum closed until I noticed it.

So this will be a critical issue for me to get solved.

Paul M
04-01-2007, 10:42 AM
The only solution is not to use the option to close the board during backups.

dfe
04-01-2007, 12:04 PM
Ok I will change that, will this be changed soon?

Just had a thought, is it not an option to schedule another task say 30mins later to reopen the forum? How would I do that though?

majorxp
04-03-2007, 07:16 PM
For those who have cron access, you might want to look at AutoMySQLBackup. It backs up all mysql databases and does daily, weekly, and annual cycling on a cron.

(this is still a great tool for those without cron access)

(also...any tool to help automate backups is a great thing....life can become very miserable when you don't have a recent backup)

santimariani
04-04-2007, 05:21 PM
Look at what it says ;


Now look at the path you have entered and correct it. :)

Paul,

Thanks for the help. I am sure you must be beating your head against the wall after having the same question asked time after time. I would do the same! Since I want to be compassionate, let me give you a pillow to put between your head and the wall, because here comes another question!

I changed the path to:

$backup['DUMP_PATH'] = '/home/sub/scxxxx/backups/'; // Path to backups folder, with trailing slash

Yet I am still getting the same error. From reading the posts my understanding of adding the trailing slash is the slash I added at the end. I will reread some posts in the meantime to make sure I am correct in this regard, but if you have some time, I would appreciate your help oncemore.

Thanks again for the help and for your patience. Truly to be admired.

djbaxter
04-04-2007, 05:52 PM
That looks like an incomplete path to me. On most servers, it would be more like:

$backup['DUMP_PATH'] = '/home/{domain}/public_html/{subdirectory}/backup/

Also, make sure that the backup folder is write-enabled.

Paul M
04-04-2007, 06:35 PM
You may be better off using a relative path (e.g. ../../backups/).

Also make sure no open_basedir restrictions are in place, preventing writes to the folder.

odie3
04-04-2007, 07:07 PM
this is what I use:

$backup['DUMP_PATH'] = DIR.'/backups/';

giovannicosta
04-09-2007, 04:21 PM
Works well and forums even open themselves again :D

coffee
04-17-2007, 08:06 AM
Thank you Paul,

This is working great on all my boards ..

Could you please update the $Backup[message] to tell my visitors that "we finished backingup such and such tables out of total of such and such?

Paul M
04-17-2007, 11:33 AM
Sorry, that is not possible.

coffee
04-18-2007, 10:10 AM
No problem Paul ..

You're right .. That might reveal some database secrets to others ..

coffee
04-18-2007, 03:24 PM
Please forgive my ignorance if this was asked:

Will this system recycle every number of times (able to remove older backups it created)?

Or should I add a server-side cron job to do so?

djbaxter
04-18-2007, 03:47 PM
No it doesn't do that but it would be an excellent addition. Post 'em if you got 'em. :)

hoof
04-18-2007, 11:03 PM
Thanks odie3 that worked like a champ!

Great product clicks install :)

beduino
04-27-2007, 10:05 PM
Hello,
i'm sorry if is a very basic question...
I read

I use seperate files so I can easily restore just one table if necessary. For a full restore you can just join all the files into one.

How i can join the sql files?
and...
I can restore by phpmyadmin?

Tks in advance
and all the best

Joao Barroca
aka beduino

beduino
04-28-2007, 02:28 AM
the question of restore by phpmyadmin the answer is yes ;) i already test
the remain question is about join sql files. Or, maybe, a option to backup one sql only...
all the best
and tks again

Paul M
04-28-2007, 09:33 AM
You join them using your OS (e.g. DOS Copy command) or any program designed to join files. The option to backup to one file already exists.

beduino
04-28-2007, 11:18 AM
Sorry,
I see now ...

// Combine Tables into one file
$backup['COMBINE'] = 0;

Tks for your time and support
B.

bollie
04-30-2007, 04:58 PM
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)

djbaxter
04-30-2007, 05:18 PM
That's almost always one of two things:

1. the path to your backup directory is set incorrectly

2. the write permissions for the backup directory are set incorrectly

bollie
04-30-2007, 05:26 PM
For path to backup directory i use file.

<?php echo getcwd(); ?>

$backup['DUMP_PATH'] = '/var/www/vhosts/pctuts.be/httpdocs/forum/backup/';

write permissions backup directory 777

Kihon Kata
05-03-2007, 01:00 PM
Hi Paul,

Can this mod be used for "Repair & Optimize tables" ONLY?

Thanks very much and have a great day

Paul M
05-03-2007, 03:33 PM
Can this mod be used for "Repair & Optimize tables" ONLY?
Nope.

Kihon Kata
05-03-2007, 09:28 PM
Nope.
LOL! thanks for the help ;)

b65ran
05-07-2007, 01:06 AM
Nice hack. What is the cammand to join all the files and restore ?

giovannicosta
05-07-2007, 10:30 AM
Can this get all the files and join them into 1 zip file?

Paul M
05-07-2007, 10:44 AM
Yes & No.

The output can be one file per table OR one file per database (containing all tables).

There is no zip facility.

b65ran
05-07-2007, 09:24 PM
What is the unix command for joing all the tables to one. I tried copy *.sql backup.sql it didn't work in my server. But it works on my laptop. What am I missing here ?

Paul M
05-07-2007, 09:30 PM
No idea, I don't know unix that well.

bandanafz1
05-08-2007, 04:17 PM
Hi all... first post and I wanted to thank Paul and others on the board for their help! :up:

The Autobackup script works like a dream for me and saves me a lot of daily hassle.

I am also a regular on Cable Forum... I have been helped many times there too!

Keep up the good work. :)

Mrdby
05-20-2007, 03:26 PM
Ok i nstalled it..now what?

Mrdby
05-20-2007, 03:30 PM
so don't back up here?

./forumbackup-05-20-07-85412.sql

djbaxter
05-20-2007, 03:31 PM
Ok i nstalled it..now what?

Instead of posting this every time you install a new add-on, may I suggest the following:


read the instructions, readme file, and any help files included with the add-on
read the thread where questions from other users have been posed and addressed
if you still have an unanswered question AFTER completing 1 and 2, ask a SPECIFIC question, not just "now what?" - that question is meaningless, pointless, and irritating

Mrdby
05-20-2007, 03:39 PM
Instead of posting this every time you install a new add-on, may I suggest the following:


read the instructions, readme file, and any help files included with the add-on
read the thread where questions from other users have been posed and addressed
if you still have an unanswered question AFTER completing 1 and 2, ask a SPECIFIC question, not just "now what?" - that question is meaningless, pointless, and irritating


The last part of your comment was uncalled for...we all can't be as smart as you when it comes to these things. Thanks for nothing.

djbaxter
05-20-2007, 03:47 PM
The last part of your comment was uncalled for...we all can't be as smart as you when it comes to these things. Thanks for nothing.

I'm giving you advice, not insulting you. How do you expect anyone to give you an answer to a question like "now what?"? It's not even a real question.

It's like saying, "I've just installed vBulletin. Now what?"... How would YOU answer that question?

Mrdby
05-20-2007, 03:48 PM
I'm giving you advice, not insulting you. How do you expect anyone to give you an answer to a question like "now what?"? It's not even a real question.

It's like saying, "I've just installed vBulletin. Now what?"... How would YOU answer that question?

Again thanks. I will search the forum.

Pure Dope
05-23-2007, 03:33 AM
maybe good to have like a test option so could check if it works n stuff? just a idea. i dont relaly need it i dont guess.

Pure Dope
05-23-2007, 03:42 AM
forums ddont seem to auto turn back on after its done......

Pure Dope
05-23-2007, 03:51 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.

What happened with mine was the page would show the tables being backed up.......but then when it got to my posts table I believe.........it would kinda timeout....and the page would goto a couldnt load page. This is in firefox 2.0.

So after I saw my backup had completed (refreshed in my ftp, and saw the modified datetime didnt change anymore on the sql file -yes im going to change my backup directory later)........so I goes into FF and i reloads the frame. So now what happens is......it deletes my backup and restarts.

My page times out again. So right now Im waiting for this backup to complete again.

Paul M
05-23-2007, 09:54 AM
Why are you manually running the task ?

karel1985
05-23-2007, 10:29 PM
Hello

i have read a lot of pages in this topic but i cant find a solution for my problem:

i have installed this product:

i have set:

$backup['DUMP_PATH'] = '/home/httpd/vhosts/pc-helpforum.be/httpdocs/backups/'; // Path to backups folder, with trailing slash

so when i check if it works (press 'run now') i get the error:
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)

when i check the ftp folder: 'backups', there is a folder 2007-05-24 generated

all maps are 777 cmod

whats wrong?

Paul M
05-23-2007, 11:21 PM
"all maps are 777" What does that mean ?

You shouldn't be storing backups in your httpdocs folder as they will be accessible to anyone.

Pure Dope
05-24-2007, 01:55 AM
Why are you manually running the task ?

To make sure I had everything right. And....I needed to backup so I could install some hacks. Not good to manually run it?

karel1985
05-24-2007, 03:53 AM
"all maps are 777" What does that mean ?

i mean that the folder Backups has write access,

suggestions?

You shouldn't be storing backups in your httpdocs folder as they will be accessible to anyone.

i will change that

Paul M
05-24-2007, 11:10 AM
Not good to manually run it?If you run it manually and it takes a long time then you may hit timeout issues (as indeed you appear to have).

Paul M
05-24-2007, 11:11 AM
suggestions?
Use a relative path in the setting (i.e. ../backups or ../../backups).

karel1985
05-24-2007, 12:05 PM
i can't see to get it work

the fulle path is /home/httpd/vhosts/pc-helpforum.be/httpdocs

my forums are directly in the httdocs folder

so the map includes is: /home/httpd/vhosts/pc-helpforum.be/httpdocs/includes

i have create the map backups in /home/httpd/vhosts/pc-helpforum.be/httpdocs/backups

so i have set it:

$backup['DUMP_PATH'] = '../backups/'; // Path to backups folder, with trailing slash

also tried

$backup['DUMP_PATH'] = '../../backups/'; // Path to backups folder, with trailing slash

suggestions:
sorry because i don't got it work

Paul M
05-24-2007, 07:27 PM
Sorry, there is nothing I can do about permission issues with your server, which is what you have here.

karel1985
05-25-2007, 09:06 AM
Sorry, there is nothing I can do about permission issues with your server, which is what you have here.

Do u think?

I can use the backup feature thats included in vb standard - that works very good
but now its not working, weird :-)

Paul M
05-25-2007, 11:23 AM
Do u think?

Yes, the error you listed tells you that ;

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

That means the webserver did not have write permissions to create the file.

karel1985
05-25-2007, 09:12 PM
Hi Paul,

i found what the problem was :D

my server was running in Safe Mode,
i've mailed my Hosting company and they putted it off,

now it works like a charm :-)

thanks for the support !

karel

Pure Dope
05-30-2007, 09:47 AM
Hm.....well the forum doesnt come back on. Same prob that other guy is having. I have yet to attempt to imiport the database to see if I get any errors, but it looks as if it got backed up ok. I see the whole big 2GB file right there.

Ill let you know what I find, if I find anything. Im not real good at this linux stuff.

Pure Dope
06-02-2007, 09:44 AM
Hm....yeah Im not understanding why it doesnt turn the forum back on. I let it go with the option to not turn off forum and to lock tables. My site comes unavailable for about 30 minutes......but.....the backup seems to go fine...and the site comes back up fine too.

:shrugs:

Paul M
06-05-2007, 10:39 PM
If you lock the tables then the site will be unavailable as vb will be unable to perform any database updates.

Deimos
06-07-2007, 06:18 PM
Love this hack, works very well
Just a question, has anyone managed to add FTP functionality to it?
I have a remote storage space account, which I use for offsite file backups, so having the database ftp'd to another server, would be awesome

santimariani
06-10-2007, 01:42 AM
I am getting the following error now:

Warning: is_file() [function.is-file]: Stat failed for /home/username/backups/06-09-2007 (errno=13 - Permission denied) in /includes/mysqlbackup.php on line 225

Warning: is_dir() [function.is-dir]: Stat failed for /home/username/backups/06-09-2007 (errno=13 - Permission denied) in /includes/mysqlbackup.php on line 260

Warning: is_dir() [function.is-dir]: Stat failed for /home/username/backups/06-09-2007 (errno=13 - Permission denied) in /includes/mysqlbackup.php on line 271
An error occured during the MySQL backup. Details (Could not open Destination SQL file for writing.)

I have not seen these errors anywhere in this thread (except for the "error occured during.." one). Any thoughts? Thanks in advance.

djbaxter
06-10-2007, 01:49 AM
My first guess would be the directory is write-protected, i.e., you have to set the permissions to 777 or 666.

Frozen Tears
06-10-2007, 05:52 AM
Am.....

MAZING!

santimariani
06-10-2007, 02:59 PM
My first guess would be the directory is write-protected, i.e., you have to set the permissions to 777 or 666.

After months of trying, it finally works! Yes! Thank you!

Ah, how amazing it is to finally have a good host. :)

Deimos
06-11-2007, 09:26 PM
I got a php friend of mine to modify this to send the backups to a remote server
Would it be ok to post the modifications here?

Paul M
06-11-2007, 09:56 PM
Yes, you may post them in this thread.

Mecho
06-12-2007, 03:07 PM
Thanks .. works like a charm in vb 3.6.7 PL1 .

just 2 questions :

1 - it took a backup Table by Table . i mean it gave me many files not just one .SQL file , is it right ?

2 - for the next day is it anyway that new backup will save and overwrite to last one ??

Thanks

Paul M
06-12-2007, 03:23 PM
1. By default yes - you can change that in the config file.

2. No, each backup is kept (they are dated).

Deimos
06-12-2007, 03:27 PM
Because I do more than one backup a day, I changed the file saving format, so it saves it by year/month/day/hour/minute

So in mysqlbackupconfig.php, on the line which reads..

$backup['DATE']

I changed it to

$backup['DATE'] = 'Y-m-d-G-i'; // Backup file date format

To add remote server backup ability, my coder added this in the mysqlbackup.php file

Below this:

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


Add this:


/* ------------- Remote FTP backup - added 6.11.07 ------ */

//If you want to move or replicate the folder hierarchy from your current server to another remote server. Then this will be helpful as this will browse the current server's directory and at the same time it will copy that file in the remote server in the same directory.

//This script will copy all the files from this directory and subdirectory to another remote server via FTP
// Source: http://us2.php.net/ftp

function remoteBackup() {

function rec_copy ($source_path, $destination_path, $con)
{
ftp_mkdir($con, $destination_path);
ftp_site($con, 'CHMOD 0777 '.$destination_path);
ftp_chdir($con,$destination_path);

if (is_dir($source_path))
{
chdir($source_path);
$handle=opendir('.');
while (($file = readdir($handle))!==false)
{
if (($file != ".") && ($file != ".."))
{
if (is_dir($file))
{
// choose only the current backup folder
if($file != "propertyimages")
{
rec_copy ($source_path."/".$file, $file, $con);
chdir($source_path);
ftp_cdup($con);
}
}
if (is_file($file))
{
$fp = fopen($file,"r");
// this will convert spaces to '_' so that it will not throw error. -- VK
ftp_fput ($con, str_replace(" ", "_", $file), $fp,FTP_BINARY);
ftp_site($con, 'CHMOD 0755 '.str_replace(" ", "_", $file));
}
}
}
closedir($handle);
}
}

// make a FTP connection********************************** ADAM CHANGE THESE 2 LINES ************************************************** *******************************
$con = ftp_connect("XX.XX.XX.XX",21);
$login_result = ftp_login($con,"USERNAME","PASSWORD");

// this is the root path for the remote server ********************
$rootpath = "/";

// this is the physical path of the source directory. actually u can also use the relative path. -- VK
$sourcepath = realpath("/XXXX/XXXX/XXXX");

// this directory name will only change the top most directory and not the inner one -- VK
$destination_dir_name = "XXXX/";

rec_copy ($sourcepath, $destination_dir_name, $con);
if (function_exists("ftp_close"))
{
ftp_close($con);
}

}
/* -------------- END FTP Remote Backup ----------------------*/


You need to change the "USERNAME" and "PASSWORD" bit
Additionally, you need to set the correct IP/hostname and the paths.

So far for me, it's working a treat
I've got it running every 3 hours to backup my database, gzip it, then ftp it to the server.

Note: You will get a warning when the backup completes that the destination directory already exists
I haven't fixed that bit yet

BadgerDog
06-13-2007, 02:29 PM
Ok, installed... I install all of Paul's mods... really nice programming... :)

Set it for 4:00am EST daily as I don't think there's a lot of folks up around those times, at least in North America.... ;)

Did a "Run Now" and it completed successfully..... :up:

It created a nicely dated backup directory of files in a safe area...

Thanks Paul... I'll sleep better knowing I'm no more than 24 hours out of date if I have a systems failure that needs recovery.

Regards,
Badger

Chadi
06-14-2007, 03:03 AM
Getting this error:

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

Does it have to do with this?

$backup['COMMAND'] = 'exec'; // exec, system or passthru

I have exec disabled in php functions for security. Is there a workaround?

Paul M
06-14-2007, 07:02 AM
If you have exec disabled then all you can do is try the other two (system,passthru). ATM you have disabled the mods ability to create/modify/delete files & folders so it obviously isn't going to work (tbh, disabling exec seems a bit of overkill to me).

Chadi
06-14-2007, 10:48 AM
I'm stilling getting the same error even after enabling exec

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


My config file for the mod is:

<?php

/*
Auto-Backup for vb 3.6 - Paul M - v 2.12
This version is adapted from the original vb 3.0 Hack by Trigunflame.
*/

// Forum Shutdown System
$backup['SHUTDOWN'] = 1;
$backup['MESSAGE'] = "The Forum is closed because a database backup is in progress.";

// File Saving Information
$backup['DATE'] = 'Y-m-d'; // Backup file date format
$backup['PREFIX'] = 'Live-'; // Backup file prefix
$backup['DUMP_PATH'] = '/private/'; // Path to backups folder, with trailing slash

// Backup Options
$backup['LOCK'] = 0; // Lock tables during dump
$backup['REPAIR'] = 0; // Repair & Optimize tables before dump

// Backup Type To Use
$backup['TYPE'] = 2; // 1 = Only specified tables, 2 = All except specified tables
$backup['TABLES'] = array(); // Table List - e.g. array('table1', 'table2')

// Combine Tables into one file
$backup['COMBINE'] = 0;

// Backup Optimizations
$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4
$backup['INNODB'] = 0; // Set to 1 if you have Innodb Tables
$backup['LOCKTABLES'] = 0; // Adds Lock commands to the backup file

// Execution Function
$backup['COMMAND'] = 'exec'; // exec, system or passthru

?>

djbaxter
06-14-2007, 11:21 AM
The majority of those "Could not open Destination SQL file for writing" errors are due to permissions being incorrectly set for the destination folder and/or an incorrect path to the destination folder.

Paul M
06-14-2007, 11:29 AM
I doubt that path is correct, unless you have a folder called private on the root of your server.

Chadi
06-14-2007, 04:59 PM
I'm still getting the same error even after setting the path in full (/home/username/public_html/foldername) and permissions to 755.

djbaxter
06-14-2007, 05:34 PM
I'm still getting the same error even after setting the path in full (/home/username/public_html/foldername) and permissions to 755.

1. check with your host - that may not be the correct path

2. the permissions must be 777, NOT 755

Paul M
06-14-2007, 05:50 PM
Also check that you don't have any open_basdir restrictions in php stopping you.

Chadi
06-14-2007, 07:46 PM
I do not have that enabled and I followed everything.

What else could be the problem?

Paul M
06-14-2007, 08:40 PM
No idea, you have a permission problem on your server somewhere, there is not much we can tell you. I would suggest speaking to your host.

djbaxter
06-15-2007, 12:57 AM
I do not have that enabled and I followed everything.

What else could be the problem?

See above.

1. If you entered the path exactly as you posted here, it is almost certainly wrong.

2. If you set the permissions to 755, the directory is NOT write-enabled and this add-on will not work. It must be set to 777.

Chadi
06-15-2007, 03:33 PM
Thanks. Out of curiosity is there a swift and rather convenient way to restore the databases (or certain portions) via admincp?

I see the sql files are done per table, which is great but what is the proper way to restore these, aside phpmyadmin?

BadgerDog
06-15-2007, 07:01 PM
Thanks. Out of curiosity is there a swift and rather convenient way to restore the databases (or certain portions) via admincp?

I see the sql files are done per table, which is great but what is the proper way to restore these, aside phpmyadmin?

It would be great to have a mod (or instructions) on how to restore what has been backed up with this mod.... :up:

Regards,
Badger

santimariani
06-21-2007, 07:02 PM
So after changing my host, I was finally able to get this mod to work. Horrah! However, I found something peculiar...

The backup is happening randomly during the day, even though I set it up for it to happen at 4:00 in the morning. I noticed it today when using my forum at around 12:00 pm and noticing that a backup was in progress. Here are the times that the backup folders were created:

06-16-2007 19:05
06-17-2007 15:32
06-18-2007 11:23
06-19-2007 12:40
06-20-2007 11:19
06-21-2007 9:10

Any ideas? Thanks in advance.

Paul M
06-21-2007, 07:49 PM
You're not getting enough visitors to trigger all your cron jobs.

santimariani
06-21-2007, 10:10 PM
You're not getting enough visitors to trigger all your cron jobs.

Paul,

Could you elaborate a bit further or point me to a topic that does? I did not know that I needed visitors to trigger cron jobs. How many visitors do I need?

Mecho
06-22-2007, 12:04 PM
1. By default yes - you can change that in the config file.



Would u plz tell me how can i set the Config file to get just a one .SQL backup file, instead of table by table ...

also what is ur suggestion ?? which one is better ( 1 file or table by table ) ?

Thanks in Advance

princeedward
06-22-2007, 12:04 PM
thanks for this....it might very useful or help for me.....wonderful mod....million thanks...;)

Paul M
06-22-2007, 04:13 PM
Would u plz tell me how can i set the Config file to get just a one .SQL backup file, instead of table by table ...

Why not read the config file, since it tells you.

also what is ur suggestion ?? which one is better ( 1 file or table by table ) ?

Neither is really better, it's personal choice and dependant on how you intend to use them.

I did not know that I needed visitors to trigger cron jobs. How many visitors do I need?


http://www.vbulletin.com/docs/html/main/scheduled_tasks_intro

santimariani
06-23-2007, 10:00 PM
Paul,

Thanks for the help. I now realize I should set up the task at a time when I will actually have some users, and not when I don't expect there to be any.

Chadi
06-24-2007, 04:47 PM
Thanks. Out of curiosity is there a swift and rather convenient way to restore the databases (or certain portions) via admincp?

I see the sql files are done per table, which is great but what is the proper way to restore these, aside phpmyadmin?

Just curious if you plan on adding this feature. Thanks Paul.

BadgerDog
06-24-2007, 05:05 PM
Just curious if you plan on adding this feature. Thanks Paul.

I second that.... :up:

Beautifully written to back us up, but I'd live to be able to do a general restore in case of crisis as easily. I know nothing about tables etc, s it would sure help to be able to do this for laymen like me.

Thanks for your work Paul.... :)

Always appreciated....

Regards,
Badger

Paul M
06-24-2007, 06:00 PM
I think this line in the main post covers your question :)

Notes:
* I will not add anything new to this, or spend vast amounts of time supporting it.

Evaporate
07-04-2007, 08:50 PM
I think this line in the main post covers your question :)

Beats me why this sort of stuff isn't default. I converted from SMF (sorry for swearing, which generally was rubbish compared to VB) . However from the admin panel I could one click bakcup or restore. Brilliant really. I want admins to be able to backup in my abscence but don;t want to give them access to my ISP cpanel etc.

This should really be out of the box stuff. Please please incorporate this sort of feature natively.

Pure Dope
07-08-2007, 07:56 AM
Doing a test restore.....

root@www1 [/home/allsexre/backups/2007-07-08]# mysql -umyun -pmypw mydb < Live-2007-07-08-full-backup.sql
ERROR 1064 (42000) at line 24395714: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1812' at line 1
root@www1 [/home/allsexre/backups/2007-07-08]#

Anyone maybe know why? Is there a different way I could import this db?

Paul M
07-08-2007, 05:12 PM
Once you are connected to mysql in SSH ;

use mydatabase

then

source Live-2007-07-08-full-backup.sql

Mecho
07-10-2007, 05:15 PM
Paul i couldnt find how can i make database as a just one file . i read config file but i couldnt find it . would u plz tell me what exactly i have to do for make backup just one file ??

thanks

McCarroll21
07-10-2007, 05:23 PM
Paul i couldnt find how can i make database as a just one file . i read config file but i couldnt find it . would u plz tell me what exactly i have to do for make backup just one file ??

thanks
In the mysqlbackupconfig.php file, change this:
$backup['COMBINE'] = 0; to this: $backup['COMBINE'] = 1;

Paul M
07-10-2007, 09:49 PM
Paul i couldnt find how can i make database as a just one file . i read config file but i couldnt find it . would u plz tell me what exactly i have to do for make backup just one file ??

You read the whole config file ?

The comment for the setting seems obvious to me - please can you explain why it isn't - because you're not the first person to ask, and I really don't understand why.

// Combine Tables into one file
$backup['COMBINE'] = 0;

Mecho
07-11-2007, 12:14 PM
yea u right . maybe the reason was my bad English or ..

thanks anyway for ur help

BadgerDog
07-11-2007, 10:09 PM
Anyone?

I've been backing up religiously using this mod, then manually deleting any backups that were older than 7 days. I've been using "Combine=0" and ending up with many many files.

What would be the advantage (if any) to going to a single file backup with "Combine=1"?

Second, is there a web site, or anywhere I can go to learn how I would restore my database, in either form?

Thanks

Regards,
Badger

Paul M
07-12-2007, 07:39 AM
The advantage of single files is you can restore a single table if required. The disadvantage is you need to join them if you want to restore everything in one go. It's personal choice.

Distance
07-12-2007, 07:50 AM
You should add how to combine the files in your first post Paul :)

Distance

Paul M
07-12-2007, 11:20 AM
You should add how to combine the files in your first post Paul :)That's entirely dependant on your OS - and I draw the line at teaching people how to use their Operating System. :)

Zidane007nl
07-12-2007, 03:03 PM
Thanks for releasing this mod. It works like a charm.

BadgerDog
07-12-2007, 05:08 PM
The advantage of single files is you can restore a single table if required. The disadvantage is you need to join them if you want to restore everything in one go. It's personal choice.

Thanks Paul.... :)

Yup, for the first time last night, I set the config to do one file and that's what I got. One humungous single file for restore, if I ever needed it. :D

Regards,
Badger

Fireproof
07-20-2007, 01:35 AM
Holy cow - worked the first try!! Awesome mod - thank you very much!!

Cyricx
07-26-2007, 07:45 PM
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.)

You likely need to chmod the destination directory to 777.

Make sure you set up your settings in the config file for the mod :)



Great hack!!! Love it!! Really helps out when my host doesn't always give me the best SSH access :mad:

Deimos
07-27-2007, 05:42 PM
Has anyone figured out how to put a conditional in, to delete backups which pass a certain age? like 7 days or something?

BadgerDog
07-27-2007, 06:05 PM
Has anyone figured out how to put a conditional in, to delete backups which pass a certain age? like 7 days or something?

I second that.... :up:

It would be very useful... a rolling 7 days of backups as an example...

Regards,
Badger

David Lama
08-01-2007, 04:32 AM
this may be a dumb question.. but where on my server should i put the files in the includes folder?

twilighthush
08-02-2007, 01:10 AM
Destination folder is chmodded to 0777, however I'm still getting the error:

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

I changed the path to: /home/users/public_html/forum/[foldernamehere]

It is a password locked folder -- from the outside. But it shouldn't affect backup, because I know I can manually back up via AdminCP. Please advise.

Deimos
08-02-2007, 01:15 AM
I second that.... :up:

It would be very useful... a rolling 7 days of backups as an example...

Regards,
Badger

I'm having a friend of mine program it in, so once she's done it, I'll post the modified/added code here.

twilighthush
08-02-2007, 01:35 AM
Edited path to root forum so it reads like:

$backup['DUMP_PATH'] = '/home/users/cabbage/'; // Path to backups folder, with trailing slash

and chmodded the folder to 777.

Still not working. Any ideas?

philip_g
08-05-2007, 02:28 PM
Edited path to root forum so it reads like:

$backup['DUMP_PATH'] = '/home/users/cabbage/'; // Path to backups folder, with trailing slash

and chmodded the folder to 777.

Still not working. Any ideas?

dunno, mine would only work correctly without the trailing / but then wouldn't actually write the file. I gave up lol

Paul M
08-05-2007, 02:32 PM
Some hosting systems (Plesk being an example) have default open_basdir settings that prevent the webserver writing to any files outside the domains root html folder. You have to check/change them.

jazz_aaf
08-06-2007, 11:32 AM
the script stops after the largest table in database. How to overcome this?

thanks

kenfuzed
08-08-2007, 06:15 PM
This may be unrelated to the backup itself, but right after this runs each morning my db/site seems to be having trouble restarting correctly. This doesn't happen every time but lately has occurred several times per week. Only the forumhome page starts correctly but all other pages have errors and won't display their content (just lines of errors). When I go in and turn vB off then back on, all pages display correctly. The errors occur right after the backup completes. Is there a command I could add to the end of the backup config file that would perform this restart procedure after the backup is completed?

raiderlax
08-08-2007, 06:20 PM
How big of a database can this backup?

Thanks :)

Paul M
08-08-2007, 07:20 PM
There is no limit other than what your server can handle.

raiderlax
08-08-2007, 07:24 PM
Okay thanks, but I am somewhat confused. Their is the option of SSH backup and that can do big database backups, now with this one isn't it a script and could it "time out" on big databases?

I am somewhat new to database backups and don't fully understand them, so say my database is 500mb , this can back it up without timing out and would do a FULL backup?,

now what do you mean "other than your server can handle"???

Sorry for all the questions, I truly appreciate the help :)

cjddrum1
08-08-2007, 07:49 PM
I have a question, this may sound stupid however:

the backup isnt just 1 sql file, say I wanted to restore the database, would I have to load each .sql file that this backup saved?

Say I had a database error, how would I go about restoring the database?

sorry just trying to figure out how to use this since im used to the 1 .sql file

raiderlax
08-09-2007, 12:45 AM
When this backs up it put the sql into seperate files and not into a zip or something, how would I re-upload the database now???

Thanks :)

Paul M
08-09-2007, 12:14 PM
As per the many previous posts on the subject, you have the choice to backup to a single file if you wish.

raiderlax
08-09-2007, 01:45 PM
As per the many previous posts on the subject, you have the choice to backup to a single file if you wish.


Sorry found out how to do it now, wow!, this backs up the database so fast, how come it is this fast, it took like 3 seconds to do a backup, whereas I used another script and it took like 1 minute.

I downloaded the backup file and it was 15 mb, now is this too large for a database?

Now sorry but I have to ask this, how would I go about restoring the database from this 1 file?, please I need to know this.

Thanks :)

BadgerDog
08-10-2007, 12:15 PM
Hi Paul.... :)

I assume since my Client API version says it's 5.0.24a, I should change this option below to "0"?

// Backup Optimizations
$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4

Thanks

Regards,
Badger

kenfuzed
08-10-2007, 02:16 PM
I posted this question a couple days ago but now I have the actual error to go with it.
Warning: preg_replace() [function.preg-replace]: Compilation failed: regular expression too large at offset 65539 in /includes/functions.php on line 555This error line repeats itself 50+ times down each forum page before the actual content is shown. This only occurs right after running the backup job, but not every time which is making it difficult to track down. It is cleared by toggling the forum off/on.

Here is my original question:
This may be unrelated to the backup itself, but right after this runs each morning my db/site seems to be having trouble restarting correctly. This doesn't happen every time but lately has occurred several times per week. Only the forumhome page starts correctly but all other pages have errors and won't display their content (just lines of errors). When I go in and turn vB off then back on, all pages display correctly. The errors occur right after the backup completes. Is there a command I could add to the end of the backup config file that would perform this restart procedure after the backup is completed?

Paul M
08-10-2007, 07:38 PM
I would guess there is some problem with the vboptions not being saved properly when the board is turned off/on by the mod.

I would just turn that option off in the config file (I don't use it).

(set $backup['SHUTDOWN'] = 0)

BadgerDog
08-10-2007, 11:42 PM
I would guess there is some problem with the vboptions not being saved properly when the board is turned off/on by the mod.

I would just turn that option off in the config file (I don't use it).


(set $backup['SHUTDOWN'] = 0)

Hi Paul.... :)

Question on a different option setting ...

I assume since my Client API version says it's 5.0.24a, I should change this option below to "0"?

// Backup Optimizations
$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4

Thanks

Regards,
Badger

Paul M
08-10-2007, 11:58 PM
It's actually an option for mysql4 or above, so you can leave it set to 1.

raiderlax
08-11-2007, 05:21 AM
I really don't recommend people to install this, I know it royally screwed my site up, thank goodness for backups!

Deimos
08-11-2007, 05:29 AM
I really don't recommend people to install this, I know it royally screwed my site up, thank goodness for backups!

How so? Works fine for me.

Paul M
08-11-2007, 04:17 PM
I really don't recommend people to install this, I know it royally screwed my site up, thank goodness for backups!
I suggest you provide some solid proof to backup this claim.

raiderlax
08-11-2007, 07:00 PM
I suggest you provide some solid proof to backup this claim.

You are right, I should provide solid proof of this, but I have already re-stored my site and am not going to re-install this mod to prove this, in fact I didn't really have to re-store the site, I could have just uninstalled the mod and things would have been fine, I just didn't know at first it was this mod that caused the problems on the site.

Some problems were header links missing and a lot of functionality missing on the site.

So now I will spend some time fixing up the site only because I had previous mods installed that have got messed up from re-storing the site, but if you do have problems like ones I have mention uninstall this mod to see if it is it(in my case it was) and do not go ahead and restore all your forum files like I had done :(

Other than that I like the idea of the mod and the way it was working until these problems arose.

da420
08-11-2007, 07:13 PM
I've had this installed since back in October when it was first released without any problems whatsoever.

Paul M
08-12-2007, 10:44 AM
The only time this modification can actually change anything on a site is if you use the 'shutdown' option to close your forum during a backup, in theory if the save of the options failed for some bizarre reason then the options in the datastore could get corrupted (simply editing an option would rebuild them I think).

Other than that, this has no capability to change anything, it's a "read only" modification.

Given that the basic code (written by Trigunflame) has been in use for over two years without any other such reports, I'm inclined to conclude that something else caused your issue. If you have evidence otherwise then please feel free to contact me.

(JFYI, This runs a backup on my site every night, and has done since the day 3.6 was released. I do not use the shutdown option.)

philip_g
08-12-2007, 01:01 PM
I don't understand why the generated backup file is 53 megs when the file if I do a backup through SSH is 130 megs.

beishe8
08-13-2007, 07:07 AM
I don't understand why the generated backup file is 53 megs when the file if I do a backup through SSH is 130 megs.
It is not saving your whole database, some of your tables are too large for it.
Times out incompleted,the forum stays locked.Locking and unlocking is the only way to start functioning again.
I installed it but cannot use it . It stops around 10 MB. (There is a large table which stops it.)
Tried to save the result to the server,same result.

Deimos
08-13-2007, 07:13 AM
I only have problems if the PHP Memory Limit is left at default.
I have to raise it to about 100mb then it runs fine, otherwise i get an error about the memory being exausted.

Paul M
08-13-2007, 10:59 AM
For reference, our server PHP limit is 32MB, and SQL packet Size is 16MB.

Our largest table (post) is about 550MB, and it backs up fine.

Smoothie
08-14-2007, 01:51 AM
You are right, I should provide solid proof of this, but I have already re-stored my site and am not going to re-install this mod to prove this, in fact I didn't really have to re-store the site, I could have just uninstalled the mod and things would have been fine, I just didn't know at first it was this mod that caused the problems on the site.

Some problems were header links missing and a lot of functionality missing on the site.

So now I will spend some time fixing up the site only because I had previous mods installed that have got messed up from re-storing the site, but if you do have problems like ones I have mention uninstall this mod to see if it is it(in my case it was) and do not go ahead and restore all your forum files like I had done :(

Other than that I like the idea of the mod and the way it was working until these problems arose.I can confirm this on my site. Header links all farked-up. When I remove the product, it's back to normal. Uninstalled!!!!

Paul M
08-14-2007, 06:59 AM
I can confirm this on my site. Header links all farked-up. When I remove the product, it's back to normal. Uninstalled!!!!
1. What does "Header links all farked-up" mean exactly ?

2. As per previous posts, did you use the 'shutdown' option.

philip_g
08-14-2007, 12:17 PM
For reference, our server PHP limit is 32MB, and SQL packet Size is 16MB.

Our largest table (post) is about 550MB, and it backs up fine.

my PHP is set to 64 and the SQL also set to 16. It seems to end processing the post column.


Server Type Linux
Safe Mode
Web Server Apache v2.2.3
PHP 5.1.6
PHP Max Post Size 8.00 MB
PHP Maximum Upload Size 16.00 MB
PHP Memory Limit 64.00 MB
MySQL Version 5.0.27
MySQL Packet Size 16.00 MB

Any ideas?

Paul M
08-14-2007, 08:15 PM
Turn off safe mode, I have a feeling that you cannot override the default php timeout in safemode, so the script is possibly timing out.

Smoothie
08-16-2007, 02:16 AM
1. What does "Header links all farked-up" mean exactly ?

2. As per previous posts, did you use the 'shutdown' option.

1. Meaning the links I have in the header (moved from the navbar, custom skin) were all messed-up. The Quick Links turned into a link for the buddy list, the login link no longer worked (it re-directed you to the forum index), the Mark forums read link suddenly appeared in the header and the New post link directed you to the style id of the skin you were using. Very odd stuff.

2. Yes

philip_g
08-25-2007, 02:35 PM
Turn off safe mode, I have a feeling that you cannot override the default php timeout in safemode, so the script is possibly timing out.

Yep. Working now and backing up a full 400 megs.

slowphantom
08-31-2007, 02:11 PM
thx Paul good idee
but i have somthing not right

i make evry thing
and its wreit empty folder
nothing on it
i see the folder 2007-08-31
but its empty
can u help me pls
thx

rainyleaves
09-01-2007, 06:44 AM
I set backup schedule task time AM:6.
But backup time is not correct when it's run PM:1 or PM:8 etc...
How can I fix?
Please help...

Thanks. :)

Paul M
09-01-2007, 02:34 PM
thx Paul good idee
but i have somthing not right

i make evry thing
and its wreit empty folder
nothing on it
i see the folder 2007-08-31
but its empty
can u help me pls
thx
Either it didn't run or you have a folder/files writing permissions error, most likely the second.

I set backup schedule task time AM:6.
But backup time is not correct when it's run PM:1 or PM:8 etc...
How can I fix?
Please help...
If you are having trouble with cron jobs then you need to ask on vbulletin.com as that's a standard part of vbulletin.

rainyleaves
09-01-2007, 05:28 PM
Thanks, Paul.

Dream
09-02-2007, 09:02 AM
I'm running mysql 5, should I set this to 0

$backup['MYSQL4'] = 1; // Set to 1 if you are using MySQL4

Also, to make just one dump and not one for each table, should I set this to 1

$backup['COMBINE'] = 0;

And will this delete old backups?

edit-
I just tested it with combine both on and off and figured it out.

Also I read about the mysql option being for mysql 4 and up, so I leave it as 1? Or would 0 or other value be better for Mysql 5?

Thanks for this mod, I had it on vb 3.0 and it didn't work for ages. I still had the scheduled task there, and the files. And I think the task was enabled.

Paul M
09-02-2007, 09:38 AM
Set it to 1 on mysql4 and above.

Nothing in this mod deletes old backups, unless you run two backups on the same day.

Dream
09-03-2007, 01:10 AM
Ok thank you.

djbaxter
09-03-2007, 01:29 AM
Set it to 1 on mysql4 and above.

Nothing in this mod deletes old backups, unless you run two backups on the same day.

Although, as others have mentioned, that would be an excellent addition to this add-on... deleting old backups after the new one is created or after a certain length of time (e.g., keep only the last 3 days or 7 days).

jazz_aaf
09-04-2007, 11:23 PM
Is there a way to divide the backup job into several jobs, each one of those jobs backs up certain tables of the database?

I am not able to backup a large database because of large tables.

Deimos
09-06-2007, 12:27 AM
This is the out of memory message I get

Creating gzip file from SQL file

Fatal error: Out of memory (allocated 5242880) (tried to allocate 206317869 bytes) in /home/xxxxx/public_html/includes/mysqlbackup.php on line 534

Forgot to add, I had the memory limit set to 500mb and it did this
so I don't know what to do

StarBuG
09-28-2007, 06:54 AM
Hi

Is there a way to have the script make 2 backups each day?
How would I do that?

I have lost 2 days of my forum a while back because the backup was done a short while after my database got corrupt.
To prevent that I really would like to have 2 Backups each day.

Any chance for that?

Thanks in advance

StarBuG

Deimos
09-28-2007, 07:02 AM
Can someone tell me why I keep getting that out of memory message?
I still can't do regular backups because of it

Fatal error: Out of memory (allocated 5242880) (tried to allocate 208268833 bytes) in

Paul M
09-28-2007, 07:06 PM
No idea, there is no gzip facility in this modification.

Paul M
09-28-2007, 07:09 PM
Hi

Is there a way to have the script make 2 backups each day?
How would I do that?

I have lost 2 days of my forum a while back because the backup was done a short while after my database got corrupt.
To prevent that I really would like to have 2 Backups each day.

Any chance for that?

Thanks in advance

StarBuG

AFAIK, you cannot run one vb cron job just twice a day - you would need to create a second cron job to run at the hour you want.

You also need to change the config file to include the hour in the file name, otherwise one backup will overwrite the other.

StarBuG
10-03-2007, 09:59 AM
AFAIK, you cannot run one vb cron job just twice a day - you would need to create a second cron job to run at the hour you want.

You also need to change the config file to include the hour in the file name, otherwise one backup will overwrite the other.

I know that, but how do I add the hour into the filename in the config?
I am not a php programmer ;)

Paul M
10-03-2007, 10:14 AM
Edit the backup date config line ;

$backup['DATE'] = 'Y-m-d'; // Backup file date format

The format of the letters is here (http://uk3.php.net/date).

StarBuG
10-03-2007, 10:55 AM
This adds the time to the folder as well

I rather would like to have the time added to the filename only so that I have one folder per day with X numbers of backups inside it.
How would I go for that?

Paul M
10-03-2007, 12:03 PM
You cannot, there is no seperate setting for that.

StarBuG
10-03-2007, 12:47 PM
But wouldn't that be possible by editing the mysqlbackup.php file?
The name is generated there, isn't it?
I don't mind having it hardcoded and not as a config setting.

DiverTree
10-08-2007, 12:26 AM
Whoohoo!!! i got it. lol.

where do you guys recomend that i put the backup file?

should i put it in a file at the same level (pardon my teminology) as the public_html file?
in the public_html file?
in a folder in the public_html file?

where would it be most secure?

i even added revens bit of code to get it in a zip file. :cool:
thanks paul, thanks reven :)
i would love to add revens coding to save it on an outside ftp, if i could get some help figuring out the filepaths. i read through this mod atleast three times but all the different filepath discriptions has got me all scared. :( lol

Paul M
10-08-2007, 01:12 AM
Always save backups outside of the public_html, you don't want people to be able to access them.

DiverTree
10-08-2007, 01:25 AM
Always save backups outside of the public_html, you don't want people to be able to access them.gotcha ;) you da man
i thought i had marked this mod installed ... but i didnt. got it now. :) thanks again

aggiefan
10-08-2007, 06:39 PM
i went back a couple of pages to see if this was addressed but we run under windows server 2003 and apache/php. When I point the directory to the C: drive it backs up fine but we have a share drive that is run by our hosting company which we currently use to do backups since its off the server completly. But there is a permission issue writing the file there (it gives a permission error). im guessing apache/php has a user account which needs access but have no idea what it is.... was wondering if anybody could help.

and the section question.... what we really want is a single file that is created and it is overwritten every night. Is there anyway to have a single file that just gets overwritten or updated every night? (IE if i take out the date part would that do it).

Paul M
10-08-2007, 07:03 PM
I would imagine that if you did a default install of apache on W2000 then it's running under the system account so will not be able to access shared drives - you would need to create a dedicated user account, change the service to use that account, and go from there.

Mecho
10-10-2007, 09:54 AM
yesterday my database Was CRASHED !! Thanks this mod that i had a backup :)

thanks again Paul M

melbo
10-19-2007, 01:41 AM
woOT. Test backup worked flawlessly. Hopefully we'll see tonight a fresh backup.
I think that many of these problems are based on a bad path if one is trying to place the backup folder outside of public_html.

StarBuG
10-19-2007, 08:57 AM
@Paul

Can you please help me with the filename.
I really need multiple backups but I don't want each backup in its own folder instead I would like to have one folder per day containing multiple backup files.

Help would greatly be appreciated.

Thanks

StarBuG

z0diac
10-20-2007, 02:03 PM
This doesn't seem to do anything. I went to scheduled tasks to manually run the job, and it just cleared the box and said "Database Backup" at the top.

I shelled in and went to the location I selected it to store at... no file.

Oops, ok, it seems you can't get out of your forum root directory. I select /dir2 which is from my hard drive root, and it put it in my forum root (my forum is still a few subdirs deep below dir2).

Paul M
10-20-2007, 04:29 PM
@Paul
....
I really need multiple backups but I don't want each backup in its own folder instead I would like to have one folder per day containing multiple backup files.


Sorry, but I just don't do customised versions of any of my mods (unless you want to pay for my time of course) - it simply would not be practical, as so many people want little things changing here and there. It's enough to just keep up with supporting them as they are.

In the case of this mod, any changes would also take a little longer as I didn't write the original code, so I have to familiarise myself with how it works.

perfphysio
10-22-2007, 10:55 AM
Hi there. Thanks for this useful tool. I have one inpt question on the permissions for the folder that this is writing the back up to, in terms of read and write and execute etc.

There are settings for owner, groups, public etc. What is the best way to lock this down so that the system can run the cron job successfully but also so that we can keep other's eyes out of there?

Also can you perhaps give us a screen shot that will show us a typical cron set up for a once a day or once a week backup?

thanks a lot :)

mgurain
11-10-2007, 04:33 AM
Hi Paul M,
I used :
$backup['DUMP_PATH'] = DIR.'/../../backups/';
We I try to run in from the ACP cron, I get this message:
Warning: main() [function.main]: Unable to access /my_server_link/my_site/vb/./includes/cron/cronbackup.php in /admincp/cronadmin.php on line 110

Warning: main(/my_server_link/my_site/vb/./includes/cron/cronbackup.php) [function.main]: failed to open stream: No such file or directory in /admincp/cronadmin.php on line 110

Warning: main() [function.include]: Failed opening '/my_server_link/my_site/vb/./includes/cron/cronbackup.php' for inclusion (include_path='.:/usr/local/lib/php') in /admincp/cronadmin.php on line 110

What's a problem ?

thanks,,

Paul M
11-10-2007, 12:05 PM
Failed opening '/my_server_link/my_site/vb/./includes/cron/cronbackup.php' for inclusion

That suggests that cronbackup.php is not in the includes/cron/ folder.

Brezeer
11-10-2007, 12:15 PM
What does this mean?

XML Error: not well-formed (invalid token) at Line 2

Brezeer
11-10-2007, 12:20 PM
Uhmm nvm mate my bad... i imported txt file instead xml.... sorry addon works great thanks allot for it!

PS. getting this error when backuping:

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

Paul M
11-10-2007, 07:02 PM
That means you don't have permission to create the backup file. You need to sort out your write permissions.

pakomen
11-12-2007, 10:37 AM
Great tool. Thanks so much. :)

zetetic
11-15-2007, 01:22 PM
I upgraded to PHP 5.2.5 yesterday, and the forum didn't re-open after the backup last night. Any idea why that might happen?

Paul M
11-15-2007, 02:53 PM
Nope, no idea at all.

zetetic
11-15-2007, 03:21 PM
Thanks Paul. Hopefully it was just a fluke.

Paul M
11-15-2007, 04:40 PM
I've had it happen randomly in the past, so I no longer use the option.

JohnBee
11-15-2007, 06:06 PM
Walked into my forum today only to find it was closed for backup! I received countless emails that the site was closed all day.

What's more interesting is I had no option to turn it back on lol
Anyways, I uninstalled this hack until it gets fixed.

Paul M
11-15-2007, 08:06 PM
What's more interesting is I had no option to turn it back on lol
Anyways, I uninstalled this hack until it gets fixed.
You turn it on in the ACP.

It's not going to get "fixed" as there is nothing to fix, it's just a blip that sometimes happens. Like database errors.

Uninstalling it is a pointless and extreme route to take, just don't use the option if it bothers you. There is no need to close the forum during a backup.

melbo
11-15-2007, 09:49 PM
Strange. I had the same thing happen last night.
Forum was closed all day and I had to go into vb options/ turn your forum on and off and turn it off and then back on to clear it up.

I've used this backup without fail for awhile now and this is the first problem I've had.
Odd that it happened to another forum as well at the same time.

In scheduled tasks / database backup / edit, I see no option to not turn the forum off. How would I do this?

Thanks. I really love this mod.

I'm going to check it tomorrow morning and see if it happens again tonight.

djbaxter
11-15-2007, 10:40 PM
In scheduled tasks / database backup / edit, I see no option to not turn the forum off. How would I do this?

Open /includes/mysqlbackupconfig.php.

Find at lines 8-10:

// Forum Shutdown System
$backup['SHUTDOWN'] = 0;
$backup['MESSAGE'] = "The Forum is closed because a database backup is in progress.";

Make sure that $backup['SHUTDOWN'] = 0.

melbo
11-15-2007, 10:56 PM
thanks

JohnBee
11-16-2007, 04:28 AM
You turn it on in the ACP.

It's not going to get "fixed" as there is nothing to fix, it's just a blip that sometimes happens. Like database errors.

Uninstalling it is a pointless and extreme route to take, just don't use the option if it bothers you. There is no need to close the forum during a backup.
Right... the problem is it was not off in ACP so there was nothing to turn on. It went away once the forums were turned off in ACP then back on again.

djbaxter
11-17-2007, 11:34 AM
I've been running this mod for some time now, I think since 3.64 or maybe earlier.

This morning, I received an email warning with this error - the Backup add-on is the only cron job that would have been running at the time in question:

Database error in vBulletin 3.6.8:

Invalid SQL:
SHOW CREATE TABLE `vbtaggregate_temp_1195286160`;

MySQL Error : Table '{forum info deleted}.vbtaggregate_temp_1195286160' doesn't exist
Error Number : 1146
Date : Saturday, November 17th 2007 @ 03:44:40 AM
Script : http://{forum info deleted}/cron.php?&rand=961734
Referrer :
IP Address : {forum info deleted}
Username : Unregistered
Classname : vb_database

This is the first time I've seen this. Any ideas as to what caused it? I haven't changed anything that I can recall nor even added any new add-ons in at least several days.

Paul M
11-17-2007, 02:45 PM
Looks like something created a temporary table, which had then been deleted by the time it came to be backed up.

powerful_rogue
11-18-2007, 06:41 PM
This is fantastic. Although one problem. It only goes as far as announcementread before stopping. No errors or anything, it just stops. (Been doing it manually to test)

Ive read through the topic and seen people with a simialr problem who said it was to do with their host. As my host is usless as solving problems despite me paying a fortune each month, I decided to back up the normal way using VB's built in system. It came back with this:

Database Backup

Processing: access

Processing: adminhelp

Processing: administrator

Processing: adminlog

Processing: adminmessage

Processing: adminutil

Processing: adv_modules

Processing: adv_pages

Processing: adv_setting

Processing: adv_settinggroup

Processing: announcement

Processing: announcementread

Warning: mysql_query() [function.mysql-query]: Unable to save result set in /includes/class_core.php on line 371
Database Error Database error
The Dover Locals database has encountered a problem.


Below is line 371-385

if ($queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link))
{
// unset $sql to lower memory .. this isn't an error, so it's not needed
$this->sql = '';

return $queryresult;
}
else
{
$this->halt();

// unset $sql to lower memory .. error will have already been thrown
$this->sql = '';
}
}


Am I right in thinking this is definatly a problem with the server my site is hosted on? If so, what do I need to ask them?

All the best

Paul M
11-18-2007, 08:17 PM
Yep, that's an error with mysql - try running a repair on the table, sometimes that can help even though it seems ok.

powerful_rogue
11-19-2007, 08:19 AM
Are you trying to execute this backup from phpMyAdmin or from within vBulletin?

If it's the former, I have justed tested the export function and it worked successfully - you just need to remember to compress the database in a zipped archive at export. If it's the latter, then vBulletin need to explain what it is that needs to be changed, as we cannot be expected to support the workings of their application.

However, judging by the error message you kindly supplied, I would guess that vBulletin requires a bigger PHP memory limit in order to run the backup function. It could be that vBulletin's backup function doesn't compress the database sufficiently or requires a large memory limit - you can increase PHP memory limit using php.ini.

In any event, executing the backup from phpMyAdmin works. If there are functions within vBulletin that are being limited by your current server configuration, please obtain details from vBulletin as to the necessary server requirements so that we can assist you in making the necessary changes. If you have any further questions, please don't hesitate to contact us.

With kind regards from Berlin

Above is the reply I got from my hosts.
I managed to download a backup via vbulletin where I can save to the pc, however if I try to use this mod, or use vbulletins feature and try to save to my webspace it comes back with the memory error.

Would increasing the PHP memory limit using php.ini help? If it would i'll get back in touch with them as I have no idea what it is!

Failing that, anything else I need to ask the hosts?

Thanks

steven s
11-19-2007, 10:10 AM
I upgraded to PHP 5.2.5 yesterday, and the forum didn't re-open after the backup last night. Any idea why that might happen?
Same here. My host installed php 5.2.4.
The common denominator must be php v5.
I disabled the mod.Open /includes/mysqlbackupconfig.php.

Find at lines 8-10:

// Forum Shutdown System
$backup['SHUTDOWN'] = 0;
$backup['MESSAGE'] = "The Forum is closed because a database backup is in progress.";

Make sure that $backup['SHUTDOWN'] = 0.
What does this do?
Disables the shut function but still does the backup?

Paul M
11-19-2007, 10:15 AM
What does this do?
Disables the shut function but still does the backup?
Yes.

Paul M
11-19-2007, 10:17 AM
Would increasing the PHP memory limit using php.ini help? If it would i'll get back in touch with them as I have no idea what it is!
Quite possibly yes, it would. What is your current limit (check in your ACP, at the top of the index page).

powerful_rogue
11-19-2007, 11:42 AM
Quite possibly yes, it would. What is your current limit (check in your ACP, at the top of the index page).

Server Type SunOS
Web Server Apache v1.3.37 (cgi)
PHP 4.4.7 P
PHP Max Post Size 8.00 MB
PHP Maximum Upload Size 2.00 MB
PHP Memory Limit 20.00 MB
MySQL Version 4.0.27-log
MySQL Packet Size 1.00 MB


I tried using MySqlDumper as well and that timed out as well. That showed I had a Max Execution Time of 30 seconds.

Paul M
11-19-2007, 12:21 PM
You php memory is currently 20M, I would set it to a minimum of 32M.

JFYI, I use 64M

powerful_rogue
11-19-2007, 12:31 PM
You php memory is currently 20M, I would set it to a minimum of 32M.

JFYI, I use 64M


Thanks Paul.

Ive created a php.ini file with the instructions inside:

memory_limit=65M
safe_mode=off
max_ execution_time=0

However the chap I spoke to wasnt sure where you would need to place this in the vbulletin directory. Any ideas where I would need to place it? The male was also quite shocked at the size of my DB - currentyl 65MB - Is this large in terms of forums?

Thanks for your help.

Paul M
11-19-2007, 02:57 PM
You need to ask your host about where to put your ini file.

65M is a fairly small database.

BTW, I would suggest you change the php memory limit to 64M, it's normally set in multiples of 2 (i.e. 4,8,16,32,64,128 etc) - and is not related to the database size.

powerful_rogue
11-19-2007, 04:37 PM
You need to ask your host about where to put your ini file.

65M is a fairly small database.

BTW, I would suggest you change the php memory limit to 64M, it's normally set in multiples of 2 (i.e. 4,8,16,32,64,128 etc) - and is not related to the database size.

Thanks, I'll alter to 64.
He said as he's never used vbulletin before he had no idea what directory it had to go in. I'll check over on vb.com

Thank for all your help, hopefully i'll get this to work!

Triky
11-20-2007, 12:17 PM
Hey, Paul.. I would like to know one thing. I've added a new folder called f_backups on my site root. I want to redirect there all my backup files. Now, my question(s) is(are): wich is the path I have to put on the mysqlbackupconfig.php file? ./f_backup? Will be that folder secure, on my server? I mean.. I want that only accesible by me..

ChurchMedia
11-26-2007, 01:51 AM
Hi Paul,

I've been using this mod for a long time and it's saved my butt more than once. I'm having the same problem with it not turning the forums back on after backup. I've set it to NOT turn them off for now, but thought you would like to know.

Quick question: This mod is the "Lite" version. Is there another version?

BTW, I'd love to see the mod expanded to automatically delete backups that are X days old.

Thanks for the awesome work! :)

Paul M
11-26-2007, 07:08 AM
I've been using this mod for a long time and it's saved my butt more than once. I'm having the same problem with it not turning the forums back on after backup. I've set it to NOT turn them off for now, but thought you would like to know.

Quick question: This mod is the "Lite" version. Is there another version?

BTW, I'd love to see the mod expanded to automatically delete backups that are X days old.

There are no other versions, the "lite" is just an historic name from the 3.0 > 3.5 conversion.

As I'm sure I've said a number of times, I didn't write this, just converted it, and the way it closes/opens the forums is not ideal. One day I may change it, but not for now, its a low priority mod for me as it does what I need it to do. For the same reason it's unlikely that any new features will get added anytime soon.

MPDesignZ
12-01-2007, 01:03 AM
That means you don't have permission to create the backup file. You need to sort out your write permissions.

I'm getting the same error and I've set the directory that the backups are to go into at 777 already, so I'm at a loss as to what permissions we are talking about here.

MP

Artangel
12-01-2007, 07:53 AM
thanks to this mod... but the problem is, when i used this mod, it cause too much bytes rather than manual backup of my forum using ssh..

for example..

if i use ssh/remote backup, its only 500mb+, in this mod now its 1GB+

Paul M
12-01-2007, 10:30 AM
I'm getting the same error and I've set the directory that the backups are to go into at 777 already, so I'm at a loss as to what permissions we are talking about here.

Probably open_basdir restrictions.

MPDesignZ
12-01-2007, 01:31 PM
Probably open_basdir restrictions.

Not sure what that is. :( Where would I find the open_basedir?

Thanks
MP

Paul M
12-01-2007, 03:31 PM
open_basedir restrictions are part of how php is set-up, speak to your host to find out what they may be on your set-up.

Triky
12-01-2007, 05:26 PM
<a href="https://vborg.vbsupport.ru/showpost.php?p=1386205&postcount=461" target="_blank">https://vborg.vbsupport.ru/showp...&postcount=461</a>

Can you help me, Paul M?

Paul M
12-01-2007, 09:09 PM
Not really, I cannot answer server specific questions as I have no idea how you are set-up.

MPDesignZ
12-02-2007, 11:21 AM
open_basedir restrictions are part of how php is set-up, speak to your host to find out what they may be on your set-up.

Ok it was allowing backups just fine before and now they are not working on the regular database backup system within vbulletin. This is why I went in search of this mod and was trying it out, so I think this maybe another issue all together that I will have to address. I will keep the php open_basedir in mind just in case. But I was able to do backups before we installed FlashChat.

Thanks
MP

member007
12-05-2007, 06:27 AM
Go to your Scheduled Task Manager in the ACP and run the cron job.

Works great!! Only problem is that I got too many sql files being generated instead of one sql file to restore. For example, I got Live-2007-12-05-access.sql, Live-2007-12-05-adminhelp.sql, Live-2007-12-05-administrator.sql and the list goes on and on. How does this happen?

ChurchMedia
12-05-2007, 04:50 PM
Works great!! Only problem is that I got too many sql files being generated instead of one sql file to restore. For example, I got Live-2007-12-05-access.sql, Live-2007-12-05-adminhelp.sql, Live-2007-12-05-administrator.sql and the list goes on and on. How does this happen?

That's just the way it's coded. It has its benefits. All of my PHP scripts share the same database, so I like the tables to be separated like that. If you wanted to restore all of them at once, I'm pretty sure you could just use a wildcard (*.sql) to dump back into the database.

Paul M
12-05-2007, 05:12 PM
It's controlled by a setting in the config file (just read the file).

edgecutioner
12-07-2007, 10:20 AM
In accordance to this post (https://vborg.vbsupport.ru/showpost.php?p=1195529&postcount=210) by SkyCatcher on Linux Distros, if your host uses cPanel, you can get your root directory by seeing the 'Home Directory' and adding that value with the directory of the desired folder where your autobackup goes. In my setup, it's like this:

$backup['DUMP_PATH'] = 'home/(my username)/ws/autobackup'; // Path to backups folder, with trailing slash
where home/(my username), I got that from cPanel and I just appended the directory I wanted.

Thanks for the port Paul ;)

hqvtl2004
12-07-2007, 11:12 PM
Can you add new function that send backup file to an specific email address? I think it's will be great feature in next version.

Thanks

MrApples
12-10-2007, 09:17 PM
Whats the minimum Chmod?

TrIn@dOr
12-11-2007, 10:20 AM
Perhaps someone can help me.

After executing this nice script, i have in my selected folder under the today date my 118 sql files. Each one represent a table, Ok?

In my CMD i copy *.sql to theone.sql, right?, to make only 1 file.

Then, locally in my phpmyadmin i try to import the unique file trough the dir ./upload (large file procedure for phpmyadim), yes?

But im getting a halt on the table 85, and all the rest of the tables are not imported.

Why?, need help, this is critical for us.

Thanks in advance.

Paul M
12-11-2007, 06:33 PM
That sounds like a phpmyadmin issue - but someone might have a clue if you tell us what error message you get.

control1110
12-13-2007, 05:04 PM
I am looking at the config file and something is confusing me does this mod take the forum into offline mode while it is doing the backup or can users still use the forum?

Paul M
12-13-2007, 11:14 PM
That depends on the shutdown setting.

control1110
12-14-2007, 02:36 AM
So what your telling me is I can set it so it will not shut down the forum at all and still perform the backup with no problem? Also will it delete the old backup file once the new one is created?

Paul M
12-14-2007, 11:20 AM
So what your telling me is I can set it so it will not shut down the forum at all and still perform the backup with no problem?
Yes. That's how I run it.

Also will it delete the old backup file once the new one is created?
No (unless the backup file name is the same).

control1110
12-14-2007, 04:38 PM
ok thank you for your help

yeku
12-15-2007, 08:31 AM
Not Installed Paul...no working, sorry

silvermerc
12-15-2007, 11:40 PM
If installed like it says in the readme and when i try and run the task it says

Database Backup

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

but i dont understand why its saying it cant open the sql file, I dont want it to open it I want it to make 1 and save all the tables there :S

Iv set it to save to /home/(username)/backup which is chmoded to 777

Can anyone help?

djbaxter
12-16-2007, 12:03 AM
1. That error means it isn't able to open a new file to write the backup. Since you've already said that the current backup directory is write-enabled, I'd assume it can't find the directory you've specified.

2. See if it will work under the forum directory - it may be balking at a configuration above the forum root.

silvermerc
12-16-2007, 10:27 AM
I fixed it! Turns out it didnt work because I forgot the / at the begining on the file path :P Thanks djbaxtor

control1110
12-16-2007, 09:57 PM
can this script be set to do multiple back ups a day?

control1110
12-16-2007, 10:48 PM
im looking at vb scheduled task and I am trying to figure out how to set my backup to do a backup every 4 hours but I can't figure it out. any help would be great. Thanks

Paul M
12-17-2007, 09:33 AM
I don't think you can set a vb cron to run every 4 hours.

yuriy
12-17-2007, 01:04 PM
What is the point of this if I can backup my db in phpmyadmin?? or in terminal??

djbaxter
12-17-2007, 01:15 PM
What is the point of this if I can backup my db in phpmyadmin?? or in terminal??


1. it's more convenient/easier

2. it's automated

Sevo
12-17-2007, 02:17 PM
Ok I know this may be a lame question but I am new to this so here it goes...

I am trying to make the back up folder but I dont want it to be seen by the public... where in the root do i put it so the public cant see it. are all the forum folders able to be see by the public?

my root is
sitename/

all those folders after the / are able to be seen correct?

sorry for the questions but I am just new to this

thanks for the help

Paul M
12-17-2007, 05:07 PM
What is the point of this if I can backup my db in phpmyadmin?? or in terminal??

If you can't see the point then you don't need to worry about using it .....

yuriy
12-24-2007, 03:21 AM
If you can't see the point then you don't need to worry about using it .....

I asked because I didn't understand what this was alright?..now I understand and it makes sense on what it does..maybe with a little more info I would of understood everything from the beginning.

yuriy
12-24-2007, 09:23 PM
I have a question.. is there ANY way of having this SAVE my db+tables into one .sql file and NOT just the tables themselves??

and is it ok if I made a .htaccess file with "deny from all" inside the path/to/backup path?

Paul M
12-24-2007, 11:18 PM
I have a question.. is there ANY way of having this SAVE my db+tables into one .sql file and NOT just the tables themselves??

and is it ok if I made a .htaccess file with "deny from all" inside the path/to/backup path?

1. Just set the combine setting to 1

2. Yep, that should stop anyone accessing it.

yuriy
12-25-2007, 02:05 AM
1. Just set the combine setting to 1

2. Yep, that should stop anyone accessing it.

Thank you :), working nice!

chingon
12-29-2007, 03:05 AM
Hello, I am a new guy and this is really great. The only problem is that I can only get it set up right to a folder below my forum. I have been up and down this thread trying everything but I can't seem to get it set up right. I am in shared hosting and I have read to check in phpinfo and all I can find is /usr/local/Zend/etc/php.ini I am trying to go off my root folder to admin/backups. Any suggestions? I guess maybe I'm getting too old for this.:)