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.

Best way to replicate an account?

Discussion in 'General Discussion' started by pdstein, Dec 20, 2006.

  1. pdstein

    pdstein Active Member

    Joined:
    Apr 14, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    6
    I want to replicate an account on the server so I can do some testing. Here are some of the details:

    - To avoid potential problems with testing in a different environment, I want the duplicate account to be on the same server, but obviously it will have to have a different username.

    - The account has a massive number of files in it, some are owned by user and therefore the ownership would have to be changed to the new username, however, many of the files are owned by "nobody" because they've been uploaded using PHP scripts so I can't just chown -R the entire account

    - I will also need to replicate the databases.

    I know there are back-up/restore functions in both WHM and cPanel, but I'm not sure if any of them will do what I'm trying to do here.

    Thanks for your help,
    Paul
     
  2. mohit

    mohit Well-Known Member

    Joined:
    Jul 12, 2005
    Messages:
    553
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sticky On Internet
    try this at ur own risk.

    hi,
    give this method a try on your own risk, it might create problems so backup everything before you try it.

    as you want to have a same account replicated to another so you can test the modifications done, you should try to first backup the account in question from ssh.

    /scripts/pkgacct username

    then goto root whm--> Modify and account and change the domain name and username choose a different name for both fields.

    again from ssh

    /scripts/unpkgacct username
    where username would be the original one.

    now you have the main account restored from the Backup and a copy of it which is infact the renamed account.

    It may cause problem if not done properly so DO VERIFY your backup before you do the play.:p

    see ya,
    mohit
     
  3. pdstein

    pdstein Active Member

    Joined:
    Apr 14, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    6
    mohit, thanks for your reply. If I understand what you're suggesting, I would be essentially renaming the existing account to the new account and then restoring the account from back-up. That would mean there would be a period during the restoration of the account from back-up when the account would be down. We have thousands of clients accessing this accoutn and we can't afford downtime like that, so I'm afraid that is not a viable solution.

    Is there some way to back-up the account and then restore it in the new account?
     
  4. brendanrtg

    brendanrtg Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    With the method suggested, I dont see any reason why it should go down for more than a few minutes since the site wont go down until you start renaming and restoring it.

    Another option would be to copy whatever user files to say /backup, create a new account and then MANUALLY copy the contents to the NEWLY CREATED ACCOUNT, not forgetting to MANUALLY CHOWNing the respective files to the new USER.

    You sure you want to do this?
     
  5. pdstein

    pdstein Active Member

    Joined:
    Apr 14, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    6
    Well, there are like 5 GB of files in the account. I don't know how long that would take to extract from back-up, Plus mohit's "do at your own risk" comment, makes me wary. If there's a problem, then the downtime would be longer.

    Not really. That's why I'm here asking for alternatives. ;)
     
  6. brendanrtg

    brendanrtg Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    Regarding:

    #1 We have tried that many a times and have not had any problems with the method suggested. I believe he/she was issuing a STANDARD DISCLAIMER just in case? lol

    The site we tested on was about 3gb in size and took us less than 30 minutes, not on a P2, of course.

    #2 I really dont see any other alternatives other than the 2 listed here.

    :p :D ;)
     
Loading...

Share This Page