Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento upgrade from 1.3 to 1.7 - Error : Base table or view already exists: 1050 Table ‘core_variable’ already exists. 
 
alimalik
Jr. Member
 
Total Posts:  3
Joined:  2012-01-23
 

Hi,

I am trying to update magento from 1.3 CE to 1.7 CE and I am getting the following error Base table or view already exists: 1050 Table ‘core_variable’ already exists. I will really appreciate if some one can help me in fixing this error. I know this question have been asked before but none of the answers worked for me.

More Info:
I am working on several local copies of magento 1.7. One I installed and then tried to link up with the dump of my database (using local.xml) while other I am trying to install using another version of my database dump but I am having no luck. I also tried magento tool for fixing database but that didn’t worked. In all the above cases I am getting the same error.

Its really important for me to update my database as soon as possible so I will appreciate any help.

Thanks in advance,
am

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageClub
Guru
 
Avatar
Total Posts:  386
Joined:  2009-07-25
India
 

Check what file, it shows the errors on the error screen.

Rename that file and see, if the upgrade proceeds to the next step.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alimalik
Jr. Member
 
Total Posts:  3
Joined:  2012-01-23
 

Hi MageClub,

Thanks for your reply I did as you suggested while installation I renamed the file associated to error. The installation went fine but I cant view front end the error I am getting when I am trying to view front end is as follows (useLoadDataFields() on a non-object in /app/code/core/Mage/Eav/Model/Config.php on line 619).

I can view admin area and my products but I cant view my order history and customers. When I tried to go to view customers I am getting the following error (_resource_singleton/customer/customer_address” already exists”;i:1;s:7013:). When I try to go to sales->orders its empty and if I click on create new order I get the following error (_resource_singleton/customer/customer_address” already exists”;i:1;s:9593:).

I have no idea how to fix these errors any help with be appreciated.

Thanks in advance,
am

 
Magento Community Magento Community
Magento Community
Magento Community
 
hillzzz
Jr. Member
 
Total Posts:  8
Joined:  2009-01-30
Southampton UK
 
alimalik - 01 August 2012 02:11 AM

Hi MageClub,

Thanks for your reply I did as you suggested while installation I renamed the file associated to error. The installation went fine but I cant view front end the error I am getting when I am trying to view front end is as follows (useLoadDataFields() on a non-object in /app/code/core/Mage/Eav/Model/Config.php on line 619).

I can view admin area and my products but I cant view my order history and customers. When I tried to go to view customers I am getting the following error (_resource_singleton/customer/customer_address” already exists”;i:1;s:7013:). When I try to go to sales->orders its empty and if I click on create new order I get the following error (_resource_singleton/customer/customer_address” already exists”;i:1;s:9593:).

I have no idea how to fix these errors any help with be appreciated.

Thanks in advance,
am

I have upgraded from 1.4.0.1 to 1.7.0.2 and got lots of database errors similar to yours. So I found this SQL script and if you run it on the database it should clean up all the errors. Make sure that you clear all the caches and also make sure you work on a copy of the database and not the original.

Good luck:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=’NO_AUTO_VALUE_ON_ZERO’;
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

TRUNCATE `sales_flat_quote`;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_address`;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_address_item`;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_item`;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_item_option`;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_payment`;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;

TRUNCATE `log_customer`;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
TRUNCATE `log_quote`;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
TRUNCATE `log_summary`;
ALTER TABLE `log_summary` AUTO_INCREMENT=1;
TRUNCATE `log_summary_type`;
ALTER TABLE `log_summary_type` AUTO_INCREMENT=1;
TRUNCATE `log_url`;
ALTER TABLE `log_url` AUTO_INCREMENT=1;
TRUNCATE `log_url_info`;
ALTER TABLE `log_url_info` AUTO_INCREMENT=1;
TRUNCATE `log_visitor`;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
TRUNCATE `log_visitor_info`;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
TRUNCATE `report_event`;
ALTER TABLE `report_event` AUTO_INCREMENT=1;

 
Magento Community Magento Community
Magento Community
Magento Community
 
alimalik
Jr. Member
 
Total Posts:  3
Joined:  2012-01-23
 

Hi hillzzz and hitechito,

Thank you for your reply but none of the solutions seems to be working. I am back to the same error I specified in my original post (Base table or view already exists: 1050 Table ‘core_variable’ already exists). I have done every thing I could but no success. Can some one help me please.

Thanks in advance for your help.

Thanks,
am

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

If you look at the complete error report (located in var/reports) you will see a reference to the PHP file which contains the SQL upgrade script. We have fixed many similar errors, but unfortunately it is a time-consuming process. Basically you compare the script with the current state of your database, commenting out part of the script which has already been applied to the database. Then save the file, clear “var/cache” and try refresh your site. Repeat this process until all errors are fixed.

This problem occurs when the upgrade script is interrupted and the upgrade has only been partially applied.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Turnkeye
Enthusiast
 
Avatar
Total Posts:  908
Joined:  2008-12-20
URL: turnkeye.com
 
Sindre|ProperHost - 10 August 2012 02:14 AM

This problem occurs when the upgrade script is interrupted and the upgrade has only been partially applied.

This is the reason of most “duplicate table” errors.

I recommend to run database upgrade using SSH console e.g.: php -f index.php
instead of browser.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

@Turnkeye.com: indeed. I totally agree SSH is the safest way to apply Magento upgrades. Also, I recommend adding a IP block to the .htaccess file allowing only your own IP while performing the upgrade. Otherwise, the first user who opens the website will initiate the database upgrade.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top