HanG321 Blog

migrate wordpress from sub-directory to root and update Permalinks

Migrage from www.hang321.net/blog to www.hang321.net

1. backup
tar zcvf blog.\bin\date +%Y%m%d.tar.gz blog/

2. Move
mv * ../

3. edit wp_options table
LIKE %hang321.net/blog%
manually replace to hang321.net/ (could be done by sql too, but only couples of entries to modify)

4. change permalinks
change from ‘Numeric’ to ‘Day and name’, all links broken, especially from Google.
find a plugin, called permalinks-moved-permanently, generate a “301 Moved Permanently” to keep its pageRank
Not work because it look for postname, manually edit the query from post_name to ID

Done!

Further Reading:

Moving a WordPress blog from a sub-directory to the root directory
http://www.rentablogger.com/blog/2009/01/23/moving-a-wordpress-blog-from-a-sub-directory-to-the-root-directory/
Permalinks Moved Permanently
http://wordpress.org/extend/plugins/permalinks-moved-permanently/