Hello,
Is there way I can upgrade all accounts on my server that are using package name 'xxxx' to a different package name e.g 'xaxa'?
It would save me a lot of time having to upgrade them manually.
Thanks A Lot!!
Hello,
Is there way I can upgrade all accounts on my server that are using package name 'xxxx' to a different package name e.g 'xaxa'?
It would save me a lot of time having to upgrade them manually.
Thanks A Lot!!
In the WebHost Manager, you can use Main >> Multi Account Functions >> Modify/Upgrade Multiple Accounts to change settings, including the package, on multiple accounts at once.
For hands-on assistance, please reference our new support information page: Where should I go for support?
cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation
-- Jared Ryan, Technical Analyst, cPanel Technical Support
That is still time consuming, I was thinking like there is a command in SSH that you type in and gives a list of domains using the package and you can update the package for all the domains listed on the package to a new one. If there isn't, this is maybe something worth thinking about, it would save a lot of time for people.
The package name is stored in each account's file in /var/cpanel/users/. You can use the Linux replace command to search for each instance of a string in a file and replace it. For example:
will replace every instance of "PLAN=default" with "PLAN=mynewplan" in /var/cpanel/users/foo. "PLAN" in this case is the same as "package" in the WHM/cPanel interface.Code:# replace "PLAN=default" "PLAN=mynewplan" -- /var/cpanel/users/foo
You can automate this by using wildcards, though I urge extreme caution when using a wildcard and recommend backing up the /var/cpanel/users directory first.
/scripts/updateuserdomains should be run anytime any file is edited in the /var/cpanel/users directory.Code:# cp -Rp /var/cpanel/users /root/users-pre-replace.bak # replace "PLAN=xxxx" "PLAN=xaxa" -- /var/cpanel/users/* # /scripts/updateuserdomains
I recommend reviewing the documentation for the replace command before using it. You can do this by typing "man replace" at the shell command prompt, or it is available online from several sources, such as this one:
replace(1): string-replacement utility - Linux man page
For hands-on assistance, please reference our new support information page: Where should I go for support?
cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation
-- Jared Ryan, Technical Analyst, cPanel Technical Support
For hands-on assistance, please reference our new support information page: Where should I go for support?
cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation
-- Jared Ryan, Technical Analyst, cPanel Technical Support
So just to confirm
replace "PLAN=xxxx" "PLAN=xaxa" -- /var/cpanel/users/foo
Would replace all the users in the users direct running plan 'xxxx' to 'xaxa'?
Thanks!
That helped so much!
Thanks,
But if the destination package "xaxa" has different parameters (like MAXFTP, MAXSQL, etc) than source package "xxxx", it does not change them and just update the PLAN line in /var/cpanel/users/foo even after running /scripts/updateuserdomains.
Any clue?
Using WebHost Manager and APIs to apply packages should properly update all applicable data. If more automation is desired I would consider creating a custom solution that utilizes the XML and JSON API functions via WHM.
Related API documentation (with examples):
cPResources: Submit a Support Request - Submit a Bug Report - Review existing Tickets-- Donald cPanelDon Holl - Analyst, cPanel Quality Assurance