[BETA] Automatic Database backup

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
Volunteer Forum
Registered User
Posts: 400
Joined: Mon Sep 12, 2005 9:59 pm

The code changes from 100 to 102

Post by Volunteer Forum » Tue Apr 03, 2007 12:59 pm

Volunteer Forum wrote:
kkroo wrote: Oh sorry I forgot to reply to that post u made before. All you have to do to upgrade is just recopy the existing files with the new ones.


But all the code changes in the other files then ?

I took a quick look and i found some lines in the newest
version that i did not have in my other files :? :?:


Ok, i have now gone true this step by step.
The code changes from 100 to 102 is:


Image

#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )

#
#-----[ REPLACE WITH ]------------------------------------------
#
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") && !defined("IN_CRON") )

#
#----------------------------------------------------------
# And the database looked the same on the 100 and 102 version.
# So no edit there...

#
#-----[ Also replace all files: ]------------------------------------------
#

copy root/cron.php to cron.php
copy root/admin/admin_backup.php to admin/admin_backup.php
copy root/includes/cron.php to includes/cron.php
copy root/includes/auto_backup.php to includes/auto_backup.php
copy root/templates/subSilver/admin/admin_backup.tpl to templates/subSilver/admin/admin_backup.tpl
copy root/backups/index.htm to backups/index.htm
copy root/cache/auto_backup/index.htm to cache/auto_backup/index.htm
copy root/language/lang_english/lang_auto_backup.php to language/lang_english/lang_auto_backup.php

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

