Page 1 of 1

Automatic Database Backup Failed

PostPosted: Thu Jan 25, 2007 9:49 pm
Author: DDay629
Your phpBB Version: 2.0.22
phpBB Type: Integramod 141
MODs: No
Your knowledge: Basic Knowledge
Board URL: http://forum.clanpla.org

PHP Version:
MySQL Version:


What was done before the problem appeared?
Umm, I changed a bunch of settings, but nothing to do with the database. At least not that I can think of.


What was done to try to solve the problem?




De.scription and Message

Just wondering if there is a simple reason for this, and if there is, what I can do to fix it. I have looked around the preferences and I can't even find why it's doing auto updates, or where its storing them. It worked at first, but the last few day's backups haven't worked according to the PM it sends me.

DDay

PostPosted: Thu Jan 25, 2007 10:08 pm
Author: Dankbutter
ACP > Security > Special at the bottom of the page

It shows you what folder and also says that it must be CHMOD to 777

hope that helps

PostPosted: Thu Jan 25, 2007 10:14 pm
Author: DDay629
Ok, the place it is going is obvious, and the file permission for that folder is 777. Hmm, maybe it can only hold so many backups or something.

DDay

Re: Automatic Database Update Failed

PostPosted: Thu Jan 25, 2007 10:46 pm
Author: darknights
I have the same issue, it is doing the backups however the file size of the files its backing up is 0, and i always get them PMs saying its failed backup. iv looked through the settings, also my backup folder is chmod to 777. any further help on this is also appreciated. thanks in advanced

PostPosted: Thu Jan 25, 2007 10:58 pm
Author: DDay629
Yes, exactly the same symptoms for me too.

DDay

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 12:01 am
Author: darknights
So... No solutions for this yet? sorry to bug yall about this, i know you guys have a lot of work to do, a lot of bugs to work on, but this is a great feature, and i just wish it would work correctly for me.

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 12:05 am
Author: Teelk
Can you give me your OS type? Windows, linus, unix etc.?

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 12:19 am
Author: darknights
My website is being hosted on a Linux platform using the Ubuntu distro and its updated to the latest version, a good friend of mine is hosting the website =) Thanks for replying to me here as well man, your soooo helpful!!!

PostPosted: Sun Jan 28, 2007 12:49 am
Author: DDay629
My site is being hosted on Linux.

DDay

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 2:18 am
Author: Teelk
Can you go into your php_info in ACP>Tools and tell me if "system" is listed in the "disable_functions" section. The system command is required to run the backup. If it is disabled then removing it from that section in you php.ini file should restore it's function.

If you don't have access to your php.ini file then you'll have to ask your host to enable it for you. Don't forget to restart your server.

PostPosted: Sun Jan 28, 2007 3:04 am
Author: DDay629
Like it should be in the local Value? Cause mine says: disable_functions no value no value
Does that mean I need to get this fixed?

DDay

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 2:13 pm
Author: darknights
Code: Select all
disable_functions    no value     no value

same as his, so i dont know hmmm....

PostPosted: Sun Jan 28, 2007 2:17 pm
Author: DDay629
Oh, and mysteriously it worked the night before last but last nights didn't. Have no idea why.

DDay

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 6:11 pm
Author: Teelk
If the value is empty then there aren't any disabled functions. So, the system command isn't disabled on your server.

