Call-back icon  Sales: Call 800.374.8146 (N America)|757.278.0920 (International)

Magento

Open Source eCommerce Evolved

Magento Forum

   
Page 1 of 4
Existing DB not working with new install
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Hi all,

I have an existing DB with all the data in it but I cannot get any version of Magento to connect to it. I get 2 kinds of errors depending on what I’ve done.

I will pay for a PHP/DB guru to fix this. Someone who knows what they’re doing should be able to fix it.

Please PM me for more details if you’re interested.

 
Magento Community Magento Community
Magento Community
Magento Community
 
number25
Member
 
Total Posts:  58
Joined:  2008-07-12
 

first of all. are you at installation stage ??

You got to make sure that you have PDO_mySQL enables or mysqli

is this existing data the sample data ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Thanks for replying.

I had the site up and working beautifully so that should all be ok. And no, it was real data added over months so obviously I’m reluctant to re-start.

The errors I get are: something about a sales.quote table missing and there are a few others as well.

It’s like the version I am installing is different to the DB, but I don’t really know how that works. I really need someone to look at it. It may be obvious to someone else.

I basically want an installation of Magento to connect the existing database!! I don’t know why that is so difficult.

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael
Magento Team
 
Total Posts:  576
Joined:  2007-08-31
 

I suppose posting here the full text of error messages you got will let anybody to help you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Hey Michael, thanks.

I have posted them in other posts with no responses.

I’m doing a fresh install now and will take notes.

I’m installing the lastest stable release (4) and what I intend to do and had done successfully before (but problaby the same release) is put my local file from etc (from the old install) in the new etc folder. The DB is from an earlier version and they’re not compatible (the error was that I was missing a table sales.quote if I recall).

Can you advise a better way to do this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Ok Michael - I re-installed the version .4 and the backend looks great and this is the error I’m getting on the front -

I PRAY you can help me. smile Thanks for taking the time.

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘spoiltro_magento.sales_quote’ doesn’t exist
Trace:
#0 /home/spoiltro/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/spoiltro/public_html/lib/Zend/Db/Adapter/Abstract.php(406): Zend_Db_Statement->execute(Array)
#2 /home/spoiltro/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query(Object(Varien_Db_Select), Array)
#3 /home/spoiltro/public_html/lib/Zend/Db/Adapter/Abstract.php(636): Zend_Db_Adapter_Pdo_Abstract->query(Object(Varien_Db_Select), Array)
#4 /home/spoiltro/public_html/app/code/core/Mage/Checkout/Model/Mysql4/Cart.php(58): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#5 /home/spoiltro/public_html/app/code/core/Mage/Checkout/Model/Cart.php(546): Mage_Checkout_Model_Mysql4_Cart->fetchItemsSummary(NULL)
#6 /home/spoiltro/public_html/app/code/core/Mage/Checkout/Helper/Cart.php(127): Mage_Checkout_Model_Cart->getSummaryQty()
#7 /home/spoiltro/public_html/app/code/core/Mage/Checkout/Block/Links.php(33): Mage_Checkout_Helper_Cart->getSummaryCount()
#8 /home/spoiltro/public_html/app/code/core/Mage/Core/Model/Layout.php(319): Mage_Checkout_Block_Links->addCartLink()
#9 /home/spoiltro/public_html/app/code/core/Mage/Core/Model/Layout.php(195): Mage_Core_Model_Layout->_generateAction(Array, Array)
#10 /home/spoiltro/public_html/app/code/core/Mage/Core/Model/Layout.php(187): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#11 /home/spoiltro/public_html/app/code/core/Mage/Core/Model/Layout.php(191): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#12 /home/spoiltro/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(278): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#13 /home/spoiltro/public_html/app/code/core/Mage/Cms/Helper/Page.php(76): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#14 /home/spoiltro/public_html/app/code/core/Mage/Cms/controllers/IndexController.php(26): Mage_Cms_Helper_Page->renderPage()
#15 /home/spoiltro/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(342): Mage_Cms_IndexController->indexAction(Object(Mage_Cms_IndexController), ‘home’)
#16 /home/spoiltro/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(159): Mage_Core_Controller_Varien_Action->dispatch()
#17 /home/spoiltro/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Standard->match(’index’)
#18 /home/spoiltro/public_html/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch(Object(Mage_Core_Controller_Request_Http))
#19 /home/spoiltro/public_html/index.php(40): Mage::run()
#20 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Guru
 
Avatar
Total Posts:  412
Joined:  2007-11-07
Scottsdale, AZ
 

Could you give a step-by-step of how you installed Magento (full, downloader, SSH, sample data, etc.), and what you did after it was installed? I’ve seen that error before, but I would need to know exactly how you set this up to know what is causing this.

 Signature 

Crucial Web Hosting
Are you ready to Split-Shared™ hosting?
Magento Containers lets you run your business, we’ll do the rest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Hey Crucial… That’s promising, thanks! smile

Ok,

1. Downloaded full package (ver 1.0.19870.4 - Added June 18, 2008)
2. Extracted to desktop and uploaded via FTP
3. Ran the browser installation wizard
4. Put in the DB details for the existing DB (which has 188 tables)
5. All went through, backend has all my products, haven’t touched anything since.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ramedia
Member
 
Total Posts:  67
Joined:  2008-05-17
 

Crucial knows more than I but I can suggest this:

1. Downloaded full package (ver 1.0.19870.4 - Added June 18, 2008)
2. Extracted to desktop and uploaded via FTP
3. Ran the browser installation wizard
4. Put in the DB details for a new clean database.
use phpmyadmin to drop the tables in the newly created database.
export your old database.
import your old database into this new database.

