Search code examples
wordpressmamp

moving WordPress over to domain, after working on it locally through MAMP


I've finished the styling changes on WordPress and I'm ready to move it from MAMP to my domain.

Will this involve any changes to the WordPress files or can I just drag it over to my new domain once I purchased it?


Solution

  • The main start you must make is update your wp-config.php

    define('WP_HOME','http://www.mynewdomain.com');
    define('WP_SITEURL','http://www.mynewdomain.com');
    

    That way wordpress knows what domain it MUST run from.

    The reason you do that is because without this you may not be able to access admin, login, etc etc.

    When this is working and you have logged in, go to wp-admin and go to your permalink settings.

    Make a NOTE of your settings, then change them to default (and woocommerce settings etc).

    Go to your home page and a few others, and notice how messed up your urls look :)

    Now go back to permalink settings and restore them (the point of this is to make sure your .htaccess file that wordpress depends upon is set correctly)

    Finally, have a look at https://github.com/veloper/WordPress-Domain-Changer to change your sql etc if needed.

    note this method is very handy for developers so you just update your wp-config.php for localhost or development or production (not for testing purposes, don't use your local pc. copy it all up to a subdirectory of your hosting partner e.g. http://www.mynewdomain.com/mytestarea. Make sure you use a COPY of the mysql database (never point both to the same database). You now can test on the hosting platform without disturbing the live site or your development causing issues to other people.