• Hi,

    I am trying to solve a problem with a domain I’ve moved to a new hosting provider. I copied all the website files and the db to a new server, but site didn’t start. I realised that I forget to migrate the database, I tried to change manually the new server path in the database via phpmyadmin. I searched for the old path and I found 5 places in the wp_option where it exists. I changed it, but the website didn’t start.

    Could you tell me what should I do? The site domain is the same just server provider changed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • domain I’ve moved…website files and the db

    tried to change manually the new server path in the database…5 places

    I do not know how many places might need to be changed, but this is how I do that:

    UPDATE pref_options SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE pref_posts SET guid = replace(guid, 'http://www.olddomain.com', 'http://www.newdomain.com');
    UPDATE pref_posts SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');

    note: Edit ‘pref’ (three places) to correct table_prefix and change ‘http://www.olddomain.com’ and ‘http://www.newdomain.com’ as required (three places each and with no trailing slashes)

    Also, be certain wp-config.php has the correct database name, table_prefix, SQL username and password.

    Thread Starter Martin Kilarski

    (@kmarcink)

    Thank you for sharing this with me.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘migrating a database after moving a domain’ is closed to new replies.