Jump to content
Jan Zonjee

[Contribution] Database Manager

Recommended Posts

Now in your contribution i have to upload a new admin/includes/languages/english/backup.php file, but this does not have the change in it anymore

for the Auto Backup Install V3.0 to work.

 

Is it safe just to change this line again after i uploaded your admin/includes/languages/english/backup.php file?

 

Or can this cause mailfunctioning?

The purpose of the language files is just to be able to use different languages with one "code" file so you seldom get errors with changes in language files. You should be safe changing this line again in the language file that came with the contribution.

Share this post


Link to post
Share on other sites

Thanks for your quick answers,

 

I asked this question just to be sure, but now i see it cant do any damage, it works good, i tested it.

 

better safe then sorry :)

Share this post


Link to post
Share on other sites

I've tested this class: http://www.phpclasses.org/package/4017-PHP-Backup-large-MySQL-databases-into-multiple-files.html

That's not a good solution. That has a problem with null and empty inputs ''. But like "idea" really it's very good.

Never seen it and I the site didn't open this moment so it will have to wait.

 

I didn't find the new version or documentation for XT-Dump. Because there is no site of the creator : http://dreaxteam.free.fr/ now.

True, but a newer version I saw can be found here.

 

I also found a bug (and maybe in osC v2.3.1.- I didn't check) in your addon with my mysql partitions (partition option of mysql).

I don't know what you mean with that. Please clarify what you mean with mysql partitions (haven't googled for it).

Share this post


Link to post
Share on other sites

I have some questions:

 

-Do you think to update this addon for osCommerce v2.3.x (ereg_replace, template_top.php , template_bottom.php etc...)?

Haven't written a line of code in months. Too busy and too lazy.

 

-Do you think to develop the script as AutoBackup Script with some available options like:

***AutoBackup DB ( 1-24 hourly, daily, weekly, monthly)

As far as I know "spooks" already did an auto-backup contribution.

 

