How to move your blog to subfolder

Often you need to move your blog from www.domain.com to www.domain.com/test. You might want to test something and does not want to interfere with your blog. A way to do this is by creating a clone of your blog in subfolder. So how do you do it? Assume that your blog is at www.domain.com, here’s how:

  • Download database backup plugin from http://www.ilfilosofo.com/blog/wp-db-backup.
  • Activate the plugin
  • Backup your database using your plugin. Go to ‘Manage’ -> ‘Backup’ menu. Choose ‘All tables’ and download the backup file to your computer. You will get a zip file with .sql file in it.
  • Extract the .sql file
  • Backup the .sql file. You can just copy the .sql file to another folder
  • Open the .sql file using notepad.
  • Replace ‘http://domain.com’ with ‘http://domain.com/test’
  • Create a new wordpress blog at sub folder i.e. www.domain.com/test
  • Loggin into your phpmyadmin. You usually can find your phpmyadmin at cpanel.
  • Click databases, and select the database that you will be importing your data into.
  • Across the top of the screen will be a row of tabs. Click the Import tab.
  • On the next screen will be a Location of Text File box, and next to that a button named Browse.
  • Click Browse. Locate the .sql file stored on your computer which you have modified using notepad.
  • Make sure the SQL radio button is checked.
  • Click the Go button.
  • You should now have a new blog at http://domain.com/test.
  • Contact me if you have any problem.

Tips

  • If you have huge database, you might want to reduce the size so you can import small database. What makes the database that huge is usually your post. So in order to reduce the size, you need to delete some post in the .sql file. Open the .sql file and search ‘wp_posts’ word. Find something like : “INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
    ( x,x,x,x,x,x,x,x,x,x,x,x,x,x,x),
    ( x,x,x,x,x,x,x,x,x,x,x,x,x,x,x),
    ( x,x,x,x,x,x,x,x,x,x,x,x,x,x,x)”.

    This is the command to insert data to your database. So you need to remove the
    ( x,x,x,x,x,x,x,x,x,x,x,x,x,x,x). To see the difference download this zip file, and compare the two files. The old.sql will insert two data, while the new.sql will only insert one data.

Share and bookmark:
  • RSS
  • Twitter
  • StumbleUpon
  • Technorati
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Reddit
  • Propeller
  • Google Bookmarks

Related posts:

  1. How to upgrade wordpress
  2. How to install wordpress
  3. Using Tab Panel Div in Wordpress
  4. Php download script
  5. Protecting your pages with htaccess

5 comment(s)

  • Mar 26, 2009 by Marketing Business Review

    Hi Ian,

    I need your help. I just sent you an email. Hope you can help.

    Thanks,
    Luis

  • Mar 29, 2009 by johnathan from comforter sets

    Thanks, man I’ve been trying to do this forever!

  • Aug 8, 2009 by Joseph from Acai Berry

    Moving blogs are a bit more complicated since they use databases, but this is a really great step-by-step guide. Thanks for sharing it.

  • Aug 30, 2009 by admin

    Cheers, Joseph!

  • Oct 31, 2009 by manu from canon inkjet cartridges

    Above tips are really very helpful and try this in my blog.Thanks for your support.

  • Any feedback from you?

    This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Mar 23, 2009 by admin

WEB HOSTING COUPON CODES:

HostGator 20% OFF first order - Code: AUTUMN

HostGator 1-cent web hosting - Code: hgc25

HostGator 20% OFF initial order - Code: GREEN

GreenGeeks 10% OFF - Code: 10off

Super Green Hosting HostGator GreenGeeks HostPapa green web hosting ad