• Resolved Jane

    (@jstepak)


    I need to migrate a site from one host to another and also change the domain URL that the site will reside at. I have a few basic questions:

    Do I install this plugin on the current site and run it. And then export the database and import to the new host?

    Or do I export the database and import to the new host (and domain). Not sure if I’ll be able to login to the WordPress admin on the new host with the old database and then do the find and replace.

    I feel like a real beginner at this so if would provide the basic steps – and when to run the find and replace when migrating from one host to another and also one domain to another I’d appreciate it.

    Thanks!

    https://wordpress.org/plugins/better-search-replace/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Jane,

    There’s a couple ways to do it but what I’d generally recommend for your situation is this:

    1. Backup the database on your current site
    2. Install the database on your new host
    3. On the new host, define the new site URL in the wp-config.php file, as shown here
    4. Log in at your new admin URL and run Better Search Replace on the old site URL for the new site URL
    5. Delete the site_url constant you added to wp-config.php
    6. Test and make sure everything’s working.

    I hope that clears things up. You can also find more information on moving wordpress here: http://codex.wordpress.org/Moving_WordPress

    Forgot to mention, alternatively you could just change the Site URL in the admin of your old site and then export the database to be able to log into the new site right away, but this would break things on the old site while you did it.

    If that’s not a big deal then it can be easier than the added step of defining the Site URL in the wp-config.

    Thread Starter Jane

    (@jstepak)

    Thanks so much for these steps. This is exactly what I hoped to learn. Now, to execute. 🙂

    Thread Starter Jane

    (@jstepak)

    Thanks for your follow up comment! I actually prefer to keep the site URL on the old site so that I have the option to continue working there. No problem having to define the site URL in the wp-config to have the flexibility of accessing the old and new sites.

    Thread Starter Jane

    (@jstepak)

    In the instructions on updating the wp-config.php file, it says to add the following two lines to that file (where http://www.example.com is the new URL):
    define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    After I run the “Better Search Replace” your instructions say:

    Delete the site_url constant you added to wp-config.php

    My question is: Should I remove *both* lines that I added to the wp-config.php or just the line with the “WP_SITEURL”?

    You can remove both as long as you’ve already updated the URLs in the database. The only reason you really need to remove them is so that they can be edited through the Settings -> General page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need basic steps on how to use’ is closed to new replies.