-Including BigDump and XT-Dump(I can't find) updates.

BigDump was very recently uploaded I think (Restore Database with Browser). Haven't looked at updates of those two.

Share this post


Link to post
Share on other sites

mysqldumper does a great job of backing up and restoring large databases. Backups can run manually or from a CRON job. It's free/open source of course.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Uploaded New Version 1.5 (Complete Package)

 

Modified layout for 2.3.x,

Moved & modified download function,

Added download(display) plus deletion of log files if found in folder,

Added ability to email backup files,

Replaced any depreciated functions.

A few other minor display modifications.

 

This version is also compatible with osC 2.2 and lower

 

Log files are produced by Auto Backup Database ( http://addons.oscommerce.com/info/8374 )

which will create automatic backups periodically that are compatible with Database Backup Manager.


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.

Share this post


Link to post
Share on other sites

That was quick! :thumbsup:

The file size that I tried to email is 9.28MB and I'm receiving the following error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 13150833 bytes) in /home/xxx/zzz/admin/includes/classes/class.smtp.php on line 368


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

I should also mention that the memory_limit is 64M so why am I receiving the error while trying to send only 10MB?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

I`ll look into it, however I didn't write phpMailer just the interface.

 

Could you say if the file is compressed or not.


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.

Share this post


Link to post
Share on other sites

Yes, the file that I'm trying to email is compressed - db_xxx_zzz-201203140434.sql.gz - 9.12MB. My host confirmed that the script command is using more than the 64MB allocated and hence I see the error.

Edited by mr_absinthe

Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

@mr_absinthe

 

Yes there is a bug in phpMailer which appears to be decompressing the file nu-neccessarily, I`ll look at what options are to avoid.

 

In the meantime you could try increasing the limit for the process by adding to mail_backups.php the line ini_set('memory_limit','128M'); near the beginning.


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.

Share this post


Link to post
Share on other sites

@mr_absinthe

 

Further checks reveal the issue to be related to file encoding and phpMailer is requiring approx 10 x file-size of attachments (memory).

 

I don't have time to debug phpMailer & will release a modified version simply using the mail function, however there will still be a memory cost, as even then the encoding will require approx 5 x file-size.

 

With mail you may have issues with php.ini settings post_max_size and upload_max_filesize if your files are larger plus your mail server may have a set limit on message_size_limit


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.

Share this post


Link to post
Share on other sites

Thank you for taking time to have a look at it. I have a limit of 64M for both post_max_size and upload_max_filesize, therefore it should be just about OK. Not sure about the message_size_limit but I guess it could be similar. Pity about the phpMailer.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Thank you for taking time to have a look at it. I have a limit of 64M for both post_max_size and upload_max_filesize, therefore it should be just about OK. Not sure about the message_size_limit but I guess it could be similar. Pity about the phpMailer.

 

Also, it appears that there might be more hidden problems as a part of the phpMailer, particurarly in the class.smtp.php as I'm receiving the following error while trying to send order status change from admin:

Fatal error: Call to undefined method email::connected() in /home/xxx/yyy/admin/includes/classes/class.smtp.php on line 117

 

I have therefore switched back to previous version of the class.smtp.php and the error that I'm receiving now after hitting email button in Database Backup Manager is this:

Fatal error: Call to undefined method smtp::Connected() in /home/xxx/yyy/admin/includes/classes/class.phpmailer.php on line 780

Edited by mr_absinthe

Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

there is a newer version of the phpMailer at:http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list however it is throwing the same error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 12980575 bytes) in /home/xxx/yyy/admin/includes/classes/class.smtp.php on line 370


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

@mr_absinthe

 

post_max_size and upload_max_filesize limits do not actually apply, they were causing problems for me under LAMP, but on a true server they don't, their defaults are 2M & 8M, I doubt your host defaults to much higher. message_size_limit will apply, but its normally defaulted at 50M.

 

64M is very low for a max limit on memory, its OK for master value but you should be able to increase through ini_set If that is the absolute max does your host have too many domains on the server? any more than a few hundred, find a better host. The hosts I usually use have a default of 48M, but I can increase that to at least 512M (I think the max is 1GB, but I`ve not tested that far or needed to).

 

Note: You can increase with ini_set('memory_limit','256M'); and ini_get('memory_limit'); will return the same, but that does not mean you actually have that available, you must do usage tests to find that.

 

 

Re class.smtp.php, that's not a 1.3.1 file, do you know what contribution added it?

 

 

 

My plan is to use the pear class for smtp and revert to mail if that's not available, though mail has security issues which is why I used phpMailer

Edited by spooks

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.

Share this post


Link to post
Share on other sites

OK, getting somewhere...

After adding ini_set('memory_limit','256M'); to includes/mail_backups.php, I'm able to email the backup file IF I'm using the class.smtp.php file from V_1_5. However, with this class.smtp.php file, I'm unable to send emails (admin->Tools->Send Email) nor I'm able to send change of order status, receiving this error: Fatal error: Call to undefined method email::connected() in /home/xxx/yyy/admin/includes/classes/class.smtp.php on line 117

The problem is probably causing the contribution http://addons.oscommerce.com/info/901 that contains the class.smtp.php file.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

@mr_absinthe

 

Solution to that is to rename class.smtp.php to mailclass.smtp.php then change line 702 of class.phpmailer.php to require_once $this->PluginDir . 'mailclass.smtp.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.

Share this post


Link to post
Share on other sites

Thank you, that works fine as a temporarily solution - I'll have to remember to keep an eye on that line with every update of the contribution. Is there a chance that the backup file could be sent automatically (cron job)?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Uploaded new version 1.5.1 :D

 

Removed phpMailer class due to excessive memory usage when emailing backups, email function now uses pear class or if that's un-available the standard php mail function.

 

 

This version is compatible with osC 2.3.x and below

 

 

If pear fails & you wish to use, ask your host to add pear mail with smtp & mime classes.


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.

Share this post


Link to post
Share on other sites

Would it be possible to have the backup file emailed automatically without the need hitting the email button?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

@mr_absinthe

 

Possible on next update of auto-backup

 

Have you tried the latest with this, if so did you use there pear option?


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.

Share this post


Link to post
Share on other sites

I've tested the latest, not sure what this line does (clicking the link does nothing):

$test = '<a href="' . tep_href_link(FILENAME_BACKUP, 'test=at_backup' . $listing_link) . '">Auto</a>';

This was the output message:

Warning, PEAR Mail not found or insufficient to email backup, reverting to standard mail function.

Backup db_file_201203271645.sql.gz sent by email OK

 

The file was received just fine... Unfortunately the file is corrupted, tested in Directory Opus as well as in WinRAR - ! C:\Users\User\Downloads\db_file_201203271645.sql.gz: The archive is either in unknown format or damaged.

 

When I download the same file directly from the Manager, I can extract it just fine.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

@mr_absinthe

 

$test = '<a href="' . tep_href_link(FILENAME_BACKUP, 'test=at_backup' . $listing_link) . '">Auto</a>';

 

It got left in by mistake,

:blush: its for testing auto backup, which will display a notification on click if you have the latest, the same link is used in the setup.Just change the line to

$test = '';

Warning, PEAR Mail not found or insufficient to email backup, reverting to standard mail function.

 

assuming you pear is good, there's a typo in the mail_backups.php file, sorry :unsure: in the latest auto-backup release (not in database backup manager release)

line 42 has:

if ( @include_once('Mailk/mime.php') )

It should be:

if ( @include_once('Mail/mime.php') )

 

Re corrupt files, I have not been able to duplicate, tested under Linux and winxp with 7zip & ultimate zip (I believe WinRAR can be a bit finicky)

from two different servers.

 

As the files is fine except after emailing I would bet its Windows failing to understand headers

 

Try changing line 27 in mail_backups.php

 

from:

$lf = "\n";

to:

$lf = "\r\n";


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.

Share this post


Link to post
Share on other sites

OK, I've updated also the Auto Backup release and all files related to the backup manager have been overwritten. The update was OK - Installation successful, setup has past all checks OK! I've double checked that line 27 in mail_backups.php reads:

$lf = "\r\n";

and also the line 44 is:

if ( @include_once('Mail/mime.php') )

 

After hitting the e-mail button, I receive this message:

Warning, PEAR Mail not found or insufficient to email backup, reverting to standard mail function.

Backup db_file_201203280928.sql.gz sent by email OK

 

Unfortunately, the emailed file is still corrupted - I was unable to open it using 7zip nor winRAR. The file that I've downloaded directly from the manager is fine. I've also noticed that there is a difference in size of these two files:

 

emailed: sql.gz 870 KB

downloaded: sql.gz 644 KB


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×