Revert accounts to package default via CLI

fiif

Registered
Mar 29, 2017
4
0
1
ireland
cPanel Access Level
Root Administrator
Hey. We have a number of cPanel servers where some accounts were kept on a plan but given different quotas. Is there a command we can run over the command line to sync all accounts to the package default. This also causes an issue when we try to update packages via uploading new setting to /var/cpanel/packages as only new accounts get the updated setting and old accounts stay on the old setting. For example if we increase bandwidth from 500mb to 1000mb all accounts on that package keep the old setting unless we make the edit via WHM
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
182
31
103
USA
cPanel Access Level
Root Administrator
Hello @fiif

If you would like to "reset" the package definitions for all accounts that package is assigned to, you can issue the following whmapi1 command:

whmapi1 changepackage user=username pkg=package1

Even if you specify the same package that is already assigned to the account, this command will reset the account to use the package's default settings.

You can read more about this API function on the following page: https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+changepackage