Here are the step-by-step instructions:
1.Create the new location using one of these two options:
1.If you will be moving your WordPress core files to a new directory, create the new directory.
2.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.
2.Login to your blog.
3.Go to the Administration > Settings > General panel.
4.In the box for WordPress address (URI): change the address to the new location of your main WordPress core files.
5.In the box for Blog address (URI): change the address to the new location, which should match the WordPress address (URI).
6.Click Save Settings.
7.(Do not try to open/view your blog now!)
8.WordPress 2.0 only: Delete the folder wp-content/cache.
9.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.
10.If you are using Permalinks, go to the Administration > Settings > Permalinks panel and update your Permalink structure to your .htaccess file, which should be in the same directory as the main index.php file.
11.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".
12.You must also check and edit 'store uploads folder' under Settings-Miscellaneous or all your new uploads will continue to go into the old folder.
13.Existing image/media links uploaded media will refer to the old folder and must be updated with the new location.
It is important that you set the URI locations BEFORE you move the files.
If you forget to change the locations
Suppose you accidentally moved the files before you changed the URIs: you have two options.
OPTION 1. Suppose the files were originally in /path/to/old/ and you moved them to /path/to/new before changing the URIs. The way to fix this would be to make /path/to/old/ a symlink (for Windows users, "symlink" is equivalent to "shortcut") to /path/to/new/, i.e.
ln -s /path/to/new /path/to/oldand then follow the steps above as normal. Afterwards delete the symlink if you want.
OPTION 2. If you forget to change the WordPress Address and Blog Address, you will be unable to change it using the wordpress interface. However, you can fix it if you have access to the database. Go to the database of your blog and find the wp_options table. This table stores all the options that you can set in the interface. The WordPress Address and Blog Address are stored as siteurl and home (the option_name field). All you have to do is change the option_value field to the correct URL for the records with option_name=’siteurl‘ or option_name=’home‘.
Suppose you accidentally changed the URIs where you cannot move the files. (but still can access the login page, through a redirection or something)
wp-login.php can be used to (re-)set the URIs:
//FIXME: do comment/remove these hack lines. (once the database is updated)
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );
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.
Changing The Site URL also provides the details of this process!
