Jump to content



Photo
* * * * * 1 votes

Contribution: Auto Backup Database


  • Please log in to reply
177 replies to this topic

#21   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 31 May 2008 - 00:11

with version 2.4 here are the error i get, with gzip selected

Notice: Undefined offset: -1 in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 43

Notice: Undefined offset: -2 in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 44

Notice: Undefined variable: at_backup_db in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 74

Notice: Undefined variable: at_backupdb in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 164


any ideas ?
MS2

#22   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 June 2008 - 11:49

There some odd errors, I`ve created Version 2.5 & modified code to improve comatibility, but I`ve no idea why you get the first ones & obviously can`t duplicate as I don`t have php4.

/smile.gif' class='bbc_emoticon' alt=':)' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#23   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 01 June 2008 - 12:52

well i got php 4 , mysql 4 and apache 1xx since for ms2 this is the requirement
for apache 2, mysql 5, and php 5 lots of querys have to be rewritten.

i have put the interval to 1 minutes but i can't see any messages of error and no creation of backup database

any advice for testing ?
MS2

#24 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,092 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 01 June 2008 - 13:07

any advice for testing ?

Try to make one backup manually in your backup directory. I think the errors you mentioned above are caused by not having a single backup in there.

Perhaps then the contribution will work without problems.

#25   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 June 2008 - 13:58

well i got php 4 , mysql 4 and apache 1xx since for ms2 this is the requirement
for apache 2, mysql 5, and php 5 lots of querys have to be rewritten.

i have put the interval to 1 minutes but i can't see any messages of error and no creation of backup database

any advice for testing ?



If you do a temporary mod by adding: $at_backup_db = 'at_backupnow';

onto line 75, it will create a backup on every admin page load, so you could do that, get a few backups & see how things go from there.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#26   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 01 June 2008 - 14:24

i did at line 75 what you said :

- now when i select gzip or false, i got a saved database each time i go to a page in admin
- if i select zip, i got a save in pure sql mode , with the message shown below, but i think it s not reveleant it s just that the variables not selected in admin configuration are not defined :

Notice: Undefined variable: zip in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 167

Notice: Undefined variable: gzip in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 167


line 168 is :

$database_saved =' Database Backup is completed' . ($zip ? ' and zipped.' : ($gzip ? ' and gzipped.' : '.'));


* notice-> even if at the beginning the backup folder was empty , the backup save files

* by the way the link here :

<a href="backups/'.$at_backup_file.


should be using : DIR_FS_BACKUP instead no ?

* last error sown :

Use of undefined constant SUCCESS_DATABASE_SAVING - assumed 'SUCCESS_DATABASE_SAVING' in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 79

it s true i got written when the database saves itself only :

Avertissement SUCCESS_DATABASE_SAVING
Succès Database Backup is completed and gzipped.: Check SQL


MS2

#27   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 June 2008 - 15:16

More variables want defing? I`ll be glad when php4 gets dropped altogether later this year.

To fix undefined variables just add $zip = NULL;$gzip = NULL; to line 75

The program creates an uncompressed backup first, if you select zip it then attempts to zip that & deletes it on success.
If there is any failure in the zip operation the uncompressed backup wont be deleted.

If your saving to the wrong location its your config thats the error.

The file is saved to: DIR_FS_BACKUP . $at_backup_file

$at_backup_file is set to the file name by the program, DIR_FS_BACKUP is set in your configure.php this is normally:
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
So you casn see if DIR_FS_ADMIN is not set you`ll get your problem, its normall set to:
/catalog/admin/

Hope that improves matters
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#28   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 01 June 2008 - 16:24

* by the way the link here :

here is your code :

$messageStack->add_session($database_saved.': <a href="backups/'.$at_backup_file.'" target="_blank"><blink><b>Check SQL</b></blink></a>', 'success');


as you can see the DIR_FS_BACKUP is not use, instead you use :
href="backups/'.$at_backup_file.'

hope you understand what i mean

*

If there is any failure in the zip operation the uncompressed backup wont be deleted.

clever :-)

*

