Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jun 2010
    Posts
    67

    Default Mass Change cPanel Package Names?

    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!!

  2. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default Modify/Upgrade Multiple Accounts

    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

  3. #3
    Member
    Join Date
    Jun 2010
    Posts
    67

    Default

    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.

  4. #4
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default Edit the /var/cpanel/users files

    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:

    Code:
    # replace "PLAN=default" "PLAN=mynewplan" -- /var/cpanel/users/foo
    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.

    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.

    Code:
    # cp -Rp /var/cpanel/users /root/users-pre-replace.bak
    # replace "PLAN=xxxx" "PLAN=xaxa" -- /var/cpanel/users/*
    # /scripts/updateuserdomains
    /scripts/updateuserdomains should be run anytime any file is edited in the /var/cpanel/users directory.

    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

  5. #5
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default That is correct

    Quote Originally Posted by davidelliott View Post
    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'?
    Yes, that is correct. I do recommend backing up the /var/cpanel/users directory first, as I described, just in case of a typographical error while entering the shell commands.
    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

  6. #6
    Member
    Join Date
    Jun 2010
    Posts
    67

    Default

    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'?

  7. #7
    Member
    Join Date
    Jun 2010
    Posts
    67

    Default

    Thanks!

    That helped so much!

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Apr 2007
    Posts
    4

    Default

    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?

  9. #9
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Automation via XML-API and JSON-API

    Quote Originally Posted by mehdi@canaca.co View Post
    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):

Similar Threads & Tags
Similar threads

  1. Mass password change for all cPanel accounts?
    By mm1250 in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 10-01-2010, 01:40 PM
  2. Change names in cPanel x3 theme
    By freeebooks in forum Themes and Branding
    Replies: 1
    Last Post: 08-22-2007, 05:30 AM
  3. change package in whm but not change in cpanel
    By sliktek in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-11-2005, 09:40 PM
  4. package names
    By newsolutions in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-21-2003, 09:00 PM
  5. Replies: 2
    Last Post: 04-30-2003, 05:39 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube