3

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

1

4 Answers 4

5

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.

4
  • can you please clarify what you mean by Place this in the root of your WordPres site. Feb 3, 2012 at 18:33
  • The 'root' or 'root directory' is the lowest level directory for your WordPress install. This is typically (but not always) the same level that your wp-config.php file resides in. Feb 10, 2012 at 1:10
  • If I have my wordpress site in a directory "wordpress" in root, (public_html/wordpress), then wp-migrate.php goes in root or root/wordpress? Thanks.
    – user18915
    Aug 4, 2012 at 13:51
  • Hi Neel... The wp-migrate.php file should go in the root/wordpress directory in your case. You can generally assume it should be in the same directory as your wp-config.php file. Aug 6, 2012 at 14:47
1

Basically, you'd need to do the following...

  1. Copy all the files to the new location.
  2. Create a new database.
  3. Import the data from the old database and export to the new database.
  4. Update the URLs via SQL.

Check out Moving WordPress for more.

0
  1. Copy files to new location via FTP.
  2. Create new database.
  3. Export database from old location.
  4. Import database into new location.
  5. Update the URLs in phpMyAdmin
  6. Change the wp-config.php file to point to your new database.
0

Is there any reason that simply exporting your content and then importing via the importer plugin wouldn't work? I recently moved my blog in an almost identical manner to what you are describing (302 redirect, keeping all the content, etc) and it went smoothly enough.

Other than that, WordPress has an excellent guide to moving your install across folders, servers or just changing URLs.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.