And now your version should be updated correctly
Everything that is not perfect is a flaw [",]

User avatar
Volunteer Forum
Registered User
Posts: 400
Joined: Mon Sep 12, 2005 9:59 pm

Re: [BETA] Automatic Database backup

Post by Volunteer Forum » Wed Apr 04, 2007 4:08 am

Btw, two questions...

1.
Why cant i add the:
<img src="cron.php" width="1" height="1" alt="" border="0"/>

In the Admin index page instead ?
(It dosen't run if i add it there)

2.
What was it i could do to not have the forum go offline when making a backup ?
(And why not just add the option in the ACP ? *Go offline when making a backup: Yes/No*)
Everything that is not perfect is a flaw [",]

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Automatic Database backup

Post by kkroo » Wed Apr 04, 2007 7:19 am

If you want to add it in the acp, the path would be:

<img src="../cron.php" width="1" height="1" alt="" border="0"/>

There isnt an option to enable disable this. You always want it disabled because if a user makes a post or change in the DB while it is backing up, it can overload the server.
My MODs

Need a coder?

Enjoy my Mods? - Image

User avatar
yakusha
Registered User
Posts: 71
Joined: Mon Apr 03, 2006 8:30 pm

Re: [BETA] Automatic Database backup

Post by yakusha » Fri Apr 06, 2007 12:46 pm

my using a premod system... and sql queries are changing automatic

ex: this query

Code: Select all

CREATE TABLE `phpbb_backup` (
	`phpbb_only` int(1)  NOT NULL,
);
changin

Code: Select all

CREATE TABLE `my_prefix_backup` (
	`my_prefix_only` int(1)  NOT NULL,
);
yes:

Code: Select all

	`my_prefix_only` int(1)  NOT NULL,
and my changed thes

Code: Select all

CREATE TABLE `phpbb_backup` (
	`related_only` int(1)  NOT NULL,
);
:)

thank for all things :)

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Automatic Database backup

Post by kkroo » Fri Apr 06, 2007 2:46 pm

Im sorry but I dont really understand what you mean. Could you try clearing things out?
My MODs

Need a coder?

Enjoy my Mods? - Image

kavatah
Registered User
Posts: 6
Joined: Mon Mar 05, 2007 2:36 pm

Re: [BETA] Automatic Database backup

Post by kavatah » Tue Apr 24, 2007 5:26 pm

Hello,

First, your mod is great !!
Second, I'm having a little problem:
Everything works fine until now.
One backup every twelve hours.
Sent to my email, save to my forum's backup folder, and uploaded to another FTP server.

And just today, I received an email with this in it:
Subject : An error occured while backing up your database
Failed in get_table_def (show fields) on line352 in/homepages/29/XXXXXXXXXXX/XXXXXX/forum/includes/auto_backup.php
SHOW FIELDS FROM `phpBB_sessions`;

The backup that was saved to my backup folder stopped at the table phpBB_sessions.

Do you know what could be causing this?

Thanks in advance,

Bes tregards,

Kavatah

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Automatic Database backup

Post by kkroo » Wed Apr 25, 2007 4:17 am

Is this continuously happening or did it only happen that one time?
My MODs

Need a coder?

Enjoy my Mods? - Image

kavatah
Registered User
Posts: 6
Joined: Mon Mar 05, 2007 2:36 pm

Re: [BETA] Automatic Database backup

Post by kavatah » Sat Apr 28, 2007 5:46 pm

Hi,

Well no, only that one time...
It works fine since it happened.

Don't know what happened.

Thanks any way for this great mod

Bye

alez
Registered User
Posts: 237
Joined: Tue Feb 22, 2005 11:21 pm

Re: [BETA] Automatic Database backup

Post by alez » Sun Apr 29, 2007 4:43 pm

ok, sorry if my question is somewhere responded (i read a few pages and i didnt find the answer)...
I dont know very well how this works;;; ive install the mod sucesfully with easymod, and ive configure it trough acp... everythings seems to be fine... Now> at the time of "backup", ive found on "backups" folder, 5 files:

phpbb_db_backup_29-04-2007_13-02_acJ8r.sql
phpbb_db_backup_29-04-2007_20-18_ARu7.sql
phpbb_db_backup_29-04-2007_20-20_H5ou.sql
phpbb_db_backup_29-04-2007_20-24_wADs5.sql
phpbb_db_backup_29-04-2007_20-30_iCq4X.sql

All of this are aprox 5mb. But, when i want to extract it, 3 of those files are "corrupted" (thats what winrar says..) :roll:
So, i open the others, but they start with the same tables (auth access, backup, banlist, so on.. till post text) BUT post_text > is not complete!

1. Why 5 files? its it ok?
2. why corrupted?
3. why backup tables in those 2 files are the same?
4. why is the backup not complete? (not only post text table, it also didnt backup tables like words, for ex)

Thanxs! :oops:

pd: ive choosed the basic syntax > Sundays 1 pm
(in advanced syntax 0 13 * * Sun)

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re:

Post by kkroo » Sun Apr 29, 2007 5:37 pm

What is happening is the script is exceeding the php memory limit and is dying without fully running through.

This can be resolved in a number of ways:
kkroo wrote: this will happen to very large databases, or with hosts that have a very low php memory_limit. First off make sure that you have the latest version the mod. If you continue to have problems, try increasing you php memory_limit. If that won't work either, ttry excluding the search tables from the backup or tables that are not needed, maybe like a logging table or something. If neither of these work, let me know and I could try to

kkroo wrote: There are 3 ways that I know of:

for example, if you wanted to set it to 16MB:

.htaccess

Code: Select all

php_value memory_limit 16M
OR

ini set, paste this at the after <?php in auto_backup.php

Code: Select all

ini_set("memory_limit", "16M");
OR

you can change the setting in php.ini
My MODs

Need a coder?

Enjoy my Mods? - Image

alez
Registered User
Posts: 237
Joined: Tue Feb 22, 2005 11:21 pm

Re: [BETA] Automatic Database backup

Post by alez » Sun Apr 29, 2007 7:14 pm

1.

Code: Select all

<?php
ini_set("memory_limit", "16M");
/***************************************************************************
*                            auto_backup.php
*                              -------------------
*     begin                : Thu March 23, 2006
*     copyright            : Omar Ramadan
*     email                : princeomz2004@hotmail.com
*
*
****************************************************************************/

if ( !defined('IN_PHPBB') )
like that?

2.

Code: Select all

.htaccess

Code: Select All
    php_value memory_limit 16M


in .htaccess, i only have to paste that? (php_value memory_limit 16M)

:oops: :oops: :oops:
ive donde both things (like i paste above), but still works like before; Thanxs.

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Automatic Database backup

Post by kkroo » Mon Apr 30, 2007 3:56 am

Check your phpinfo to ensure that this setting took affect. If this fails, you can try excluding the search table
My MODs

Need a coder?

Enjoy my Mods? - Image

alez
Registered User
Posts: 237
Joined: Tue Feb 22, 2005 11:21 pm

Re: [BETA] Automatic Database backup

Post by alez » Sat May 12, 2007 6:06 pm

kkroo wrote: Check your phpinfo to ensure that this setting took affect. If this fails, you can try excluding the search table


No search tables include and:
Image

But still fails, any other clue? :oops:

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Automatic Database backup

Post by kkroo » Sat May 12, 2007 7:59 pm

How big did you say your DB was?
My MODs

Need a coder?

Enjoy my Mods? - Image

alez
Registered User
Posts: 237
Joined: Tue Feb 22, 2005 11:21 pm

Re: [BETA] Automatic Database backup

Post by alez » Sat May 12, 2007 11:12 pm

~ 57 mb without search tables...

Post Reply

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 10 guests

cron