The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel Migration - cloudlinux php selector

Discussion in 'CloudLinux' started by murmaider, Mar 19, 2014.

  1. murmaider

    murmaider Registered
    PartnerNOC

    Joined:
    Apr 5, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    I've noticed that when migrating cPanel accounts between servers, if the account has a PHP version selected (not native) this setting isn't carried over to the new server during the cpanel copy/transfer. So when doing a mass migration of 100's of accounts, we need to go through each of them individually and set their php version again.

    Is this intended or a bug?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    cPanel will not transfer PHP selector configuration values when an account is copied to another server. You may find more information directly related to where Cloud Linux settings are stored (in order to manually copy that data for all accounts) on the Cloud Linux support forums or their documentation.

    Thank you.
     
  3. ivan.g

    ivan.g Member

    Joined:
    Mar 5, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Cloudlinux documentation has command line tool to manually set PHP version for specified usernames. So assuming you have 4 versions of PHP you may need to run it 4 times setting proper PHP verson for usernames requiring it. Same applies to your source server - using CL terminal utilities you can get a list of usernames and their PHP versions. Comes down to running few commands in terminal.
     
  4. ivan.g

    ivan.g Member

    Joined:
    Mar 5, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    To be precise:

    Get the list of all users in the old system, then find the PHP version:

    /usr/bin/cl-selector --current=php --user=USERNAME will retrieve PHP version set for a particular user. The script gets the path from /var/cagefs/USERID/USERNAME/etc/cl.sel/php symlink, compares it with contents of /etc/cl.selector/selector.conf file and if path is valid, prints out the current interpreter version.


    In the destination server, repeat in reverse, setting PHP version for all usernames
    /usr/bin/cl-selector --select=php --version=5.3 --user=USERNAME sets the current PHP version for particular user by creating symlink in /var/cagefs/USERID/USERNAME/etc/cl.selector directory. All old symlinks are removed, and new symlinks are set.

    For bulk information retrieval and updates regex commands are your friends.
     
Loading...

Share This Page