Introduction:
Creating and restoring backups of cPanel accounts is a crucial task to safeguard website data and configurations. The command-line interface (CLI) provides a convenient way to perform these operations efficiently. In this guide, we’ll walk through the steps to generate a backup and restore entire cPanel account using the pkgacct
and cpmove
utilities.
Backup Generation:
1. Use an SSH client to connect to our server’s command-line interface.
$ ssh root@ip-address |
2. Change to the directory where cPanel scripts are located. This will typically be in /scripts a directory. Use the following command.
$ cd /script |
3. Use the pkgacct
command to create a backup of the cPanel account. Replace ACCOUNT_USERNAME
with the actual cPanel account username, and DESTINATION_PATH
with the desired path where we want to store the backup file.
$ ./pkgacct Accout-Username Destination-path |
This command will create a backup of the specified cPanel account and store it in the specified destination directory.
4. The pkgacct
process may take some time, depending on the size of the account. We can monitor the progress by observing the output in the terminal.
5. Once the backup process is complete, we will find a compressed backup file in the destination directory which is specified. The file will typically have a name like cpmove-ACCOUNT_USERNAME.tar.gz
.
Restoration:
1. Similar to the backup process, connect to our server via SSH
2. Change to the cPanel scripts directory.
$ cd /scripts |
3. Use the restorepkg
command to restore our cPanel account. Replace BACKUP_FILENAME
with the actual backup file name.
./restorepkg BACKUP_FILENAME |
4. Observe the terminal for progress updates as the restoration process takes place.
5. Once the restoration is complete, log in to our cPanel interface and verify that all files, databases, and configurations have been restored successfully.
Conclusion:
Effectively generating and restoring backups from the command line is essential for maintaining the integrity of our cPanel account. Regular backups ensure data security and provide a reliable solution for disaster recovery scenarios.