recreate files in /var/cpanel/userdata

anand

Well-Known Member
Nov 11, 2002
1,432
1
168
India
cPanel Access Level
DataCenter Provider
I have one of my customer vps's defaced. Several hundred files were replaced by defaced files. One of the main directory replaced is /var/cpanel/userdata. This contains the username/main and username/main.cache file which has the client domain in it. Is there a way to recreate the file via some script ? Manually doing it would be a real pain :(
 
  • Like
Reactions: JayPH

Zishan

Well-Known Member
Aug 6, 2005
107
1
168
This is what I can suggest:

- Take the backup of /var/cpanel/userdata
- Run /usr/local/cpanel/bin/userdata_update --reset so that /var/cpanel/userdata can be regenerated.
- Move the required files from new /var/cpanel/userdata to old one.
- Move the old /var/cpanel/userdata back after copying the required files.
- Rebuild Apache conf as /usr/local/cpanel/bin/build_apache_conf
- Restart Apache /etc/init.d/httpd stop ; /etc/init.d/httpd start
 
Last edited: