Manually clone a WordPress site in 10 minutes

sean3000

Newbie
Joined
Jan 15, 2011
Messages
23
Reaction score
28
Here's the method I use to clone WordPress sites. This will copy everything--your database, posts, plugins, settings, images, etc.

This should work for any host that provides cPanel. This isn't the only way to do it, but it works for me.

If you somehow manage to ruin your site while using this method, just Google "how to carefully follow directions."

FYI, the source is the site you are cloning and the destination is the new site.

Short Version

1) From phpMyAdmin, download the source DB as SQL
2) Open the SQL file in a text editor
3) Find all instances of the source URL and replace them with the destination URL (including the .com/.net/.org suffix)
4) Use the cPanel database wizard to create a DB and user for the destination site, noting the DB name, user name, and password
5) In phpMyAdmin, import the source DB into the new D
6) In File Manager, zip the source website7
7) Move the ZIP file to the destination folder
8) Use the File Manager editor to enter new DB info into wp-config.php


Long Version

Download the source DB as an SQL file

1) From the phpMyAdmin home page, click on the source DB
2) In the menu, click Export
3) Leave the Quick option selected and click Go


Change the website name in the SQL file

1) Open the SQL file you just downloaded in a good text editor
2) Perform the following find and replace operations:

oldsite.com > newsite.net
old-site-directory > new-site-directory

Some themes and plugins reference the directory of your WordPress site, so you need to make sure to change it in the DB. This won't apply to all sites.


Create a new DB and user

1) Open cPanel and open the MySQL Database Wizard
2) Follow the directions to create a new database and user with full privileges
3) Make sure to copy down your full DB name (with prefix), full user name (with prefix), and password

Your DB and username prefix is usually your cPanel username, so your DB name would look like cpanelhandle_dbname.


Upload the source DB into the new DB

1) Open the SQL file you downloaded earlier and copy the entire thing
2) Go to phpMyAdmin and click on the name of your new database
3) In the menu, click SQL
4) Paste your copied SQL text and click go

It might take a minute for this to finish, so be patient. You can also use the Import option, which might be better if you're cloning a large site.


Copy and move the source website

1) From cPanel, open File Manager
2) Open the directory of the source website
3) Click Select All, then Compress
4) Click the new ZIP file (you may have to refresh the window first) and click Move
5) Enter the destination directory (e.g. public_html/newsite) and click Move File(s)
6) Open the destination directory, select the ZIP file, and click Extract


Modify wp-config.php

1) In the destination directory, select wp-config.php and click Code Edit
2) Change the DB, user, and password to reflect your new site's details

You should now be able to go to yoursite (dot) com/wp-admin and login using the details from the source site.


If you have any questions, or ideas on how to improve this method, please let me know.
 
Why not just use the backup wiz and back up the home and then sql file

then go to new site use backup wiz and load in the home dir then go to database section create a database login then go to the php admin and import the sql file. then just change the url to the new url of the site.

then go to the home folder find the config file and change the database user name and password to the new one and your done.



You laid it out nice and pretty but its not that many steps to copy it.
 
Why not just use the backup wiz and back up the home and then sql file

then go to new site use backup wiz and load in the home dir then go to database section create a database login then go to the php admin and import the sql file. then just change the url to the new url of the site.

then go to the home folder find the config file and change the database user name and password to the new one and your done.



You laid it out nice and pretty but its not that many steps to copy it.


You're right, I included too much detail and I spent too much time trying to make it easy to read. I don't know what I was thinking.

Let me try again. Here's a tutorial I just wrote on how to build a car:


go to the parts store buy some wheels and a frame

put the wheels on the frame then get an engine. put the engine on the frame connect it to the wheels. then put in a battery and some wires for electricity.

get a body and paint it then put it on the frame add seats and fuzzy dice on the mirror and your done.



Better? :)
 
Last edited:
anyway you guys can do a short video tutorial on this. Give you a +1 rep and itrader if you do.
 
You're right, I included too much detail and I spent too much time trying to make it easy to read. I don't know what I was thinking.

Let me try again. Here's a tutorial I just wrote on how to build a car:


go to the parts store buy some wheels and a frame

put the wheels on the frame then get an engine. put the engine on the frame connect it to the wheels. then put in a battery and some wires for electricity.

get a body and paint it then put it on the frame add seats and fuzzy dice on the mirror and your done.



Better? :)

It wont start ...do I need to paint it or something?

thanks for the first tut though...I actually copy pasted it into my " how to wordpress " notes
 
is it really usefull to copy a site??

i mean google will ban you and without google normaly no money
 
You can also use wptwin. It's a pretty good tool that will help you clone your site in less than a minute.
 
You can also use wptwin. It's a pretty good tool that will help you clone your site in less than a minute.

Agree completely.. WPTwin is pretty awesome. You can clone a site in under 3 minutes. And with WPTwin, if you are putting the site on another domain, you simply drop two lines of code into your functions file and you're done. Though the techy way is good to know as well. Thanks to OP for taking the time.
 
This tutorial comes handy when one can not use wptwin or backupbuddy to copy the files as those scripts require you to use some php functions which are not available on every hosting.

Just one addition to the Tutorial:

While copying the DB SQL file in phpmyadmin - that SQL contains a CREATE command to create a new database which is the name of the database of the old site. One will need to delete those two lines while importing since the database is already created.
 
I just take backup of database from Cpanel and download all folders from File manager then upload in new site. Change database name and other required changes in config.php same process follow for downloaded folders. It is easy step for me to clone wordpress site.
 
While copying the DB SQL file in phpmyadmin - that SQL contains a CREATE command to create a new database which is the name of the database of the old site. One will need to delete those two lines while importing since the database is already created.

I've never done this step and haven't had any issues. Maybe PHPMyAdmin is designed to ignore the CREATE command if you're pasting the SQL into an existing DB?
 
Thanks for these steps, much easier to read than the Wordpress codex!

I was cloning a site today and had a problem with the image uploads. All the files were on the server but 0kb and would not display. I had to manually reupload them into the media library. Anyone ever experienced this?
 
oh ! thanks for suggestion i also search in this topic but not found more about how can generate wordpress themes with in hr. but you post here with in 10 min. sure i will try for my escort website if possible then i will reply, first i will try it, if i will create any problem sure i will comments my problem if possible please you will reply me.

thanks
 
Back
Top