The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Duplicate WHM account with in the same server?

Discussion in 'Data Protection' started by phpsharma, May 30, 2014.

  1. phpsharma

    phpsharma Registered

    Joined:
    Feb 22, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi

    I am using WHM v11.42 on vps sever.
    I would like to duplicate a account to another name?
    I don't want to copy/transefer from another servers.

    Please advise me.

    Thanks,
    sharma
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Can you clarify what your end goal is? You said you want to duplicate an account, but you don't want to copy it. Are you maybe referring to having the site served from both servers, as in like, setting up some sort of load balancing?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    If you mean that you want to just make an exact copy of the account on the same server, then you will have to first backup the account with a command such as:

    /scripts/pkgacct $username

    Then, since you can not have the same domain name exist on a single server, you must rename the first account to a different domain name and username via ""WHM Home » Account Functions » Modify an Account". You can then restore the previous account from backup. Note that this does not take into account the user of parked/addon domains, or MySQL databases.

    Thank you.
     
  4. cpatafio

    cpatafio Registered

    Joined:
    Feb 17, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi!

    I have a similar but slightly different requirement. I've setup a new VPS server and copied one of our landing page sites to the new server. I've created 10 new cpanel accounts with different cpanel users and domains (the first of 100 such landing page accounts). I now want to clone the first website into the 10 new sites.

    I know how to do this by downloading the contents of the public_html directory to my computer and exporting the MySQL database to my computer then uploading the contents to the public_html directory of the new cpanel accounts and importing the MySQL database to the new database. However, since ultimately, there will be over 100 of these sites (with minor text and image tweaks), I was hoping there was an easier way from within WHM to accomplish this. Is there?

    I thought I could use the "Restore a Full Backup/cpmove File" function and NOT have it overwrite the existing (new) cpanel username. But, when I tried this, I received an error stating that the same cpanel user already exists.

    Does anyone have an "easy" way to do this? I realize, once the clone is created (if it can be), we'll have to login and modify the configuration files that point to the database. But, this is a lot less work than having to upload the files over 100 times.

    I hope someone out there has figured out how to do this. If it is possible to use the "Restore a Full Backup/cpmove File", can someone tell me how?

    Thanks in advance,

    Clem
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could setup a post account creation hook that runs a custom script to copy files/databases. Information on script hooks is available at:

    Guide to Standardized Hooks
    Whostmgr Functions

    You may want to consult with a software developer if you need the full script developed for you.

    Thank you.
     
Loading...

Share This Page