Change account path / mounting point?

Micah_T

Registered
Sep 30, 2017
2
0
1
LA
cPanel Access Level
DataCenter Provider
Hi, I am trying to use S3FS for the accounts directories.

Then WHM > Rearrange Accounts, the function works. However, rsync to S3 is extremely slow!!!

Beside rsync, I can use aws s3 sync which is much much faster.


My question is

1. I can move file by my self, but where I can manually change the path info?

I checked /var/cpanel/userdata/<account>, some suspect files, changed info, no works.


2. If #1 is not working, how can i change the rsync command line output by the Rearrange Account function? I can replace it with aws s3 sync , however I think this way is not wise.


Thank you very much!
 

plague

Well-Known Member
Sep 22, 2006
67
14
158
Brasil
cPanel Access Level
Root Administrator
Twitter
Hey @Micah_T , I use this commands to move accounts manually:

Code:
rsync -av /home/$user /home1/$user
replace /home/ /home1/ -- /var/cpanel/userdata/$user/*
replace /home/ /home1/ -- /etc/proftpd/$user
replace /home/ /home1/  -- /home/$user/etc/*/passwd
replace /home/$user /home1/$user  -- /etc/passwd
cagefsctl --disable $user
cagefsctl --enable $user
service dovecot restart
/scripts/rebuildhttpdconf && service httpd restart
mv /home/$user/ /home/$user.old/
ln -s /home1/$user /home/$user
Just check the path, replace rsync and adjust to your needings.

Another way to achieve this is to make a copy of the user's folder and chmod the original to 000 permission:

Code:
cp -al /home/user /home/user.bkp
chmod 000 /home/user
then start the copy process on WHM. The process will fail to copy the data, but will replace and modify the user's mount point (it will also remove the original user's folder, that's why I make the copy). Then you sync the backup folder to the new location.

I hope this helps.