Jump to content

Mass Changing Services Status


RockTBN

Recommended Posts

Hello,

We thinking of enabling Enable Termination in Automation Settings. But we have a lot of services in Suspended status so if we enable this feature the cron jobs will not able to handle that many tasks.

Is there any way to mass changing the status of all Suspended services that are x days old (x = 15, 20 days, etc) to Cancelled/Terminated in WHMCS?

Thanks!

Link to comment
Share on other sites

On 19/08/2019 at 11:04, RockTBN said:

Is there any way to mass changing the status of all Suspended services that are x days old (x = 15, 20 days, etc) to Cancelled/Terminated in WHMCS?

not from within WHMCS - you'd probably have to run a SQL query on the tblhosting table to change the statuses of these suspended services.

Link to comment
Share on other sites

4 hours ago, RockTBN said:

Do you have sample query that I can try?

let's do this in 2 stages... firstly, a simple SELECT query for you to run on tblhosting to see if there are any applicable products that match your criteria...

SELECT tblhosting.*
FROM tblhosting
WHERE
tblhosting.domainstatus = 'Suspended' AND
tblhosting.regdate >= DATE_SUB(NOW(), INTERVAL 15 DAY)

if you run that in phpmyadmin or similar, you should get a list of services that match the query, e.g they're in suspended status and are within 15 days of their registration date (0-15)... if you want over 15 days (15+), then change to <= ... to exactly 15 days, use =

if you're happy with those results, then you could move to the second stage and change their values - as with all UPDATE/DELETE SQL queries, backup the database before running such queries. ⚠️

UPDATE tblhosting
SET tblhosting.domainstatus = 'Cancelled'
WHERE
tblhosting.domainstatus = 'Suspended' AND
tblhosting.regdate >= DATE_SUB(NOW(), INTERVAL 15 DAY)

and change the >= to whatever you used in the select query.

Link to comment
Share on other sites

13 hours ago, brian! said:

let's do this in 2 stages... firstly, a simple SELECT query for you to run on tblhosting to see if there are any applicable products that match your criteria...


SELECT tblhosting.*
FROM tblhosting
WHERE
tblhosting.domainstatus = 'Suspended' AND
tblhosting.regdate >= DATE_SUB(NOW(), INTERVAL 15 DAY)

if you run that in phpmyadmin or similar, you should get a list of services that match the query, e.g they're in suspended status and are within 15 days of their registration date (0-15)... if you want over 15 days (15+), then change to <= ... to exactly 15 days, use =

if you're happy with those results, then you could move to the second stage and change their values - as with all UPDATE/DELETE SQL queries, backup the database before running such queries. ⚠️


UPDATE tblhosting
SET tblhosting.domainstatus = 'Cancelled'
WHERE
tblhosting.domainstatus = 'Suspended' AND
tblhosting.regdate >= DATE_SUB(NOW(), INTERVAL 15 DAY)

and change the >= to whatever you used in the select query.

You saved my life! Thank you very much!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated