开发者

Magento: Transfer from live to local

开发者 https://www.devze.com 2023-04-12 00:23 出处:网络
I\'m making my development backup of the live Magento website, so far I did the following: created mywebsite.local virtual host

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 htacc开发者_Go百科ess rewrite rules, it doesn't help so that's not the problem.

What am I missing?


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();
        }  
   } 


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号