BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to Compress public_html and Logs while Transferring an Account Between Servers?

Posted by Allura on 08 10 2019.

Introduction
If accounts are reportedly overlarge and is making issue for a user in moving the accounts with the WHM Transfers feature, one will move the accounts manually by working in as the root user. Below are the information that will be used in this review:Username: userDomain: example.comCreate A Temporary Directory With The mkdir Command
To  a run the mkdir command:mkdir /home/user-temp this command is not in producing output.  creates the user-temp directory inside the /home directory.A Compressed Backup Of The public_html Directory
Settings of how cPanel & WHM create subdomain and addon domain directories can be changed. On the other hand, these directories may not exist on some servers in the cPanel account’s public_html directory. One will scan our Tweak Settings – Domains documentation to induce additional data on this subject.The majority of the account’s space utilization happens inside its public_html directory. A user can thus reduce the size of the transfer by…

Introduction

If accounts are reportedly overlarge and is making issue for a user in moving the accounts with the WHM Transfers feature, one will move the accounts manually by working in as the root user. Below are the information that will be used in this review:

Username: user

Domain: example.com

Create A Temporary Directory With The mkdir Command

To  a run the mkdir command:

mkdir /home/user-temp 

this command is not in producing output.  creates the user-temp directory inside the /home directory.

A Compressed Backup Of The public_html Directory

Settings of how cPanel & WHM create subdomain and addon domain directories can be changed. On the other hand, these directories may not exist on some servers in the cPanel account’s public_html directory. One will scan our Tweak Settings – Domains documentation to induce additional data on this subject.

The majority of the account’s space utilization happens inside its public_html directory. A user can thus reduce the size of the transfer by creating a compressed backup of the public_html directory and omit it from the transfer process.

To do this, a user should use this tar command:

tar cvzf /home/user-temp/user-backup.tar.gz /home/user/public_html

Making the use of this above command, the tar utility receives four arguments ( cvzf ) and two input variables ( /home/user-temp/user-backup.tar.gz and /home/user/public_html ).

  • c: This argument creates a new archive.
  • v: This argument prints wordy data concerning the tar utility’s actions to the statement.
  • z: This argument compresses the new archive and saves space.
  • f: Argument enabling the tar utility to read from and write to the specified file.

Move public_html With The mv Command

To do this, a user should run the subsequent mv command:

mv /home/user/public_html /home/user-temp/ 

Keep in mind to never take away the public_html directory before the transfer completion. Also, attempt to maintain the duplicate of the public_html directory throughout the method to certainly revive the location if the method is unsuccessful in any way.

Create Compressed Backup Of Logs

Large logs are generated by large websites. In order to economize the transfer time and space, try creating a compressed backup of these logs. The /usr/local/apache/domlogs directory will store the domain’s Apache weblogs.

To do this, run the following two commands:

tar -cvzf /home/user-temp/user-logs.tar.gz /usr/local/apache/domlogs/example.com

 

mv /usr/local/apache/domlogs/example.com /home/user-temp/

where the first command creates the compressed backup of the domain’s weblogs in the /home/user-temp/user-logs.tar.gz directory, and the other helps in moving the existing web log files to the temporary directory.

Conclusion

All valuable data on compressing public_html logs are outlined in this article review.