Best way to replicate an account?

pdstein

Active Member
Apr 14, 2005
25
0
156
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
 

mohit

Well-Known Member
Jul 12, 2005
553
0
166
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
 

pdstein

Active Member
Apr 14, 2005
25
0
156
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?
 

brendanrtg

Well-Known Member
Oct 4, 2006
311
0
166
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?
 

pdstein

Active Member
Apr 14, 2005
25
0
156
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.
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.

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?
Not really. That's why I'm here asking for alternatives. ;)
 

brendanrtg

Well-Known Member
Oct 4, 2006
311
0
166
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 ;)