Domain Manage

cloning a site

Discussion in 'Website Design' started by SecNam, Dec 27, 2008.

Thread Status:
Not open for further replies.
  1. SecNam

    SecNam Moderator Staff Member

    Jul 2004
    Likes Received:
    im looking for a solution to a prob im having and was wondering if anyone knows the best way todo it.

    on cpanel and whm i have a skeleton directory so when i add a domain it puts in a parking page or what ever i put in the skeleton folder.

    is there a way to add a complete site when i add a domain. when i say complete site i mean databases, emails etc. so if i add 5 domains i will have 5 sites the same then all i need todo is edit the text onthe site and the databases stay the same.


    does anyone know how to clone one site to another using whm/cpanel

    thanks in advance.
  2. Domain Forum

    Acorn Domains Elite Member

    Likes Received:
  3. Skinner

    Skinner Well-Known Member

    Jul 2008
    Likes Received:
    Are you any good in root shell, scripting or programming ?

    There are a few options if your good with any of them.

    If your not there are some 'methods', not sure why you want to dupe your emails tho?

    Assuming your email addition is just a way for you to say the works, everything, you could put all the code including a mysql.con.php file that connects all the sites to the same master database in the skeleton folder, and if you needed to break it off to its own simply replace that file on each break away account with details of its own database.

    You could with a little shell script run a script to create its own DB, and login details using the 'Remote Access Key' from your WHM and then use the skeleton folder. If you knew enough, this is beyond my skill set and I'd hire someone to do that so can't help you much but can tell you its possible.

    You could also use 'backup and restore' assuming you had restore permissions and it was under your safe upload limit (best 2-5mb max 5-10mb) and use online restore, if its bigger you would need shell access to run the restore. See A and B below.

    A), Assuming you have root shell access and knew enough using 'Remote Access Key', there would be nothing stopping you instructing the server to make a backup of the master folder, then create a new account, restore a copy of the master site and off you go.

    B), Assuming A is no good, and your master site is smaller than your max upload AND you have restore permissions goto backup on your master site, download the backup, create your new account and restore the downloaded master, it will copy emails, stats, databases etc into your new site.

    There are sorts of methods using 'Remote Access Key' that can done from VB/C Programs to PHP to Shell scipts that do what you need.

    Another option is to not actually create new accounts, just use some fancy php and have it check what the URL is before delivering a specific page set.

    When I first started out using PERL, I had a huge IF THEN ELSEIF THEN statement that detected the calling url and loaded a specific set of code for the index and all the index links went to a different folder that contained the site so etc. Now using php and mod_rewrite the user would never know they wasnt on a different website unless they see the background.

    There some other methods but they almost all require root and/or RAK.

    Hopefully this all makes sense, I was just tapping away while I thought of idea's :)
Thread Status:
Not open for further replies.

Share This Page