Restore account default folders?

kenneth-vkd

Active Member
Apr 1, 2017
35
2
8
Denmark
cPanel Access Level
DataCenter Provider
Hi
A customer has managed to delete everything in their home folder and only the top level public_html and mail folders are left over.

They have managed to do it in such a way that everything is not recoverable by copying back the data from a virtual machine backup.
Is there a script to recreate the missing files and folders or would we have to completely delete the cPanel account and create it again?
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,739
302
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
No cpanel backup? I've not been in this position without a backup but you might try to make a backup even though it's broken with

/scripts/pkgacct username

Though that may not work given the missing data
 

kenneth-vkd

Active Member
Apr 1, 2017
35
2
8
Denmark
cPanel Access Level
DataCenter Provider
Well, tried that and while the backup restored, no more folders were created.
So guess the customer has to start over with a fresh cPanel account and then restore their website on to that and then recreate their email accounts
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,212
363
Hello @kenneth-vkd,

You'll need to backup the account's remaining data to a location outside of it's home directory, remove the account, and then create it again. Once it's created, move the data back into place and ensure the moved files/directories are owned by the account username. Finally, run the following command for good measure to make sure permission and ownership values on the email data is correct:

Code:
/scripts/mailperm $username
Thank you.