Help Center

Optimize accounts with manual rearrange

Performing a rearrange of an account hosted in cPanel may be necessary in certain situations. This process involves changing the partition where the account is hosted and can be beneficial for several reasons:

Improved Performance: If you notice that your account's performance has decreased due to the load from other accounts on the same partition, a rearrange can help distribute resources better and enhance overall performance.

Additional Space: If your account needs more disk space, and the current partition is nearly full, a rearrange allows you to move it to a partition with more available space.

Organization and Management: Sometimes, it's convenient to group related accounts or those from the same project in the same partition to facilitate resource management and organization.

Remember that rearranging involves a process that can temporarily affect the account's availability, so it's essential to do it during periods of low activity. Make sure to back up important data before proceeding.

Below, we present a step-by-step tutorial on how to perform a rearrange or change the partition of an account hosted in cPanel. Follow the instructions carefully to complete the process safely and efficiently.

  1. Create a "screen." If your internet connection is lost, the process will remain active
    # screen -S [SCREEN_NAME]
  2. Synchronize your content by sending an email to your email account when it finishes. This will help you know when a large account synchronization is completed without needing to monitor the computer
    # rsync -avhzo /source_home/USERNAME/ /destination_home/USERNAME && echo "USERNAME synchronized" | mail -s "account synchronized" notification.email@domain.com
  3. Once synchronization is complete, you'll need to make partition changes within the "userdata" and "proftpd" folders
    # sed -i 's/source_home/destination_home/g' /var/cpanel/userdata/USERNAME/* && sed -i 's/source_home/destination_home/g' /etc/proftpd/USERNAME
  4. Modify the location of your application passwords. You'll need to manually search for your USERNAME and replace source_home with destination_home
    # nano /etc/passwd 
  5. Adjust email parameters, restart services, and update cagefs for this user (if you use CloudLinux)
    # sed -i 's/source_home/destination_home/g' /destination_home/USERNAME/etc/*/passwd && /scripts/rebuildhttpdconf && service httpd restart && service pure-ftpd restart && /scripts/updateuserdatacache && cagefsctl -m USERNAME

Remember, you should only change the following data:

  • source_home
  • destination_home
  • USERNAME

Last updated: 25 de abril de 2024

Estimated reading time: 4 minutes

Did this article help you?
Let's Do It!

Start TODAY for only $2.45/month

Includes a web builder, 30GB of cloud storage, +200 Apps, and professional email.

Sign Up Now