cPanel Backup problems

musioc

Well-Known Member
Aug 4, 2011
127
1
68
Hello dears

We was introduced a system to terminate and then restore backup via API
Problems :
1 - Subdomains will not restore even if we use parameter &subdomains=1
2 - Recently we found that cPanel does not delete cpanel databases after terminating user account
So cpanel user backup will not restore and we have to drop databases via phpmyadmin and then try to restore manually :(
 

musioc

Well-Known Member
Aug 4, 2011
127
1
68
I think terminate account is ok (manual terminate)
But when I use API problem occurs and then I can not remove databases even via terminate an account in whm
So I have to remove them from phpmyadmin

This is API (removeacct) result :
{"result":[{"status":1,"statusmsg":"username account removed","rawout":"Running pre removal script (/usr/local/cpanel/scripts/prekillacct)......Done
Collecting Domain Name and IP...User: username
Domain: domain-name.com
...Done
Locking account and setting shell to nologin...Locking password for user username.
passwd: Success
...Done
Killing all processes owned by user......Done
Removing Sessions.........Done
Removing Suspended Info.........Done
Cleaning Virtfs.........Done
Removing Web Logs......Done
Removing Bandwidth Files......Done
Removing Email Sending Limits Cache......Done
Removing DKIM keys......Done
Removing Crontab......Done
Removing HTTP Virtual Hosts...Removed the following non-SSL virtual hosts: domain-name.com news.domain-name.com
Removed the following SSL virtual hosts:
...Done
Removing ftp Virtual Hosts......Done
Removing user's web content directory symlinks......Done
Removing MySQL databases and users......Done
Removing MySQL horde data......Done
Removing PostgreSQL databases and users......Done
Removing User & Group.......Success...Done
Removing DNS Entries...domain-name.com => deleted from server.
domain-name1.bpums.ac.ir => deleted from server.
...Done
Removing Email Setup...Removing /etc/valiases/domain-name.com
Removing /etc/valiases/domain-name1.maindomain.com
Removing /etc/valiases/sub1.domain-name.com
Removing /etc/valiases/sub12.domain-name.com
Removing /etc/valiases/first.domain-name.com
Removing /etc/valiases/news.domain-name.com
...Done
Removing mailman lists......Done
Updating Databases......Done
Removing bandwidth limits......Done
Removing Counter Data......Done
Adding IP back to the IP address pool...System has 2 free ips.
...Done
Removing user's cPanel Databases & Updating......Done
Reloading Services......Done
Removing mail and service configs...
...Done
Removing Logaholic Webstats...Id: TQ:TaskQueue:221121
...Done
Sending Contacts......Done
Updating internal databases...Updating ftp passwords for username
Purging ftp user username
Ftp password files updated.
Ftp vhost passwords synced
...Done
Running post removal scripts (/usr/local/cpanel/scripts/legacypostkillacct, /usr/local/cpanel/scripts/postkillacct)......Done
Account Removal Complete!!!...username account removed...Done
"}]}
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Could you let us know which particular API you are using to terminate the account? Could you elaborate a little more on the nature of this custom script? The log output you provided shows the databases were successfully removed.

Thank you.
 

musioc

Well-Known Member
Aug 4, 2011
127
1
68
Hello
I am sure cPanel backup Or cpanel Terminate api has problem
We update cPanel in stable mode but problem exists yet.

We use https://server:2087/json-api/removeacct?user=username api (json or xml) to terminate account
Then we use https://server:2087/xml-api/createacct?username=... to create account
and then using these 2 api to add backup queue and activate queue
1 - https://$server:2087/json-api/restore_queue_add_task?api.version=1&user=username&restore_point=$restore_point&subdomains=1&mail_config=1&mysql=1&give_ip=0
2 - https://server:2087/json-api/restore_queue_activate?api.version=1

We did not changed this script recently. It worked well about 2 or 3 months ago but now it has broken for all of our servers (about 10 servers)


The problem is that terminate api can not remove mysql databases. I have to go to phpmyadmin and remove them manually and then re-run restore queue.

- - - Updated - - -

It is OK if I terminate account via WHM and try to restore backup (via api)
It is not OK if I terminate account via api and then try to restore account via WHM
It is not OK if I terminate account via api then create account and terminate again via whm, because I have to manually remove databases.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Please feel free to open a support ticket so we can reproduce this issue. You can post the ticket number here so we can update this thread with the outcome.

Thank you.