Moving services between accounts

Tags: 334 views 0

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.

Image: Move services between accounts.

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).

Important!

As mentioned above, the website content won’t be transferred (yet), but also customer may lose statistics for the website. This can be also solved from the plugin (e.g. backup in PreAutomationServerMerge event and restore in PostAutomationServerMerge event).

Configuring package option when multipackage is active

  1. Open the Web.config file in C:\Program Files (x86)\Atomia\HostingControlPanel
  2. Find the OptionTransferServicesOnNewPackage property and configure value, it can be:
    1. hide – the customer will have the option only to select one of the existing packages
    2. show – the customer can choose between creating a new package or selecting an existing one
    3. always – the selected services will always be transferred to a new package

Configuring the service transfer

    1. Open the Atomia.Web.Plugin.Accounts.dll.config file in C:\Program Files (x86)\Atomia\HostingControlPanel\bin.
    2. Change the JSON-formatted configuration to fit your additional needs.
 <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' } ]" />

Important!

When working with configuration files in Atomia software, it is important that you edit them through transformation files. Please consult our documentation before editing any configuration files. If the files are edited directly the changes will be overwritten by any updates to Atomia.

Configuring the display names

During the configuration process to make the service ready for transfer, you can use these properties:

  1. ServiceName – the service name that should be transferred
  2. ServicePath – the path where we can find that service
  3. DomainNameProperty – the property that contains a domain name
  4. TargetServiceName – the parent service name where we should transfer selected service on target account
  5. TargetServicePath – where we can that service on target account
  6. DeleteServiceOnSourceAccount – do you want to delete service on the source account after the transfer is complete (true by default)
  7. PropertyName – the name of a property which you actually want to display (e.g. PropertyName=DatabaseName for CsDatabase)
  8. 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

Useful tip

If you want to override display names, follow the steps:

  1. Navigate to the C:\Program Files (x86)\Atomia\HostingControlPanel\Themes\NewDefault\Views\Accounts\Account folder
  2. Override _MergeAccountsScriptsCustom.ascx file from a parent theme.
  3. You should extend the Atomia.RESXobject, the key should be:
    1. PropertyName (or DomainNameProperty if PropertyName does not exists)
    2. ServiceName property (name of the Provisioning Service)

Code example:

<script type="text/javascript">
Atomia.RESX = Atomia.RESX || {};
    $.extend(Atomia.RESX, {
        CsLinuxWebsite: 'Linux website service',
        CsDatabase: 'Database',
        CsDomainParking: 'Domain parking service',
        DatabaseName: 'Database name => ',
        Hostname: 'Linux Hostname:  '
    });
</script>

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" />
  1. Create a plugin. A code example can be downloaded here: MergeServiceCustomizationExample
  2. 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.


Good to know

You can use additional events in your plugin by implementing the IMergeAccountHookExtra interface. By implementing this interface, you get two one-time events:

  • PreMergeServices event will be fired before the internal transfer is started
  • PostMergeServices event will be fired after the internal transfer is finished

If you want to use these events, you need to change the UseMergeAccountHookExtra property to true in C:\Program Files (x86)\Atomia\HostingControlPanel\Web.config file and to implement IMergeAccountHookExtra interface. You can download the example with both interfaces here: InternalTransferCustomPlugin.

Was this helpful?