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.
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.
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).
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.
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.
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.
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.
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.
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):
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+w var var/.htaccess app/etc chmod -R o+w media ./pear mage-setup . ./pear install -f magento-core/Mage_All_Latest-stable rm -rf magento/ magento-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 {} \;
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.
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.
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.