0

I am trying to take a live magento installation, pull it down and make a local install work. Here are the steps that I have taken:

  • Pulled down all files from live
  • Exported db from live site
  • Made server in MAMP
  • Imported db through phpmyadmin and changed base urls
  • Updated local.xml w/ localhost root root

Now when I go to the local url I get the contents of the home page w/ all images broken and no css file loading. Any ideas are appreciated.

1
  • Can you navigate to other pages? Mar 20, 2013 at 21:13

4 Answers 4

1

You might also need to update the URLs in cms_page and cms_block tables.

UPDATE cms_block SET cms_block.content = REPLACE (cms_block.content, 'sitename.com', 'sitename.dev');
UPDATE cms_page SET cms_page.content = REPLACE (cms_page.content, 'sitename.com','sitename.dev');

I would assume that you had JS/CSS merging enabled on the live site; make sure that the media folder is writable so the CSS files can be generated or disable the merging.

You should also make sure the you flush the caches, specifically the full page cache as the image URLs would be hardcoded.

3
  • I ran that update for the cms_page and cms_block and deleted everything in var/cache and var/session. I also made /media 777, and still getting the same thing. The favicon is loading but no other assets.
    – Josh Frank
    Mar 20, 2013 at 21:18
  • Hmm... you must have no set the base URLs correct in core_config_data Mar 20, 2013 at 21:23
  • YUP! I forgot to add :8888 to the end of the local URL.
    – Josh Frank
    Mar 20, 2013 at 21:27
1

Here is what you need to check:

  1. Make sure that the web/unsecure/base_url and web/secure/base_url inside the core_config_data table are set to your local urls
  2. Make sure that the media directory is writable by the server in case you do js/css merging
  3. If you are using apache rewrites and not storing your site in the root web directory (i.e. you are storing it at localhost/foo, make sure you have the line RewriteBase /foo/ present and uncommented in .htaccess
  4. Make sure you have cleared the cache
2
  • Do i need to add :8888 to the end of the local url?
    – Josh Frank
    Mar 20, 2013 at 21:20
  • Yes, if this is what you use to access the site on your local Mar 20, 2013 at 21:21
0

I always perform following set of commands while shifting magento store to new location:

Source Server

1> Files Backup

tar -zcvf magento.tar.gz * .htaccess

2> DB backup

mysqldump -u <username> -p<password> <db-name> > <filename.sql>

Note: Be sure you are in the public root dir

Destination server

1> Get files:

wget <http://remoteurl.com>/magento.tar.gz

2> Extract:

tar -zxvf magento.tar.gz

3> Import DB:

mysql -u<username> -p<password> <db-name> < <filename.sql>

4> File/Folder Permissions

chmod o+w var var/.htaccess app/etc
chmod -R o+w media

[if above gives permission error then try below]

chmod -R 777 var
chmod -R 777 var/.htaccess
chmod -R 777 app/etc
chmod -R 777 media

5> Cache Cleaning

rm -rf var/cache/*
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -f downloader/pearlib/pear.ini

6> Configuration Settings
- Edit db configuration in app/etc/local.xml
- Update base url in table core_config_data:

UPDATE core_config_data SET value="http://destination-server.com/" WHERE path='web/unsecure/host';

That's all.
Now you can start browsing your magento store in your new location.

Notes: This is only feasible if your both source and destination server supports SSH.
But overall this will give you a rough idea what operations needs to be carried out while shifting to new server.

Cheers!

0

From experience, you may also find reference to location of css and media directories in core_config_data. Run this sql to check -

SELECT * FROM  `core_config_data` WHERE  `value` LIKE  '%myolddomain%';

Obviously replace "myolddomain" with the actual value of your old domain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.