How to find all subscriptions that exist in the Operations Automation Database and does not in the Business Automation Database for further deletion of such subscriptions.
There is no such functionality in OA but the following selects from the Databases can be compared in order to find the aforementioned subscriptions:
From Operations Automation Database:
plesk=> \o /tmp/dbpoamn.txt plesk=> select sub_id from subscriptions where is_active=1 order by sub_id asc; plesk=> \o
From Business Automation Database:
pba=> \o /tmp/dbbilling.txt pba=> select "subscriptionID" from "Subscription" where "Status"=30 order by "subscriptionID" asc; pba=> \o
To delete these subscriptions, use OpenAPI method pem.removeSubscription:
Create a pem.removeSubscription.xml file on the OA Management Node with the following content:
<?xml version='1.0'?> <methodCall> <methodName>pem.removeSubscription</methodName> <params> <param> <value> <struct> <member> <name>subscription_id</name> <value><int>SUB_ID</int></value> </member> </struct> </value> </param> </params> </methodCall>
SUB_IDin the content above with the ID of the existing subscription you are about to remove.
Send an XML API request to OA using the curl utility:
curl -firstname.lastname@example.orgSubscription.xml http://localhost:8440