Clarification regarding is_backup field in PkgAcct::Create event

Operating System & Version
CentOS 7
cPanel & WHM Version
98.0 (build 2)

sangeeths

Member
May 25, 2021
13
2
78
India
cPanel Access Level
Root Administrator
Our integration is hooking into PkgAcct::Create and PkgAcct::Restore events to aid in user transfer from one server to another for reactivation. We noticed that the hook gets invoked many times with is_backup=0 and is_backup=1. Based on our observations, is_backup=0 is what our integration needs to use to detect the transfer of account event. However, we weren't sure based on reading the API docs that is_backup=0 indicates the "account transfer" use case.

Account transfers currently user pkgacct script as follows:

Code:
$cpscripts/pkgacct --skiphomedir username /root/cpanel_backups/
and subsequently the cpmove archive is copied over to the new server and restored with:

Code:
$cpscripts/restorepkg --allow_reseller cpmove-username.tar.gz
For this and similar use cases, would is_backup=0 be the case all the time? And is is_backup=1 set if --userbackup or --backup=FILEPATH as described over here: The pkgacct Script | cPanel & WHM Documentation

Would greatly appreciate clarifications on when 1 or 0 will be set for this field.
 
Last edited by a moderator:

sangeeths

Member
May 25, 2021
13
2
78
India
cPanel Access Level
Root Administrator
I did some testing with the backup team and you are correct - the =0 value is the one that will normally be used. =1 would be used if either backup or userbackup is true/has a value.
Thanks a lot! Greatly appreciate the quick responses on the questions asked over here from you and the rest of the team