Magento: Transfer from live to local

a 夏天 提交于 2019-12-10 11:16:38

问题


I'm making my development backup of the live Magento website, so far I did the following:

  • created mywebsite.local virtual host
  • copied all files from live server to local machine
  • imported dump database
  • changed the etc/local.xml database parameters
  • replaced all rows in core_config_data containing mywebsite.com into mywebsite.local
  • deleted all contents under VAR

The thing is - when I go to mywebsite.local it redirects me to mywebsite.com. This happens in the index.php file, exactly on the Mage::run line. I tried turning off all htaccess rewrite rules, it doesn't help so that's not the problem.

What am I missing?


回答1:


The Magento cache also needs to be flushed, it can be done using the following script

 require_once 'app/Mage.php';
 $app = Mage::app();

  echo "<pre>";
  if($app != null) {
       echo "The app was initialized.\n";
       $cache = $app->getCache();
       if($cache != null) {
               echo "The cache is not empty. Clean it.\n";
               $cache->clean();
        }  
   } 



回答2:


You need to make sure that you changed all the urls in the core_config_data table. the url values can be stored multiple times.

Do a db query like this to make sure you get them all

SELECT * FROM `core_config_data` WHERE `path` LIKE '%base_url%'

Also check you .htaccess file to make sure you are not rewriting requests to the old url




回答3:


go to your local host database and go to core_config_data change base url to your localhost url



来源:https://stackoverflow.com/questions/7726084/magento-transfer-from-live-to-local

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!