The only other thing I can think of is that the following conditions aren't being met...
Code: Select all
$last_backup != $today) && (date('H') >= $backup_time


Check the field phpBBSecurity_last_backup_date in your config table. See if it's updated to the correct date, should be the day of the month.

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 6:17 pm
Author: Teelk
Also, the path to mysqldump may be different on your server. The backup function only has one path, which may not be yours.

So, open includes/phpbb_security.php and find the following line...
Code: Select all
            system("/usr/bin/mysqldump -u". $dbuser ." -p". $dbpasswd ." -h ". $dbhost ." ". $dbname ." > ". (($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $HTTP_SERVER_VARS['DOCUMENT_ROOT']) . $board_config['.script_path'] . $backup_folder ."/". $backup_file  ."-". date('Y-m-d') .".sql", $fp);


You need to find your path to mysqldump.exe and place it where it says /usr/bin/

mysqldump is in reference to the file itself.

Re: Automatic Database Backup Failed

PostPosted: Sun Jan 28, 2007 7:14 pm
Author: darknights
"Teelk";p="20640" wrote:If the value is empty then there aren't any disabled functions. So, the system command isn't disabled on your server.

The only other thing I can think of is that the following conditions aren't being met...
Code: Select all
$last_backup != $today) && (date('H') >= $backup_time


Check the field phpBBSecurity_last_backup_date in your config table. See if it's updated to the correct date, should be the day of the month.

Where can i find this table?

PostPosted: Sun Jan 28, 2007 10:56 pm
Author: Demonicpagan
the table should be in your ACP >> .: Security :. >> Special at the very bottom. There will be files there that show up in your folder you have designated as your backup directory.

If you do not have access to the box to find the location of mysqldump on a linux system. Create a file like exec.php or something and place this code inside of it. Just remember, once you are done with it, remove it from your server.
Code: Select all
 <php>  

This will display the location of where mysqldump is being ran from. Place this information is the file Teelk mentioned.

Re: Automatic Database Backup Failed

PostPosted: Mon Jan 29, 2007 2:30 am
Author: Teelk
The solution to that may be to add another field to the ACP>Security module so that admins can insert the correct path if the default path is incorrect.

PostPosted: Mon Jan 29, 2007 4:49 pm
Author: Demonicpagan
yeah, that would be an idea. maybe under the field de.scription show where the system is finding the path to mysqldump and user places that info into a textbox to be submitted thus what is in the textbox is a variable stored in to the database.

Re: Automatic Database Backup Failed

PostPosted: Fri Feb 02, 2007 5:41 pm
Author: Omni-Lee
I am having this issue and I cant seem to figure out whats wrong.

I have two seperate installs with two seperate databases in two distinct directories. One portal backs up the database, the other doesn't. The only two things different between them is obviously the url, but also the .script path.

The working site is the url with the .script path an actual directory ie. mithrilcrowns/ (http://www.blahblah.com/mithrilcrowns/)

The non-working site has a .script path of / (the url redirects to the portal root) (http://www.nyahnyah.com)

The security > special settings are identical.

Re: Automatic Database Backup Failed

PostPosted: Sat Feb 03, 2007 12:17 am
Author: Demonicpagan
are the two sites installed on the same server?

you may want to try using the code i posted on each domain and make sure they both are returning the same path to mysqldump, if they differ, then there's your problem.

also make sure you have created your backup directory in the root of you phpbb install and have it chmod to 777. i'd also check if you have root access to the server that the directory is properly owned.

just a few things to check out...

PostPosted: Sat Feb 03, 2007 6:41 pm
Author: Omni-Lee
Your .script returned the exact same response on both installs

Both backup directories are chmod 777

PostPosted: Sat Feb 03, 2007 7:50 pm
Author: DDay629
Hmm, now this is odd. It works randomly. Absolutely no pattern.

DDay

PostPosted: Tue Feb 06, 2007 12:16 am
Author: Omni-Lee
The automatic backup is making an attempt, but all that is happening are 0kb files are being generated.

This means to me that the function sees the directory and has access to it. But possibly mysqldump isn't generating any data?

A manual entry through mysqldump generated the appropriate file and size.

I'm not sure where to go from here.

Re: Automatic Database Backup Failed

PostPosted: Tue Feb 06, 2007 2:12 am
Author: Demonicpagan
"Teelk";p="20641" wrote:Also, the path to mysqldump may be different on your server. The backup function only has one path, which may not be yours.

So, open includes/phpbb_security.php and find the following line...
Code: Select all
            system("/usr/bin/mysqldump -u". $dbuser ." -p". $dbpasswd ." -h ". $dbhost ." ". $dbname ." > ". (($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $HTTP_SERVER_VARS['DOCUMENT_ROOT']) . $board_config['.script_path'] . $backup_folder ."/". $backup_file  ."-". date('Y-m-d') .".sql", $fp);


You need to find your path to mysqldump.exe and place it where it says /usr/bin/

mysqldump is in reference to the file itself.


Take a look at this and make sure what is showing by my simple .script is what is located here. I had the problem of it creating 0byte files and came to find out that it was creating files by not having information dumped into it by mysqldump

PostPosted: Tue Feb 06, 2007 11:45 am
Author: Omni-Lee
your .script returned

/usr/bin/mysqldump

PostPosted: Tue Feb 06, 2007 10:27 pm
Author: Omni-Lee
What does .script_path return if the .script path set in configuration is ?

If it returns a then in essence mysqldump is attempting to be run as the following

usr/bin/mysqldump -uusername -ppassword -hhost dbname > // backupfilename.sql

so basically mysqldump fails to return the data, but the file itself would be created.

Is that correct or am I headed in the wrong direction?

PostPosted: Wed Feb 07, 2007 4:42 am
Author: Demonicpagan
you are saying that you have your backups being created in the root phpBB folder? if that's what you are going for, which i would advise against, then your .script path in the configuration should be / not .

*nix paths are /path where as windows paths are drive:

PostPosted: Wed Feb 07, 2007 12:26 pm
Author: Omni-Lee
No, I'm not trying to put the backups any place other then where they default to.

I am basically grasping at straws here trying to get this to work properly.

As previously mentioned I have 1.4.1 (beta) working properly on one hosting company account. Then with another account (same company) I have 1.4.1 release db back-up not working. The hosting company states there is no difference between the mysqldump configuration between both accounts. The short exec.php .script provided earlier in this thread produced the same results /usr/bin/mysqldump. The working account has had the back-up working where it's .script path was either or forum. The non-working site will not work with either or forum.

This is ridiculous, if both the software and the server are fine, it means that I am doing something wrong, and no matter what I do it still doesn't work!

Re: Automatic Database Backup Failed

PostPosted: Wed Feb 07, 2007 7:59 pm
Author: Demonicpagan
okay, let me make sure i have everything correct.

you have 2 sites on the same domain one works one doesn't

your hosting provider is either a *nix or freebsd hosting provider

i'm going to assume that one site is placed

/site1 and the other be like /site2

your forum root directories would be /site1 and /site2 if that is where you installed phpbb. if you installed phpbb in /site1/forum then that is the root

your backup directory where the dump files are stared needs to be in the root directory

i run many many many sites through my domain im41 is installed into / and my backup directory is /backup because i have created a directory called backup chmod 777 in my / root directory.

i also have in my ACP >> .:Security :. >> Special >> Folder To Put Backups In box the name of the folder backup

I am trying desperately to explain this the best that I can to you so you can get your automatic backups working properly.

Re: Automatic Database Backup Failed

PostPosted: Wed Feb 07, 2007 9:45 pm
Author: Omni-Lee
I have two domains and two accounts with the same hosting company. Each account has exactly one domain.

Site 1 works with the domain pointing to <root>/forum (Site Path is ) or ./ (Site Path is forum)

Site 2 does not work with the domain pointing to <root>/forum (Site Path is ) or ./ (Site Path is forum)

Using exec.php from root on both sites reported /usr/bin/mysqldump

In both cases automatic backup settings have been left in default (directory is backup; filename backup; time is 6pm). The directory <root>/forum/backup has been checked to be chmod 777


*On a side note* Last night I tried removing the $site_path entry in the sql line which caused an error after replacing file with local copy (from zip); backup isn't even trying nor are the admin/mod settings being saved. Unfortunately I didn't save a copy of the installed file as I should have, as any changes I had done due to cracktracker were done through the same method and worked properly.

Re: Automatic Database Backup Failed

PostPosted: Wed Mar 21, 2007 8:53 pm
Author: darknights
Im still having backup issue, everything seems configured properly, CHMOD properly, mysqldump set up to the right path, 1 thing i am noticing though is this...
i have backup time set at 7pm. but... heres the files being generated...

[code]  db-2007-03-16.sql ]
Iv had it set to 7pm since beginning of febuary so its not shooting out at proper times, possibly something messed up with times of the server? and or of my boards configuration of time zones?
Thanks.

Re: Automatic Database Backup Failed

PostPosted: Wed Mar 21, 2007 9:29 pm
Author: darknights
Ok, i tried 1 more thing to get the time correct...
i manually edit the lang_main.php
i added more GMT + XX
i had to get mine up to GMT + 17 to be the correct time. which is Eastern time... so now the board is at the correct time all around. so time to see if this corrects my issue... if this does, i will post saying my success or failure.
Thanks

Re: Automatic Database Backup Failed

PostPosted: Wed Mar 21, 2007 10:55 pm
Author: DjPorkchop
thi shas been an issue for a very long time now and has been discussed over at tweaks forever. Why not set up a cron job and be done with it? thats what i did.. I get backups twice a day since i reverted back to 1.4.0

Just a thought. I ended my stress with this error like ohhhhh a day after i first tried to get it to work. <img>