Difference between revisions of "Domain Synchronisation"

From WHMCS Documentation

Line 1: Line 1:
==An introduction==
+
The domain sync task is responsible for ensuring the next due date, expiry date, and status are up-to-date on all '''Pending Transfer''', '''Pending Registration''', and '''Active''' status domains where a valid registrar module is set on the domain itself.
  
The domain sync task is responsible for ensuring the Next Due Date, Expiry Date and Status are up to date on all Pending Transfer, Pending Registration and Active status domains where a valid registrar module is set on the domain itself.
+
==The Domain Sync Task==
  
==How it works==
+
The domain sync task works by using the domain synchronization functions built into each registrar module (if the module supports Domain Sync Script in the documentation for the module) to check 50 domains per run from the oldest to newest in your WHMCS installation. '''Pending Transfer''', '''Pending Registration''', and '''Active''' status domains are handled separately, so it can do 50 of each during each run.
 
 
The domain sync task works by using the domain synchronization functions built into each registrar module (if the module supports Domain Sync Script in the documentation for the module) to check 50 domains per run from the oldest to newest in your WHMCS installation. Pending Transfer, Pending Registration and Active domains are handled separately, so it can do 50 of each during each run.
 
  
 
Active domains will have their Expiry Date corrected to match the registrar if different. If the dates already match it will report "In Sync".
 
Active domains will have their Expiry Date corrected to match the registrar if different. If the dates already match it will report "In Sync".
Line 15: Line 13:
 
When used with the eNom module, the script can also send the Domain Transfer Failed email template if the transfer process fails.
 
When used with the eNom module, the script can also send the Domain Transfer Failed email template if the transfer process fails.
  
For example: if you are using eNom and have 150 Active and Pending Registration domains and 20 in Pending Transfer status, the script will check the 20 Pending Transfer status domains as needed during each run, along with 50 of the Active and Pending Registration status domains, starting over once it reaches the newest domain.
+
For example, if you are using eNom and have 150 Active and Pending Registration domains and 20 in Pending Transfer status, the script will check the 20 Pending Transfer status domains as needed during each run, along with 50 of the Active and Pending Registration status domains, starting over once it reaches the newest domain.
  
Depending on the configuration under '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Automation Settings''' or, prior to WHMCS 8.0, '''Setup > Automation Settings''', the domain sync task will adjust at least the Expiry Date and Status, with the possibility of the Next Due Date if "Sync Next Due Date" is configured. Once the domain sync cron job has completed, an e-mail will be sent to any admins whose administrator role has "System Emails" enabled. If "Domain Sync Notify Only" is enabled, no changes will be made and the e-mail will simply list the changes that would have been made.
+
Depending on the configuration under '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Automation Settings]]''' or, prior to WHMCS 8.0, '''Setup > Automation Settings''', the domain sync task will adjust at least the Expiry Date and Status, with the possibility of the Next Due Date if "Sync Next Due Date" is configured. Once the domain sync cron job has completed, an e-mail will be sent to any admins whose administrator role has "System Emails" enabled. If "Domain Sync Notify Only" is enabled, no changes will be made and the e-mail will simply list the changes that would have been made.
  
==Setting it up==
+
==Configuration==
  
To set up the domain sync task, please configure the following setting under '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Automation Settings''' or, prior to WHMCS 8.0, '''Setup > Automation Settings''' first:
+
Use the following settings to configure the domain sync task at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Automation Settings''' or, prior to WHMCS 8.0, '''Setup > Automation Settings''':
  
* '''Domain Sync Enabled''' — Check to enable the domain date and status synchronisation function.
+
* '''Domain Sync Enabled'''
 +
* '''Sync Next Due Date'''
 +
* '''Domain Sync Notify Only'''
 +
* '''Domain Expiry Sync Frequency'''
 +
* '''Pending Transfer Sync Frequency'''
  
* '''Sync Next Due Date''' — Choose whether to sync the Next Due Date to the Expiry Date and how many days in advance of it (if desired).
+
In version 7.6 and above, the Domain Synchronisation Task is handled by the main cron job. No further setup steps are required.
  
* '''Domain Sync Notify Only''' — If enabled, the domain sync script won't make any changes. It will only notify admins of the changes it would have made. Useful for debugging.
+
=== Configuration in WHMCS 7.5 and Earlier ===
  
* '''Domain Expiry Sync Frequency''' — A value of <tt>0</tt> will check the domain expiration dates every four hours. Use this setting to specify a different frequency. The lowest frequency setting of <tt>1</tt> will check every hour.
+
In version 7.5 and earlier some of these settings are located in the '''Domains''' tab at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > General Settings''' or, prior to WHMCS 8.0, '''Setup > General Settingss'''.
 
 
* '''Pending Transfer Sync Frequency''' — A value of <tt>0</tt> will check the domains in Pending Transfer status every four hours. Use this setting to specify a different frequency. The lowest frequency setting of one will check every hour.
 
 
 
