A WHM operator clicked terminate on the wrong account. The home directory is gone, MySQL databases are dropped, email is deleted. Recovery is possible from backups but the clock is ticking — JetBackup or R1Soft retention windows govern how long you have, and the cleanup happens by background job, not synchronously.
What’s happening
Terminating a cPanel account through WHM removes the account from /var/cpanel/users/, deletes the home directory, drops MySQL databases owned by the account, removes email accounts, and unschedules cron entries. This is done by /usr/local/cpanel/scripts/removeacct and is irreversible from cPanel’s perspective. Recovery depends on having a recent backup outside cPanel’s view.
How to verify
Check what’s available:
jetbackup5api -F getRestorePoints -D '{"account":"<user>"}'
ls /backup/jb/destinations/*/accounts/<user>/ 2>/dev/null
ls /backup/cpmove-<user>.tar.gz 2>/dev/null
serverbackup-recover --list-recovery-points --host <cpanel-host>
JetBackup retention applies — if the terminated account’s snapshots have been purged because the cPanel record is gone, retention may treat them as eligible for cleanup. Act before that happens.
The fix
- Immediately disable any retention purge jobs that might delete the terminated account’s snapshots.
jetbackup5api -F updateBackupJobwith retention temporarily extended, or disable the purge cron. - Identify the most recent snapshot. JetBackup will still show snapshots for the deleted account if you query by account name. R1Soft will show them in the Backup Manager UI.
- Restore the account from the snapshot via WHM > JetBackup 5 > Restore > Accounts. The cPanel account will be recreated from the backup state. Confirm package, IP, and quota are correct after restore.
- For databases: JetBackup restore includes them, but verify with
mysql -e 'SHOW DATABASES'that the expected databases reappeared andmysqlcheck -Afor integrity. - Communicate the recovery with timestamps: “Account terminated at 14:32, restored from 02:00 snapshot, six hours of data between the snapshot and termination are not recovered.”
- Post-mortem: WHM permissions, not human reflexes, are the right fix. Terminate should require a second-operator confirmation in shared environments.
Stack Harbor handles accidental-termination recovery under environment management when speed matters.