1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Manually clone a WordPress site in 10 minutes

Discussion in 'Blogging' started by sean3000, Nov 3, 2011.

  1. sean3000

    sean3000 Newbie

    Joined:
    Jan 15, 2011
    Messages:
    23
    Likes Received:
    27
    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.
     
    • Thanks Thanks x 16
  2. CenTex Hosting

    CenTex Hosting Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 8, 2009
    Messages:
    1,518
    Likes Received:
    576
    Gender:
    Male
    Occupation:
    Admin
    Location:
    Austin, TX
    Home Page:
    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.
     
    • Thanks Thanks x 1
  3. sean3000

    sean3000 Newbie

    Joined:
    Jan 15, 2011
    Messages:
    23
    Likes Received:
    27

    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? :)
     
    • Thanks Thanks x 3
    Last edited: Nov 3, 2011
  4. BigBadWolff

    BigBadWolff Regular Member

    Joined:
    May 8, 2009
    Messages:
    320
    Likes Received:
    557
    anyway you guys can do a short video tutorial on this. Give you a +1 rep and itrader if you do.
     
  5. densaugeo

    densaugeo Newbie

    Joined:
    Jul 24, 2011
    Messages:
    42
    Likes Received:
    1
    Occupation:
    Offline Trader
    Location:
    World
    thanks!
     
    • Thanks Thanks x 1
  6. OCMSyndicate

    OCMSyndicate Newbie

    Joined:
    Oct 1, 2011
    Messages:
    29
    Likes Received:
    10
    Occupation:
    Snake bite specialist
    Location:
    HEAVAN
    I really dig your avitar antlers Sean3000
     
    • Thanks Thanks x 1
  7. pshot

    pshot Newbie

    Joined:
    Apr 5, 2011
    Messages:
    46
    Likes Received:
    10
    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
     
    • Thanks Thanks x 1
  8. X X X

    X X X Newbie

    Joined:
    Nov 25, 2011
    Messages:
    15
    Likes Received:
    1
    Thank you, really helpful information
     
  9. clint1988

    clint1988 Junior Member

    Joined:
    Nov 15, 2011
    Messages:
    177
    Likes Received:
    38
    is it really usefull to copy a site??

    i mean google will ban you and without google normaly no money
     
  10. AGSniper

    AGSniper Regular Member

    Joined:
    Jul 8, 2009
    Messages:
    266
    Likes Received:
    39
    You can also use wptwin. It's a pretty good tool that will help you clone your site in less than a minute.
     
    • Thanks Thanks x 1
  11. flexnds

    flexnds Power Member

    Joined:
    Jan 4, 2010
    Messages:
    643
    Likes Received:
    680
    Occupation:
    Internet Marketing, Web development, Internet Repu
    Location:
    AZ
    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.
     
  12. dioric

    dioric BANNED BANNED

    Joined:
    Nov 24, 2011
    Messages:
    41
    Likes Received:
    14
    really good tuts.~!!!!.. keep it up.
     
  13. imserious

    imserious Senior Member

    Joined:
    Mar 27, 2009
    Messages:
    946
    Likes Received:
    560
    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.
     
  14. markhenry121

    markhenry121 Elite Member

    Joined:
    Oct 14, 2011
    Messages:
    2,149
    Likes Received:
    239
    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.
     
  15. sean3000

    sean3000 Newbie

    Joined:
    Jan 15, 2011
    Messages:
    23
    Likes Received:
    27
    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?
     
  16. Funkychicken

    Funkychicken Newbie

    Joined:
    May 15, 2011
    Messages:
    36
    Likes Received:
    15
    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?
     
  17. sekartajimangantahu

    sekartajimangantahu Registered Member

    Joined:
    May 17, 2010
    Messages:
    53
    Likes Received:
    2
    long tutorial that's good. very useful and easy reading
     
  18. WarriorPanda

    WarriorPanda Newbie

    Joined:
    Oct 13, 2011
    Messages:
    15
    Likes Received:
    0
    Woah, amazing post, informative and easy to understand! Thanks a ton dude!
     
  19. rht999999

    rht999999 Newbie

    Joined:
    Dec 10, 2011
    Messages:
    48
    Likes Received:
    7
    Really nice and good information.
     
  20. manchesterescorts12

    manchesterescorts12 Newbie

    Joined:
    Dec 13, 2011
    Messages:
    2
    Likes Received:
    0
    Occupation:
    Ecorts Manager
    Location:
    Manchester
    Home Page:
    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