<div class="docs-alert-info">
 
<span class="title">Note</span><br>
 
In version 7.6 and above, the Domain Synchronisation Task is handled by the main cron job. No further setup steps are required.
 
For 7.5 and earlier, additional setup is required:
 
</div>
 
  
In version 7.5 and earlier some of these settings are located under '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > General Settings > Domains''' or, prior to WHMCS 8.0, '''Setup > General Settings > Domains'''. An additional set up step is required to create a cron job to trigger the /crons/domainsync.php file:
+
An additional set up step is required to create a cron job to trigger the /crons/domainsync.php file:
  
 
'''Sample Cron Command'''
 
'''Sample Cron Command'''

Revision as of 18:20, 1 February 2022

The domain sync task is responsible for ensuring the next due date, expiry date, and status are up-to-date on all Pending Transfer, Pending Registration, and Active status domains where a valid registrar module is set on the domain itself.

The Domain Sync Task

The domain sync task works by using the domain synchronization functions built into each registrar module (if the module supports Domain Sync Script in the documentation for the module) to check 50 domains per run from the oldest to newest in your WHMCS installation. Pending Transfer, Pending Registration, and Active status domains are handled separately, so it can do 50 of each during each run.

Active domains will have their Expiry Date corrected to match the registrar if different. If the dates already match it will report "In Sync".

Pending Registration domains will have their Expiry Date corrected to match the registrar if different, and Status set to Active once the registration is complete. If the dates already match it will report "In Sync".

Pending Transfer domains will usually report an error until the transfer process is complete at which point the status will automatically be changed to Active, the Domain Transfer Completed email template sent and the Expiry Date obtained from the registrar.

When used with the eNom module, the script can also send the Domain Transfer Failed email template if the transfer process fails.

For example, if you are using eNom and have 150 Active and Pending Registration domains and 20 in Pending Transfer status, the script will check the 20 Pending Transfer status domains as needed during each run, along with 50 of the Active and Pending Registration status domains, starting over once it reaches the newest domain.

Depending on the configuration under Configuration () > System Settings > Automation Settings or, prior to WHMCS 8.0, Setup > Automation Settings, the domain sync task will adjust at least the Expiry Date and Status, with the possibility of the Next Due Date if "Sync Next Due Date" is configured. Once the domain sync cron job has completed, an e-mail will be sent to any admins whose administrator role has "System Emails" enabled. If "Domain Sync Notify Only" is enabled, no changes will be made and the e-mail will simply list the changes that would have been made.

Configuration

Use the following settings to configure the domain sync task at Configuration () > System Settings > Automation Settings or, prior to WHMCS 8.0, Setup > Automation Settings:

  • Domain Sync Enabled
  • Sync Next Due Date
  • Domain Sync Notify Only
  • Domain Expiry Sync Frequency
  • Pending Transfer Sync Frequency

In version 7.6 and above, the Domain Synchronisation Task is handled by the main cron job. No further setup steps are required.

Configuration in WHMCS 7.5 and Earlier

In version 7.5 and earlier some of these settings are located in the Domains tab at Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settingss.

An additional set up step is required to create a cron job to trigger the /crons/domainsync.php file:

Sample Cron Command

0 3 */2 * * php -q /home/username/crons/domainsync.php

The above example will run every 2 days at 3am.

Common Errors

Sync not supported by module

This indicates that the registrar module set on the domain in question does not support the domain sync functionality and no changes will be made to it as a result. This is most common with third party/custom modules and will need to be fixed by the developer to resolve this.

Curl error - could not connect to host

This is most commonly caused by not whitelisting the server's IP at your domain registrar (for example: eNom or ResellerClub) for API access. You will need to contact them and provide the IP from Help > License Information in your admin area for whitelisting to resolve this.