Rating: 2 votes, 5.00 average.

Cloning WordPress for multiple installs

Share
Submit "Cloning WordPress for multiple installs" to Facebook
Posted 3rd May 2010 at 03:46 PM by Austin Delaney

update: I now use the excellent 'Duplicator' plugin that is completely gratis courtesy of Life In The Grid - find it in the WordPress plugin directory:

http://wordpress.org/extend/plugins/duplicator/

---------------------

If you are creating a lot of blogs that are identical in their configuration (plugins, theme, settings) you can save a lot of time by creating a master blog that can be replicated with ease if you have cpanel hosting.

To prepare your master blog you will need to set up your blog exactly as needed (including plugins and theme) and then zip up all of the contents in your web folder (/public_html/)

This will be your master blog file.

The next step is to backup your master blog MySQL database as this has all of your settings for the plugin, theme and any pages/posts you have created. You can do this with phpMyAdmin by selecting the WordPress database and exporting it to your computer. i.e. download the .sql file.

The first thing to do to replicate your blog on another domain is to upload the zip file to the public_html folder of the new domain and then unzip the contents.

Secondly, create a new MySQL database using the cpanel MySQL wizard and copy the db name, username and password details to a text file.

Now open wp-config.php (in your public_html folder) for editing.

Replace the details of your master blog db name, username and password with the new db details and save the file.

The next step is to goto your new MySQL database with phpMyAdmin.

The database should be blank (no tables etc).

Click on import and select your master blog .sql file that you saved to your computer earlier.

After the database has been imported you will need to update some details before you can begin using your WordPress install on the new domain.

Make sure you have the new database selected (click on the db name on the left) and then click on 'SQL'. You are going to run a few SQL queries to update the database with details of your new domain.

Enter the following into the text box:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');


Make sure to replace http://www.old-domain.com and http://www.new-domain.com with your details.

If you have made use of the wp-content/uploads directory you will also need to update the path to this directory.

Again, make sure you ahve the right database selected by clicking on the db name in the left hand side column and then click on search.

Search for 'upload' with all of the tables selected (select all).

In the results table click on 'browse' for 'inside table for wp-options'

Then click on the little pencil icon next to 'upload_url_path'

You will need to replace the path with the full path to your wp-content directory

Eg; /home/your_user_name/public_html/wp-content/uploads

Once you've done that just click on 'Go' and then login to your new WordPress install at http://www.your-domain.com/wp-login.php using your username and password from your master blog.

Enjoy :]
Views 6298 Comments 5
Total Comments 5

Comments

  1. New Comment
    proserve's Avatar
    Great information here. Thanks for the insight...
    permalink
    Posted 3rd May 2010 at 04:37 PM by proserve proserve is offline
  2. New Comment
    Istvan Horvath's Avatar
    Great guide!

    Too bad people don't like to mess with the database
    permalink
    Posted 3rd May 2010 at 04:59 PM by Istvan Horvath Istvan Horvath is offline
  3. New Comment
    Thanks for the education.
    permalink
    Posted 1st June 2010 at 08:35 PM by multistreams multistreams is offline
  4. New Comment
    josher's Avatar
    With Wordpress 3.0, it's now SO MUCH easier. After you set the master site, of course.
    permalink
    Posted 6th July 2010 at 10:40 PM by josher josher is offline
  5. New Comment
    kd777's Avatar
    Hi Austin,

    Thank you for your excellent guide!

    This is almost exactly the same procedure that you use to follow. It's quite easy once you've tried it a couple of times, and you spare a lot of money by not buying one of these software applications that promise to do the same job but often disappoint.

    Thanks again!

    Best,
    Klaus
    permalink
    Posted 11th August 2010 at 03:28 AM by kd777 kd777 is offline
 


All times are GMT -6. The time now is 05:20 AM.