Migrating WP site to another URL

We are planning to change the domain name of our website.We are not changing the host but creating a new domain and will close/redirect all traffic to new domain (there will be not update on the old domain).

Since most of the database still will be same as we need old post so i am wondering how best we can handle this situation.i have following points in my mind

  1. Install new WordPress.
  2. Copy all the static contents (images/videos etc) to new WP installation location.

i am confused about how to handle database stuff? should we create a new database and import the data from old database to new one and den set any links and HOME URLs using SQL script.

Please advise.Also what is the best way to import the database

4 Answers
4

I’ve written a very simple script that is built to do exactly what you’re talking about. Here’s the basic process you’ll want to follow.

  1. On the old server, log-in to PHPmyAdmin and export the database.
  2. On the new server, log-in to PHPmyAdmin and create your database. You may need to create a new MySQL user as well, but your web host should be able to assist you. Make a note of the database name, the MySQL username and password as well as the database host (usually localhost).
  3. Using PHPmyAdmin on the new server, import your old database into the new database.
  4. Using FTP, copy all of the files from the old server onto your computer.
  5. Open the wp-config.php file and enter your new database name, username, password and database host.
  6. Go to http://philipdowner.com/2012/01/script-to-make-wordpress-site-migrations-easier/ and download the wp-migrate.php script. Place this in the root of your WordPress site.
  7. Upload the site and all of it’s files (included the wp-migrate.php) file to your new server.
  8. Point your web browser to http://yournewdomainname.com/wp-migrate.php and follow the directions in the script.
  9. The script will update all instances of the old URL in the database for you.

If you need further help, there’s a couple of great threads here on this forum. Also see the Codex article on backing up your database.

Leave a Comment