Problems with moving my WordPress site to another domain/server

I’m having problems moving a wordpress site from one domain to another. I’ve searched the site but couldn find a useful answer for my situation.

Here’s what i did:

Read More

I made a backup of the website. Then i exported the database.
Then i installed WordPress on the other domain.
Then i copied all my WordPress files of the old website on the new server overwriting the new installation. Then i deleted everything from the database on the new server and imported the database of the old server. Then i changed the database name and bpassword in the wp-config file.

So i did all this but the new site isn’t working, and i don’t know where it went wrong?
So i’d like to start over, but what should i do different?

Thankyou for your help!

Related posts

Leave a Reply

5 comments

  1. You can run these sql queries in phpmyadmin to change URLs in the database after the move for site options, post URLs and URLs in post/page content:

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

    4/22/2014 Edit: this is a much better solution that won’t break PHP serialized data: interconnectit.com WordPress Serialized PHP Search Replace Tool

  2. The main thing you need to do is update 2 fields in the database to the correct domain.

    It can be done a few different ways.

    Method 1:

    Add this line to your wp-config.php file, then visit http://yournewdomain.com/wp-admin.php and log in. This will force the update:

    define('RELOCATE',true);
    

    After you log in, you should remove that line.

    Method 2:

    Add these 2 lines to your theme’s functions.php file found at wp-content/themes/themename/functions.php

    update_option('siteurl','http://example.com/blog');
    update_option('home','http://example.com/blog');
    

    After that, you need to update the GUID for each post. In phpMyAdmin or from the mysql command line issue this:

    UPDATE wp_posts SET guid = REPLACE (
    guid,
    'http://exampleoldsiteurl.com',
    'http://examplenewsiteurl.com');
    

    replace exampleoldsite and examplenewsite with the respective domains.

    All of this info can be found at http://codex.wordpress.org/Changing_The_Site_URL

  3. You will probably need to edit some fields in your database and update the settings in the admin area. There is quite a nice guide here

    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_to_a_New_Server

    I think the easiest way is probably:

    • Install a new WordPress blog
    • Go on old blog Admin panel. Here, in Manage > Export select “all” in menu
      Restrict Author.
    • Click on Download Export File
    • In new blog go on Manage > Import, choose WordPress item.
    • In the page that will be shown, select the file just exported. Click
      Upload file and Import
    • It will appear a page. In Assign Authors, assign the author to users
      that already exist or create new ones.
    • Click on Submit
    • At the end, click on Have fun