Sometimes on cPanel we may need to take backups in different ways. I will explain how to take backups using the /scripts/pkgacct software which can take backups faster than normal. I will also explain how to completely transfer a server to another server using the reverse operation /scripts/restorepkg.
To back up a normal site:
Example: linux10.com with username linuxtr.
To take a backup:
/scripts/pkgacct linuxtrThis will immediately start backing up the account with username linuxtr and place the compressed tar.gz file in the /home directory as cpmove-linuxtr.tar.gz.
Transfer the file to another server via RSYNC or SCP, place it in the /home directory, and restore it:
/scripts/restorepkg linuxtrTo back up all users on the server:
for b in $(ls /var/cpanel/users); do /scripts/pkgacct $b;doneAfter all backups are complete, transfer to another server (example IP 10.0.0.3):
cd /home
scp cpmove-* root@10.0.0.3:/homeIf the destination server uses a different SSH port (e.g. 9980):
cd /home
scp -P9980 cpmove-* root@10.0.0.3:/homeTo restore all backups on the second server:
cd /home
for r in $(ls | grep tar.gz | cut -d- -f2 | cut -d. -f1); do /scripts/restorepkg $r;doneThis backup method is very useful for systems with corrupted disk structures that cannot be fixed with FSCK, and it is also faster than other methods for normal server migrations.
Leave a Comment
* Your comment will be published after approval.
Comments
1<p>Peki Cpanel kullandığımız sunucudan Webuzo kullandığımız sunucuya bu yedeği aktarıp nasıl açabiliriz? Sadece public_html dosyalarını FTP'ye aktarmak için böyle bir işlem yaptığımı varsayın.</p>