0

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:

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!

4 Answers 4

2

Are you moving WP to new server and domain or new server only? I mean will URL remain the same or will be changed?

There are several things that can go wrong and it is hard to say from details you provided.

Basically:

  • there might be something wrong with your new WP installation, had you just tried clean empty install of WP?
  • there might be something wrong with database move and/or configuration.

See Moving WordPress to a New Server in Codex for general info.

1
  • I also did a search and replace, but didn't work. It is to a new domain. A clean empty install worked, but as soon as i overwrite it with the other files it breaks, and even after importing the old sql file.
    – user1829
    Commented Dec 6, 2010 at 14:25
2

but as soon as i overwrite it with the other files it breaks...

What exactly does that mean? When you overwrite the old theme with the new theme? Do you have hardcoded URLs in the theme that you moved?

When moving a database from one domain to another (in addition to reading See Moving WordPress « WordPress Codex), you may need to use these queries in phpmyadmin to change URLs in the database for site options, post URLs and post/page/image URLs in the 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');
1

You forgot to search + replace in the .sql file. (I assume you did the export with phpmyadmin). Search for www.olddomain.tld and replace it with www.newdomain.tld

Log into WP-Admin and update the permalink structure, then everything should be ok.

2
  • I also did a search and replace, but didn't work. It is to a new domain. A clean empty install worked, but as soon as i overwrite it with the other files it breaks, and even after importing the old sql file.
    – user1829
    Commented Dec 6, 2010 at 14:23
  • Can you still find the old url in the sql file?
    – Horttcore
    Commented Dec 7, 2010 at 8:10
0

I'm not sure whether you've already found a solution but I usually just install wordpress on the new site and then use this plugin (https://en-gb.wordpress.org/plugins/all-in-one-wp-migration/) to export everything from the old site and import on the new one. It also has find and replace functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.