1

I am trying to migrate a production Wordpress site to a localhost install on MacOS using MAMP pro. What steps do I need to preform to enable this.

I have the data base configured and connecting.

I am able to hit localhost:8888/readme.html and get served the Wordpress readme from Apache.

Unfortunately If I hit http://localhost:8888 or http://localhost:8888/index.php I get a 301 redirect to http://localhost The port is dropped and nothing gets served.

I am unsure where this 301 is coming from and currently blocked on this

Additionally when I access http://localhost:8888/wp-admin I am redirected to the production site at http://www.productiondomain.com/wp-admin

It seems there are multiple steps to consider in this migration and I am looking for a complete answer.

1

Out of the box Mamp runs different ports. Are you able to change it to port 80 or are you restricted to doing that for some reason?

If you are able to, change the port to port 80.

mamp->preferences->ports and change Apache port to 80 and then restart services

UPDATE: For the wp-admin that will be because in your database your site and homepage urls are set to the live version.

You can override it in wp-config.php by adding the following to the bottom of it:

define( 'WP_HOME', 'http://localhost' );
define( 'WP_SITEURL', 'http://localhost' );

OR if you want to edit directly to the database. Go into your local database and go into wp_options and change the options in there for wp_home and _wpsiteurl

  • that works for the root site. Any suggestion for the /wp-admin ? – kevzettler Dec 11 '19 at 3:25
  • Great. Please see the "update" on bold in answer above. I have edited. After making those changes, you may need to open the wp-admin login page in a private browsing window or incognito window or you will have browser cache (it could still redirect you to the live version even after you fix it if you browser keeps the cache of the redirect to live site) – Elgoots Dec 11 '19 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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