Sometimes when you run an install it will overwrite tables in a currently existing database.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Guru
 
Avatar
Total Posts:  412
Joined:  2007-11-07
Scottsdale, AZ
 
lindaw - 22 July 2008 04:22 PM

4. Put in the DB details for the existing DB (which has 188 tables)

Ok, that’s what I figured was happening here. I can provide instructions (or do it myself) on how you should be installing Magento with an existing database, but only if you have SSH access. It’s just too much of a hassle to do this without SSH.

 Signature 

Crucial Web Hosting
Are you ready to Split-Shared™ hosting?
Magento Containers lets you run your business, we’ll do the rest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Hey Crucial - THANKYOU!

I have SSH and would be happy with either… If you want to minimise hassle, I’m happy for you to do it or you can post instructions and I can give it a go. I’m not overly familiar with SSH tough and would need “type this” instructions. smile

ramedia - Thank you too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Guru
 
Avatar
Total Posts:  412
Joined:  2007-11-07
Scottsdale, AZ
 

I’ll give you the rundown though. For the sake of these instructions, I’ll assume you’re theme is in the default interface directory and the theme name is default.

1. Archive your theme in the app directory:

cd app/design/frontend/default/
tar -cvvf app.tar default/
mv app.tar ../../../../
cd ../../../../

2. Do the same thing for the skin directory:

cd skin/frontend/default/
tar -cvvf skin.tar default/
mv app.tar ../../../
cd ../../../

Now you should have an app.tar and skin.tar file in the root directory where Magento is installed.

3. Put the media directory in a tar file:

cd media/
tar -cvvf media.tar *

4. Now we need to create a MySQL dump file of the current database (the one that works, not one you’ve tried to upgrade with):

mysqldump -h DBHOST -u DBUSER -pDBPASS DBNAME data.sql

5. Create a folder to put these files, and then place them in there:

mkdir backup/
mv app.tar skin.tar media.tar data.sql backup/

6. Then move the backup directory above the Magento directory until we need it:

mv backup ../

7. Remove all the Magento files so we can start fresh:

rm -rf *

8. Copy the files we put in the backup folder back in the directory where we’re going to install Magento:

cp -../backup/app.tar ../backup/skin.tar ../backup/media.tar ../backup/data.sql .

9. Install the latest stable release of Magento, without sample data, in to a clean MySQL database:

wget http://www.magentocommerce.com/downloads/assets/1.1.2/magento-1.1.2.tar.gz
tar -zxvf magento-1.1.2.tar.gz
cd magento
mv 
* .htaccess ../
cd ..
chmod o+var var/.htaccess app/etc
chmod 
-R o+w media
./pear mage-setup .
./
pear install -f magento-core/Mage_All_Latest-stable
rm 
-rf magentomagento-1.1.2.tar.gz

11. Move the theme and media files back in place:

mv app.tar app/design/frontend/default/
cd app/design/frontend/default/
tar -xvvf app.tar
rm 
-rf app.tar
cd 
../../../../

And the one in the skin directory:

mv skin.tar skin/frontend/default/
cd skin/frontend/default/
tar -xvvf skin.tar
rm 
-rf skin.tar
cd 
../../../

Lastly, the media files:

mv media.tar media/
cd media/
tar -xvvf media.tar
rm 
-rf media.tar
cd 
../

12. Run through the web-based installer and go to the store frontend to make sure Magent works. Your theme and media files and everything else shouldn’t show up, this is a clean install still.

13. After you’ve ran through the web-based installer, we’re going to import your database into the fresh one:

mysql -h DBHOST -u DBUSER -pDBPASS DBNAME data.sql

Replace the uppercase items with the appropriate information.

14. Delete the cache and session data:

rm -rf var/cache/ var/session/

15. And double check permissions:

chmod -R o+w media
find 
. -type d -exec chmod 777 {} \;

16. Have a beer and pat yourself on the back.

 Signature 

Crucial Web Hosting
Are you ready to Split-Shared™ hosting?
Magento Containers lets you run your business, we’ll do the rest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Guru
 
Avatar
Total Posts:  412
Joined:  2007-11-07
Scottsdale, AZ
 

By the way, those instructions were from the top of my head, and I don’t know if some of my code was stripped, I tried my best to review it and had to write some of the commands out in a “long” method because some of my code was cut, so...just keep that in mind.

If you’re still unable to get it working, send me a PM if you want with your username/password to SSH and I can look into this for you.

 Signature 

Crucial Web Hosting
Are you ready to Split-Shared™ hosting?
Magento Containers lets you run your business, we’ll do the rest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Thanks crucial.... I am going to try and do this myself thanks so much for the help… Have worked out most little things, but where can I find the data.sql directory in order to put it in the backup folder? Have successfully done the others.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Found it—in the root directory. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  128
Joined:  2007-12-25
 

Hey Crucial,

Sorry, my post didn’t post and I just pm’d you - problems were -

Everything went well up to installation -

Front end had another table error (different one)
Backend was fine (with my data) but admin menus weren’t working (this happens every time and I know how to fix)

COntinued instructions and checked permisssions - then got an internal server error - which have also had before but this time the index.php file WAS 644 so that can’t be it.

This is where I’m up to and I’ve pm’d you my details.

Thanks for all the help, especially the SSH walkthrough, I think that will help a lot of SSH noobs.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 4
 
Sales: Call 800.374.8146 (North America) 757.278.0920 (International)
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
33557 users|292 users currently online|74505 forum posts