I`ll be glad when php4 gets dropped altogether later this year.

well i dont know for ms3 requirement but i think its going on with what you say...

* what about last error shown, it can give us info, since you define the SUCCESS_DATABASE_SAVING variable, how it can be undefined, that means that
the website never reach the line you got setup:

define('SUCCESS_DATABASE_SAVING', 'ATTENTION: Making a Auto-Backup of your Database ... ( ' . ($hr_dif ? $hr_dif . ' Hrs ' : '') . $mn_dif  . ' minutes since last backup ).');


Use of undefined constant SUCCESS_DATABASE_SAVING - assumed 'SUCCESS_DATABASE_SAVING' in v:\easyphp\www\ms2fr\shop\admin\includes\auto_backup_db.php on line 79


MS2

#29   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 June 2008 - 17:11

Sorry, a little language issue there mayby, I thought you were talking about an earlier point.

* by the way the link here :

here is your code :
as you can see the DIR_FS_BACKUP is not use, instead you use :

href="backups/'.$at_backup_file.'

hope you understand what i mean


I'm not sure if this is a osC version issue, I`m using 2.2rc1. So that code gives correct link like:
http://www.mysite.co...06011749.sql.gz

if it was set to: <a href="'.DIR_FS_BACKUP.$at_backup_file.'"
it would give a link of:
http://www.mysite.co...06011753.sql.gz

which would be no good.

* what about last error shown, it can give us info, since you define the SUCCESS_DATABASE_SAVING variable, how it can be undefined, that means that
the website never reach the line you got setup:

define('SUCCESS_DATABASE_SAVING', 'ATTENTION: Making a Auto-Backup of your Database ... ( ' . ($hr_dif ? $hr_dif . ' Hrs ' : '') . $mn_dif  . ' minutes since last backup ).');


This is only occuring with the temporary mod I asked you to do, if you remove the '$at_backup_db = 'at_backupnow' from line 75, the normal timing will work again, and so the define will be done. You should not get your initial errors as you know have backup files for it to work with.

/smile.gif' class='bbc_emoticon' alt=':)' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#30   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 03 June 2008 - 19:17

Hi guys,

This is a great mod to have, I only wish I had it installed yesterday after a database issue and of course my latest back up was 3 days old. /smile.gif' class='bbc_emoticon' alt=':)' />

Any how I installed this mod today (Auto Backup Install V2.5) and it doesn't appear to be creating backups.

I left the settings as is. I checked the admin to see if it created a new back up (it didn't) I than went into the FTP to see if it created a backup and it hasn't.

I have been doing a bunch of work in the admin area. Could this be the problem?

After running auto_backup_setup.php I deleted it, should I have?


thanks for the assistance.
Sincerely
Mike

#31   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 03 June 2008 - 20:40

Hi guys,

This is a great mod to have, I only wish I had it installed yesterday after a database issue and of course my latest back up was 3 days old. /smile.gif' class='bbc_emoticon' alt=':)' />

Any how I installed this mod today (Auto Backup Install V2.5) and it doesn't appear to be creating backups.

