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.

Rearrange Accounts Function

Discussion in 'General Discussion' started by bigal, Nov 28, 2009.

  1. bigal

    bigal Member

    Joined:
    Nov 10, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    If I use

    WHM -> Account Functions -> Rearrange Accounts

    and moved user from

    /home/user to /home2/user

    would the user need to change their website script (config file)?
    for example Joomla configuration menu saves the
    log and tmp path under the global configuration menu.
    The values in there would still be /home/user
     
    #1 bigal, Nov 28, 2009
    Last edited: Nov 28, 2009
  2. thewebhostingdi

    thewebhostingdi Well-Known Member

    Joined:
    Jan 10, 2008
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Yes, you will have to manually change the path from home directory to home2 directory in your configuration file.
     
  3. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    You could also use a symlink to redirect accesses to the /home/user subdirectory to the new /home2 location.

    ie: ln -s /home2/user /home/user
    (you may need to remove any old copy of /home/user first)
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    It is correct that individual (add-on or custom) script configurations should be updated to ensure proper functionality with a new home directory path and or new username. A symbolic link from the old path pointing to the new path could also be used; however, in my professional opinion I believe this is more of a temporary workaround, allowing more time to update script configurations, rather than a long-term solution.
     
  5. bigal

    bigal Member

    Joined:
    Nov 10, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for all the advice.
     
  6. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Don, yes, you're right; a symlink is only a short term solution really, I hadn't meant to imply that a symlink should be used rather than updating scripts to use the real home directory.

    The best way to do that is to write path-independent code, of course. For instance, one could use the home directory from the environment, from a local config file, or from the "pwd" command, rather than hardwiring the "/home" or "/home2" string into scripts all through your site.
     
  7. bigal

    bigal Member

    Joined:
    Nov 10, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I noticed that I can't rearrange account unless I have a new disk.
    I loaded the new disk and set a mount /home2

    In my test I rearrange a user from /home/user to /home2/user
    now I want to rearrange the user back from /home2/user to /home/user
    there is no option

    The option displays
    "Please choose a new mount point for this account: Sorry there is only one drive in this machine"

    This is my df output
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
    297513408 3912452 278244236 2% /
    /dev/sda2 988116 17696 919416 2% /tmp
    /dev/sda1 248895 18736 217309 8% /boot
    tmpfs 1037744 0 1037744 0% /dev/shm
    /dev/hdb1 38456308 217960 36284848 1% /home2

    What happened there?
    I can't rearrange back from /home2/user to /home/user
     
    #7 bigal, Dec 4, 2009
    Last edited: Dec 4, 2009
  8. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Rearrange an Account Function and home directory paths without a dedicated partition

    Via root SSH access, what is the output from the following command?
    Code:
    # mount
    If the primary "/home" path is not its own partition and is instead just a directory located in the root file system then that may be why it is not being detected and displayed by the Rearrange an Account feature in WHM; this feature was designed to move accounts between partitions, not between directories. For reference, we are aware of the requested need for an enhancement of the existing feature and are tracking this via the following internal case ID: #4226

    In the meantime a workaround is available. If there is no dedicated home partition and if it is just a directory, it is possible to manually trigger the rearrange action by using a WHM URI like the following that specifies the full directory path to your new mount point:
    Code:
    /scripts/dorearrange?mnt=/full/path&user=username
     
  9. bigal

    bigal Member

    Joined:
    Nov 10, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    mount ouptut is

    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/sda2 on /tmp type ext3 (rw,noexec,nosuid)
    /dev/sda1 on /boot type ext3 (rw)
    tmpfs on /dev/shm type tmpfs (rw)
    /dev/hda1 on /backup type ext3 (rw)
    /dev/hdb1 on /home2 type ext3 (rw,usrquota)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    /tmp on /var/tmp type none (rw,noexec,nosuid,bind)

    I understand now, thanks, there needs to be a /home partition mounted instead of home directory sitting in /

    There is no such file in /scripts/dorearrange . This executable does not exist.
    I also noticed a symbolic soft link was created from from Rearrange Account Function in /home/<username> -> /home2/<username.
     
    #9 bigal, Dec 5, 2009
    Last edited: Dec 5, 2009
  10. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    To help clarify, the example URI is one that is used via WHM access; here is an example full URL, where "server" can be the server hostname, IP address, or a hosted domain name:
    Code:
    https://server:2087/scripts/dorearrange?mnt=/full/path&user=username
     
Loading...

Share This Page