Been tearing my hair out for 24 hours about how to copy a Magento site from one server to another so thought I should document it. It got so bad that I ended up trying to just install a vanilla Magento site, just to prove it runs on these new servers.
To install a vanilla Magento site:
1) Upload the zip of the Magento install pacakage to hosting & unzip in situ
2) Create a blank db (you dont need sample data unless you’re a complete Magento newb)
3) Ask the nice people at Heart Support to allow allow ‘CREATE TEMP TABLE’ permissions on the database (turned off by default for security reasons)
4) Run the magento cleanup file that seems to sort out your permissions nicely (http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions)
5) You should be ready to go to your magento folder in a browser and start running the install
Note: I had a 500 error after the first page (before it asked me the locale questions) but then I went back after 20 mins and it had sorted itself out again (see that why I just dont trust magento!!!)
But saying that I haven’t had any weird 500 errors that I got on 1&1 shraed hosting – so this might be a keeper after all.
Right will post back when I have found out a way of using the working Magento site I have on this new hosting – cos at the moment its just showing a blank screen; no errors, just a white screeen – aaaagh!!
Kudos to this post for pointing me in right direction – but I didn’t need to do all the steps it seems:
http://www.markrushworth.com/install-magento-heart-internet/
UPDATE: Ok my copied Magento site is now working!
Things I had done before:
1) Uploaded & unzip full files from old site
2) Cretead a new MySQL db and exported the SQL dump from old db into it
3) Changed the app/etc/local.xml to reflect the new db name & password
4) Ran the magento-cleanup.php file to set permissions on all files/directories correctly
Things I did to get it to work:
1) Remember I was getting a blank screen? Well I opened the main index.php of the root of Magento and un commented the line
Now when I looked at the site I got the error:
2) I googled this error and found this post:
http://www.magentocommerce.com/boards/viewthread/52785/
Which told me to run the following SQL statements on my database:
UPDATE `core_store` SET `store_id` = 0 WHERE `code` like ‘admin’;
UPDATE `core_website` SET `website_id` = 0 WHERE `code` like ‘admin’;
UPDATE `customer_group` SET `customer_group_id` = 0 WHERE `customer_group_code` like ‘NOT LOGGED IN’;
SET FOREIGN_KEY_CHECKS=1;
3) This seemed to do it – no more error on the index,php page. Although in my case it did keep switching from the subdomain I had installed it into to the main site url. Turns out I had the wrong info in my core_config_data MySQL table (where the URL of the site is stored – I’d moved it into a subdomain amidst all my faffery). However even after I changed this, the site still kept switching back to the old root URL.
4) Then I rememebered about deleteing all the files in the cache folder in the var subdirectory, which I did – and it worked!
Woo hoo! Finally a copy of my Magento site – that I can now use as dev practice site.
Think I need a lie down now….