Moving WordPress
From 워드프레스(WORDPRESS) 한국어 위키
Contents |
There are times when you need to move WordPress around within your server, and times when you need to move WordPress from one server to another. WordPress is flexible enough to handle all of these situations.
Moving WordPress Within Your Site
Moving the WordPress files from one location on your server to another - changing its URL - requires some special care.
Here are the step-by-step instructions:
- Create the new location using one of these two options:
- If you will be moving your WordPress core files to a new directory, create the new directory.
- If you want to move WordPress to your root directory, make sure all index.php, .htaccess, and other files that might be copied over are backed up and/or moved, and that the root directory is ready for the new WordPress files.
- Login to your blog.
- Go to the Administration > Options > General panel.
- In the box for WordPress address (URI): change the address to the new location of your main WordPress core files.
- In the box for Blog address (URI): change the address to the new location, which should match the WordPress address (URI).
- Click Update Options.
- Logout of your blog.
- (Do not try to open/view your blog now!)
- WordPress 2.0 only: Delete the folder wp-content/cache.
- Move your WordPress core files to the new location. This includes the files found within the original directory, such as http://example.com/wordpress, and all the sub-directories, to the new location.
- If you are using Permalinks, go to the Administration > Options > Permalinks panel and update your Permalink structure to your .htaccess file, which should be in the same directory as the main index.php file.
- If you have problems with missing images that you've uploaded, you need to change the path to the images on every post directly on your SQL database. For this, follow the instructions on Tamba2's Tutorial "Moving your weblog inside your PC"
It is important that you set the URI locations BEFORE you move the files.
You're done. Test your site to make sure that it works right. If the change involves a new address for your blog, make sure you let people know the new address, and consider adding some redirection instructions in your .htaccess file to guide visitors to the new location.
Giving WordPress its Own Directory While Leaving the WordPress Index File in the Root Directory
Please see this article, Giving WordPress Its Own Directory, for detailed instructions.
Moving WordPress to a New Server
If you are moving WordPress from one server to another, begin by backing up your data. This includes backing up your WordPress database as well as all the core files, images, plugins, and other files on your site. See WordPress Backups and Backing Up Your Database for more details.
- Note: If you are changing to a new server but same domain, all you need to do is edit wp-config.php and upload everything as it is to your new server.
If You Don't Care If Your Old Blog Works
- Download a copy of the main wordpress files from your OLD blog to your hard drive and edit wp-config.php to suit the new server.
- Go back to your OLD blog and go to options and change the url (both of them) to that of your new site.
- Again, download your database (but keep the old one just in case), upload this new database and the copy of the wordpress core files with the edited wp-config.php to your new server. Thats it!
If You Want Your Old Blog To Still Work
Caution: Make sure you have a backup of your old blog's WordPress database before proceeding!
Part A - Activating Your New Blog
- Download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your OLD blog's installation.
- Go back to your OLD blog and go to options and change the url (both of them) to that of your new site.
- Again, download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your NEW blog's installation.
- Download your database once again (but keep the old one). Upload this database to your new server. It will be easiest if you use the same database name and you create a user with the same login credentials on your new server as on your old server.
- If you used a different database name and/or user (see previous step), edit wp-config.php in your NEW blog's installation folder appropriately.
- Upload the NEW blog's installation folder to your new site. Presto, your NEW blog should be working!
Part B - Restoring Your Old Blog
- On the original server, delete your OLD blog's database (remember, you should have a copy on your local computer that you made at the very beginning).
- Upload your OLD blog's installation folder to your original server, overwriting the files that are currently there (you may also delete the installation folder on the server and simply re-upload the OLD blog's files).
- Upload your OLD blog's database from your local computer to the server. That should do it!
To Copy Just Posts and Comments
- Upload a new wordpress installation to your new site.
- From your old site, copy the wp_comments and wp_posts tables (from the MySQL database using phpmyadmin) and replace the new site's MySQL tables with these two from your previous site.
- You will now have all your old posts and comments on your new wordpress site without worrying about changing settings back and foreward.
- Note: If you use plugins that use the database, like ultimate tag worrior, you will lose your tags on each post. If you must keep these, use the above methods.
Moving WordPress to a New Server with Fantastico
Some webhosts use a service called Fantastico, which can install a vanilla WordPress web with just a few clicks. You can transfer your blog to one of these webs, but the steps are slightly different.
Begin by backing up your data. This includes backing up your WordPress database as well as all the core files, images, plugins, and other files on your site. See WordPress Backups and Backing Up Your Database for more details.
Make a copy of your database. You will need to edit the .sql file, and in case of errors, it is important that you work on a copy.
Begin the process of working from copies of your backups.
- If you have changed domain, edit the backed up database file to reflect this. A simple way to do this is:
- Using a text editor, open a copy of the
.sqldatabase file. - Using the search and replace function, find all instances of the blog's old URL and replace it with the new URL.
- Repeat the process with your old email address. (For example, replacing someone@example.com with someone@tutorial.com)
- Save your changes.
- Using a text editor, open a copy of the
When you are ready to check your site, make sure to clear your cache and cookies so you will see the changes in your web browser.
Additional Information
A visual guide is available at Podz' WordPress Guides
This article is marked as in need of editing. You can help Codex by editing it.

