How to enable the transfer of services from one account to another.
Overview
The Atomia Platform’s default setting is to allow transfers of the types listed below.
- CsDomainParking
- CsDomainNoWebsite
- CsDomainRedirection
- CsDomainFrameRedirection
- CsLinuxWebsite
- DomainRegDomain
It is also possible to allow additional services to be transferred, e.g. CsWindowsWebsite. The transfer can be hooked into the code with a customization plugin (explained below).
The customer can manage transfers in Hosting Control Panel > [Username] > Merge account.
Transfer services with content
The Atomia Platform also offers to transfer databases, but at the moment, the content won’t be transferred. Databases that can be transferred are:
- MySql
- MsSql
- Postgre
Other services with storage data (CsLinuxWebsite, CsWindowsxWebsite) will also be transferred without the content move. But, it is possible to do that as customization with the plugin (PostAutomationServerMerge event in the customization section below).
Configuring package option when multipackage is active
- Open the Web.config file in
C:\Program Files (x86)\Atomia\HostingControlPanel
- Find the OptionTransferServicesOnNewPackage property and configure value, it can be:
- hide – the customer will have the option only to select one of the existing packages
- show – the customer can choose between creating a new package or selecting an existing one
- always – the selected services will always be transferred to a new package
Configuring the service transfer
-
- Open the Atomia.Web.Plugin.Accounts.dll.config file in
C:\Program Files (x86)\Atomia\HostingControlPanel\bin
. - Change the JSON-formatted configuration to fit your additional needs.
- Open the Atomia.Web.Plugin.Accounts.dll.config file in
<pluginSetting name="mergeableServices" value="[{ 'ServiceName':'CsLinuxWebsite', 'DomainNameProperty':'Hostname', 'ServicePath': 'CsBase', 'TargetServiceName':'CsBase' }, { 'ServiceName':'CsDatabase', 'PropertyName':'DatabaseName', 'PropertyServiceName':'CsMSSQLDatabase,CsMySqlDatabase,CsPostgreSQLDatabase' }, { 'ServiceName':'CsDomainParking', 'DomainNameProperty':'Domain' }, { 'ServiceName':'CsDomainNoWebsite', 'DomainNameProperty':'Domain' }, { 'ServiceName':'CsDomainRedirection', 'DomainNameProperty':'Domain' }, { 'ServiceName':'DomainRegDomain', 'ServicePath':'CsDomainRegList','DomainNameProperty':'Name','TargetServiceName':'CsDomainRegList' }, { 'ServiceName':'CsDomainFrameRedirection', 'DomainNameProperty':'Domain' } ]" />
Configuring the display names
During the configuration process to make the service ready for transfer, you can use these properties:
- ServiceName – the service name that should be transferred
- ServicePath – the path where we can find that service
- DomainNameProperty – the property that contains a domain name
- TargetServiceName – the parent service name where we should transfer selected service on target account
- TargetServicePath – where we can that service on target account
- DeleteServiceOnSourceAccount – do you want to delete service on the source account after the transfer is complete (true by default)
- PropertyName – the name of a property which you actually want to display (e.g. PropertyName=DatabaseName for CsDatabase)
- PropertyServiceName – this value can contain several paths separated by a comma because there is a case when the same service can have different child services (e.g. CsDatabase can have CsMySqlDatabase, CsMSSQLDatabase, or CsPostgreSQLDatabase)
- One path should contain a path from service that is being configured (without that service in it) to the child service that has property PropertyName
- Example:
-
{'ServiceName':'CsDatabase', 'PropertyName':'DatabaseName', 'PropertyServiceName':'CsMSSQLDatabase,CsMySqlDatabase,CsPostgreSQLDatabase'}
- Invalid path would be CsDatabase/CsMSSQLDatabase/MSSQLDatabase
-
- The first path that is valid and contains PropertyName in it will be used
Customizing the service transfer
When creating your own customized plugin, there are four different entry points that can be utilized:
- PreAutomationServerMerge
- PreBillingMerge
- PostAutomationServerMerge
- PostBillingMerge
Set the mergeServiceCustomizationClass in the configuration file:
<pluginSetting name="mergeServiceCustomizationClass" value="MergeServiceCustomizationExample.MergeServiceCustomizationExample, MergeServiceCustomizationExample" />
- Create a plugin. A code example can be downloaded here: MergeServiceCustomizationExample
- Compile the plugin and place the DLL (and PDB if you want to debug) in
C:\Program Files (x86)\Atomia\HostingControlPanel\bin
.
If for some reason, you want to transfer some service differently, it is also possible to override it through the customization plugin, but don’t forget to set SkipServiceBinding to true in the PreAutomationServerMerge event and handle the transfer fully.