Jump to content
Jan Zonjee

[Contribution] Database Manager

Recommended Posts

hello

 

i've installed this great contribution and everything seems to working fine, but when i try to send the backup file via email, i'm getting this message:

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

what am i doing wrong, can you help me to get it running?

 

andrea

osc 2.3.1 / database backup manager 1.5.2.1 sorry

Share this post


Link to post
Share on other sites

Hi, Thank you for yet another very helpful contribution - non zipped backups seem to be less than half the size of those from the standard osc backup and the option to backup/restore selected tables is very useful.

 

Sorry fot the trivia, but is line 190 of backup.php correct? if (!fp) { die ("No file handle open."); }

 

Should it be if (!$fp)?

 

The script ID reads v 1.5.1 though I believe it is the lastest 1.5.2

 

It's probably no too important, unfortunately I don't know/understand enough to be leave/change it.

 

Many thanks

Share this post


Link to post
Share on other sites

Uploaded new version 1.5.2

 

 

Hi Sam,

 

I'm using your latest version, and I think I found a bug:

If a product model starts with 0, when we restore the database, the product model looses the starting 0. I checked the SQL and the correct product model is there, so the problem should be the database restore...

 

For example, if the product model is 012345, when we restore the database it will become 12345.

 

Can you have a look? I tried to check the code but I don't understand where the issue is...

 

Br

Share this post


Link to post
Share on other sites

Used this to great effect on my RC2a store. Now I have installed it in my test 2.3 store and the backups it creates do not contain the Create Table command after the Drop table if exists command. I have this on a local host. Extract of backup below. The RC2a local host version still works correctly. Any ideas please. Martin

# Backup Date: 12/08/2013 11:02:32
# Backed up tables: action_recorder, address_book, address_format, administrators, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, geo_zones, information, information_group, languages, manufacturers, manufacturers_info, newsletters, orders, orders_products, orders_products_attributes, orders_products_download, orders_status, orders_status_history, orders_total, products, products_attributes, products_attributes_download, products_description, products_images, products_notifications, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sec_directory_whitelist, sessions, specials, tax_class, tax_rates, whos_online, zones, zones_to_geo_zones
drop table if exists `action_recorder`;
;
insert into `action_recorder` (`id`, `module`, `user_id`, `user_name`, `identifier`, `success`, `date_added`) values ('1','ar_admin_login','0','mhvideos','','0','2013-12-03 15:31:29'),
('2','ar_admin_login','0','mhvideos','','0','2013-12-03 15:31:39'),
('3','ar_admin_login','0','mhvideos','','0','2013-12-03 15:35:30'),
('4','ar_admin_login','0','mhvideos','','0','2013-12-03 15:35:53'),
('5','ar_admin_login','2','mhvideos','','1','2013-12-03 16:04:00'),
('6','ar_admin_login','0','mhvideos','','0','2013-12-06 17:29:12'),
('7','ar_admin_login','2','mhvideos','','1','2013-12-06 17:29:37'),
('8','ar_admin_login','2','mhvideos','','1','2013-12-06 18:01:32'),
('9','ar_admin_login','2','mhvideos','','1','2013-12-08 10:23:47');
drop table if exists `address_book`;
;
insert into `address_book` (`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firstname`, `entry_lastname`, `entry_street_address`, `entry_suburb`, `entry_postcode`, `entry_city`, `entry_state`, `entry_country_id`, `entry_zone_id`) values


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.4.0) here.

Share this post


Link to post
Share on other sites

Used this to great effect on my RC2a store. Now I have installed it in my test 2.3 store and the backups it creates do not contain the Create Table command after the Drop table if exists command. I have this on a local host. Extract of backup below. The RC2a local host version still works correctly. Any ideas please. Martin

 

He posted a link to a version specific to 2.3 one page back in this thread, I believe. Maybe you should check there. Perhaps there are additional changes for 2.3 that you will not find in the 2.2 thread...

Edited by kru

Add-Ons personally installed:

Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --
Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --
htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --
Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-Ons installed by others:

View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields

Share this post


Link to post
Share on other sites

Hello:

My problem is that it gives me the following error when trying to install and make a copy of the database. The version I am using oscommerce is v2.3.3.4 :

Thanks for the help

Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/www/xxxx.com/admin/backup.php on line 210

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/xxxx.com/admin/backup.php on line 183

 

Warning: Cannot modify header information - headers already sent by (output started at /home/www/xxxx.com/admin/backup.php:210) in /home/www/xxxx.com/admin

/includes/functions/general.php on line 38

Edited by Cheloki

Share this post


Link to post
Share on other sites

Hello:

My problem is that it gives me the following error when trying to install and make a copy of the database. The version I am using oscommerce is v2.3.3.4 :

Thanks for the help

Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/www/xxxx.com/admin/backup.php on line 210

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/xxxx.com/admin/backup.php on line 183

 

Warning: Cannot modify header information - headers already sent by (output started at /home/www/xxxx.com/admin/backup.php:210) in /home/www/xxxx.com/admin

/includes/functions/general.php on line 38

 

 

I am having the same issue.  This happened when we made the upgrade to php 5.5.  Any ideas?

Share this post


Link to post
Share on other sites

You need to upgrade the contribution to work with 5.5.

 

The functions to access the db have changed.

 

HTH

 

G


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites

Hello,

 

I have a problem with restoring a previously saved database. It only gives the message below:

 

1065 - Query was empty

;

[TEP STOP]

Also, when I click Email button, it gives the message below. No email is sent.

 

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

success.gif Backup db_201412201511.sql sent by email OK

How can I fix it?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

@fourmat and

@Cheloki

 

catalog\admin\includes\functions\db_backup.php

 

find line 34: 

 
    if (strlen($a_name) && $a_name !== '*') {
        return '`' . str_replace('`', '``', $a_name) . '`';
 
Replace by:
 
 
    if (  is_string($value) && (strlen($a_name)) && $a_name !== '*') {
        return '`' . str_replace('`', '``', $a_name) . '`';
Edited by 4vrij

Share this post


Link to post
Share on other sites

@fourmat and

@Cheloki

 

And in catalog\admin\backup.php

 

line 108

        $strlener_of_tables_backed_up_now = 0;

to
        $counter_of_tables_backed_up_now = 0;
 
line 138
        $no_of_tables = strlen($tables);
        $no_of_tables_for_backup = strlen($_POST['dbtable']);
to
        $no_of_tables = count($tables);
        $no_of_tables_for_backup = count($_POST['dbtable']);
 

Share this post


Link to post
Share on other sites

Everything looks like it's working except for the restore function. When I select the file which I would like to restore and press restore I get the following error :

 

1064 - 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 ')' at line 1

);

[TEP STOP]

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

×