cPanel Backup and Restore via SSH
To perform a backup or restore of a cPanel account via command line, you must have root access to the server.
Creating a backup
To create a backup of your individual cPanel account using SSH:
- Log in via SSH as root user.
- Run the following command:
/scripts/pkgacct username
The backup will be generated and stored in the current working directory.
Restoring a backup
To restore a previously created backup:
- Log in via SSH as root user.
- Navigate to the directory containing the backup file.
- Run the following command:
/scripts/restorepkg username
If the account already exists and you want to overwrite it, use the --skipaccount
flag:
/scripts/restorepkg --skipaccount username
Note
Always ensure you are in the correct directory before running the restore command. Misuse may result in data loss.