SOLVED userdata_update question

edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
Question about the /usr/local/cpanel/bin/userdata_update script.

I have a large number of users migrated from another cPanel server that have customizations to /var/cpanel/userdata/<user>/<domain>. I want to remove the customizations as they're old and obsolete.

I don't want to nuke everything in /var/cpanel/userdata/ so userdata_update --rebuild is overkill. It appears from the code that if I delete the user data file (/var/cpanel/userdata/<user>/<domain>) and run /usr/local/cpanel/bin/userdata_update with no flags, the /var/cpanel/userdata/<user>/<domain> file will be recreated and no other user files will be changed.

Is this correct -- and safe? Any caveats?

Thanks in advance for any insight.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,239
363
cPanel Access Level
Root Administrator
Hey there! I believe "--rebuild" in your post was a typo as the flag is "--reset" so I just wanted to point that out to avoid confusion.

Code:
# /usr/local/cpanel/bin/userdata_update --help
Usage: userdata_update [--reset] [--unpark_addons] [--help | --usage]
Options:
--------------------------------
--reset
    IMPORTANT! Do not conserve existing userdata and regenerate new userdata files
    based upon the current Apache configuration file. This should be used as a last resort.

--unpark-addons
    Fix instances where an addon domain is also listed as a parked domain. This flag will
    result in a reset of all userdata files. See "--reset" warnings for more information.

--help
    Display usage information
Yes, if you remove the /var/cpanel/userdata/username directory, running userdata_update with no flags will recreate that. Rather than remove it, it would be safer to copy that to another location, such as /root, so you can manually restore the old version if necessary.
 

edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
Hey there! I believe "--rebuild" in your post was a typo as the flag is "--reset" so I just wanted to point that out to avoid confusion.
Yes, if you remove the /var/cpanel/userdata/username directory, running userdata_update with no flags will recreate that.
Yep, meant --reset. ;)

I backed up the entire userdata directory. I don't plan to remove the entire directory. Just a selection of domains in /var/cpanel/userdata/<user>/<domain>. Just wanted to make sure there were not 'gotchas' running userdata_update with no flags since the documentation is pretty sparse.

Many thanks!
 
Last edited: