14
votes

i want a live site to be on local host and without effecting any functionality of live magento site. i have tried many way of doing that but have not get any result from it.

steps i tried are : 1. taken database from magento live site by entering into cpanel(by ftp access) > phpmyadmin > exported all the files to my local machine and i imported all the data to my local phpmyadmin.

2.taken all neccessary files from cpanel > file manager > all files (for example p_html, .htpassword, .trash, access log, etc file and many more) and put it on my local machine and then i put the file in folder and kept it into C:\xampp\htdocs\ all file ( in folder ).

3 Replaced the path of live site with localhost:1234 in the all sql files where applicable taken in step one.

but still not working . Any help will be appreciated....

4
have you clear your cache after installing on local server? and what not working in your case?Mufaddal
What happens when you try to navigate to it? Does it give you an error, redirect or something else?Chris
i actually deleted the cache folder which was in var folder, and i used this(localhost:1234/magentowork/public_html) path on browser to see whether its working or not and its was not working ..... and my directory stucture where i kept the magento file downloaded in step 2 of my question is C:\xampp\htdocs\magentowork\yash
Once again, what happens when you try to navigate to it? Does it give you an error, does it redirect you to another URL or something else?Chris
when i use this url localhost:1234/magentowork/public_html it give this error: Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500 localhost Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7yash

4 Answers

19
votes

Copy your LIVE Magento store to your Local computer:

  1. Download the magento files using any ftp client.
  2. Export the database from live server.
  3. Put the downloaded Magento files in your localhost root folder.
  4. Create a blank database(lets say it 'local-database') in your local computer and import the database backup that you exported from the live one.
  5. Delete/Rename the file app/etc/local.xml
  6. Re-install the Magento using the local-database.
  7. After installation, go to Admin section and then

(i)Flush all cache. (ii)Re-Index all data. (iii)Flush all cache.

That's it. You are done.

N.B. If you have domain specific Modules installed, those modules will not work here.

Seems very simple right. Believe me, it is that simple.

If you face any problem in installing your Magento in localcomputer, here is a post that may come in handy: http://www.insync.co.in/how-to-install-magento-on-wamp-server-localhost-localcomputer/

3
votes

Steps:

  1. Download the files to the local project folder.
  2. Create a new local DB and import the live database backup/dump.
  3. Update app/etc/local.xml file with local DB parameters(Host name, DB name, DB username, DB password)
  4. Magento have the project URL saved in 2 places(secure URL and unsecure URL) in the table core_config_data. We need to update that in imported local DB to the local URL(9th and 10th record in the table).
  5. Delete the cache: Delete the contents in var folder(That folder contains reports and logs too. I assume that you won't need it as this is a separate installation)

The local copy will most probably work by now but there are possibilities that it would not. Things to do in this case:

  1. If you are getting redirected to the live site, check the .htaccess file for redirects(For various reasons there may be a redirect defined in the file)
  2. If you are getting forbidden error, this will come in handy(Usually occurs in linux systems)

There may still be some problems probably theme or module specific. In this case you will need to debug the project and find out what the problem is. Xdebug will come in handy in this situation for boosting the debug process :)

Subrata's solution will conflict with some of the Magento Modules installed and will not allow you to re-install Magento in local. I follow these steps and everything works fine.

1
votes

Just give a permission (0777) after take a backup to that folder in your local PC

0
votes

First of all you will have to change the secure and unsecure base_url in your database. These can be found in the 'core_config_data' table. Paths:
web/unsecure/base_url
web/secure/base_url

If you want to access your local version of Magento via localhost, you'll have to set localhost as your base_url.

After that you need to clear your cache folder.

EDIT:
To install and run Magento on your local PC using XAMPP, please follow these steps: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/installing_on_windows_with_xampp_and_wamp