I left the settings as is. I checked the admin to see if it created a new back up (it didn't) I than went into the FTP to see if it created a backup and it hasn't.

I have been doing a bunch of work in the admin area. Could this be the problem?

After running auto_backup_setup.php I deleted it, should I have?


thanks for the assistance.


Have you made the changes to application_top.php ?

What are your software versions?

It should make the first backup strait away, there are still some issues with php4 though.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#32   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 03 June 2008 - 20:53

Have you made the changes to application_top.php ?

What are your software versions?

It should make the first backup strait away, there are still some issues with php4 though.


Hi Sam,

Thank you for the hand.

To be honest I am not 100 % sure which version we are running, is there a prefered file I should look at to see the version I am using? I know it is milestone 2 +.


The application_top was updated with
if (tep_session_is_registered('admin')) require(DIR_WS_INCLUDES .'auto_backup_db.php');


I used the cpanel protected directory to log into the admin, this wouldn't cause a problem would it?

My PHP version is 5.2.6
Sincerely
Mike

#33   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 03 June 2008 - 21:22

Hi Sam,

Thank you for the hand.

To be honest I am not 100 % sure which version we are running, is there a prefered file I should look at to see the version I am using? I know it is milestone 2 +.


The application_top was updated with
if (tep_session_is_registered('admin')) require(DIR_WS_INCLUDES .'auto_backup_db.php');


I used the cpanel protected directory to log into the admin, this wouldn't cause a problem would it?

My PHP version is 5.2.6


It should work fine with your versions.

That could be the cpanel log in, its looking for an admin session, if you hav`ent created one it wont run, if thats a problem just modify the application_top code to:
require(DIR_WS_INCLUDES .'auto_backup_db.php');
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#34   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 03 June 2008 - 21:35

It should work fine with your versions.

That could be the cpanel log in, its looking for an admin session, if you hav`ent created one it wont run, if thats a problem just modify the application_top code to:
require(DIR_WS_INCLUDES .'auto_backup_db.php');


You the man! That did the trick. It backed up instantly.

thanks!

If you decide to update the mod instructions with this, I noticed a minor spelling error.

When you go to admin/configuration/auto backup

Auto Backup Interval
Alter the automatic dBase backup interval in minites.

Should be a u.

thanks again and great mod!
Sincerely
Mike

#35   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 04 June 2008 - 19:22

I`ve now put up V2.6 which should hopfully be OK with your PHP4, if you try it let me know if its all OK.

/smile.gif' class='bbc_emoticon' alt=':)' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#36   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 05 June 2008 - 00:07

hi first let me thank you for the effort of providing a contribution compatible ith php4 !

i installed version 2.6, since even when puting the interval to 1 mn doesnt save, i again tested with
$at_backup_db = 'at_backupnow';

now i can see a difference :

- if there was no database in backup folder, one NOT gziped (pure sql) is saved, then other are gzip since i selected gzip from admin option
- at first time the mesage is shown : ATTENTION: Making the first Auto-Backup of your Database
- but for other times , its a blanck message ( maybe because of the $at_backup_db = 'at_backupnow'; trick)

any idea why it doesnt save every Minutes when i put one minutes in
MS2

#37   dca

dca
  • Members
  • 57 posts
  • Real Name:Dhiren Asher

Posted 05 June 2008 - 17:48

Hello,

I have installed the latest version (2.6) but am not really sure what I am missing....I dont see any backups happening automatically.

After running auto backup setup, it says all is OK and directory is writable etc, but I dont see any backups happenning.

Anything else I need to configure ?

My admin/backups directory has several backup files, some gzip or some without gzip format.

Anyone ?


dca


I`ve now put up V2.6 which should hopfully be OK with your PHP4, if you try it let me know if its all OK.

/smile.gif' class='bbc_emoticon' alt=':)' />



#38   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 05 June 2008 - 19:02

hi first let me thank you for the effort of providing a contribution compatible ith php4 !

i installed version 2.6, since even when puting the interval to 1 mn doesnt save, i again tested with
$at_backup_db = 'at_backupnow';

now i can see a difference :

- if there was no database in backup folder, one NOT gziped (pure sql) is saved, then other are gzip since i selected gzip from admin option
- at first time the mesage is shown : ATTENTION: Making the first Auto-Backup of your Database
- but for other times , its a blanck message ( maybe because of the $at_backup_db = 'at_backupnow'; trick)

any idea why it doesnt save every Minutes when i put one minutes in


That`s anoying, still bugs with PHP4! Adding $at_backup_db = 'at_backupnow'; bypasses the timer functions, one you have some backups for the program to 'see' remove that line and things should be OK. The backup only occurs on a page load, so if you set interval to 1 minute, they will only occur every minite of you navigate between admin pages at least one a minite.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#39   dca

dca
  • Members
  • 57 posts
  • Real Name:Dhiren Asher

Posted 06 June 2008 - 08:16

Hello,

For this contribution to start making the first backup, is it necessary to do anything ?

dca

#40   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 06 June 2008 - 09:17

No, It should do strait away. What version of PHP do you have?
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.