Goal

  • Move MN from Windows Server 2003 to Windows Server 2012 R2
  • Move MN DB from MS SQL Server 2005 to MS SQL Server 2014

General Concept

  1. Migration of POA DB is performed by moving POA database files to the new database server
  2. Migration of POA MN is performed by deploying a new clean POA and reconfiguring it to use the existing database
  3. Migration is performed after the upgrade to 6.0

Requirements

  • New Windows Server 2012 R2 with MS SQL Server 2014
  • New Windows Server 2012 R2 node for MN with SQL Server

Stages

  1. Deployment of new nodes for MN and DB server
  2. Installation of a clean POA 6.0 on a new node with the latest POA updates
  3. Moving original DB from the old server to the new one
  4. Upgrade original POA to 6.0
  5. Syncing the installed packages on the node with packages from upgraded(?)
  6. Moving the IP address and the hostname from the old MN to the new node.
  7. Switching the new POA to the original DB.

Procedure

Deploying new nodes for MN and DB server

Install a clean Windows Server 2012 R2 with MS SQL Server for new MN node.
Install clean Windows Server 2012 R2 with MS SQL Server for database migration

Use the Hardware Requirements to deploy new hosts for management node and SQL server

Installing of clean POA 6.0 on new node with latest POA updates

Use Windows Platform Deployment Guide to deploy a new 6.0 on new host

Moving original DB from old server to the 2012

This is required operation to upgrade original management node to 6.0 because 6.0 doesn't support SQL Server 2005

Requirements: New node with SQL Server 2014 is deployed

  1. Get plesk login/password from etc\Kernel.conf inside PEM directory on the original POA core.

    dsn_login=plesk  
    dsn_passwd=xxxxx
    
  2. Stop poa
  3. Login to the old DB server and open SQL Management studio
  4. Check location of the files of plesk database
  5. Detach database plesk on old server via:

    SQL Server > Databases > plesk > Tasks > Detach…

  6. Copy database files

    • plesk.mdf
    • plesk_log.LDF

    to the new DB server

  7. Open SQL Management studio on new server
  8. Attach copied files to the server via

    SQL Server > Attach… > Add

  9. Create plesk login:

    In SQL Server > Security > Logins > New Login…:

    • Login name: plesk
    • SQL Server autentification: ok
    • Password: <password from step 1>
    • Enforce password policy: Off
    • Default database: plesk
  10. Make plesk user the owner of plesk database:

    SQL Server > plesk > Properties > Files
    Owner: plesk

  11. Login to POA MN
  12. Change DB IP in registry to new DB Server
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\plesk\Server
    or
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\plesk\Server
  13. Start POA

Upgrade original POA to 6.0

Perform an upgrade of the original POA core from 5.5.x to 6.0 according to Upgrade Workflow Guide

Sync installed packages on new node with packages from original

  1. Check that both MN servers have the same list of installed modules:
    PCP > Infrastructure > Modules
  2. Install the missing modules on destination server
  3. Check that both servers have the same list of installed packages: Infrastructure > Service Nodes > <MN NODE> > Packages

Note: You can get the complete list of installed packages form both server directly from database via SQL query:

select p.name, p.version, p.ctype, pl.arch, pl.opsys, pl.osrel from components c join packages p on c.pkg_id=p.pkg_id join platforms pl on p.platform_id= pl.platform_id where host_id=1 order by name, ctype, version  

And when you can simply compare lists in excel. 4. Install missing packages on destination server through UI:
Infrastructure > Service Nodes > <MN NODE> > Packages > Install Package

More details on troubleshooting the packages installation may be found here

Moving the IP address and the hostname from the old MN to the new node

Change the hostname

  1. Get the hostname of original server
  2. Rename original server to <HOSTNAME>-OLD by OS means
  3. Rename new server to <HOSTNAME> by OS means
  4. If hosts are members of same domain you would need an account with the corresponding permissions (for example, Domain Administrator)

<HOSTNAME> – real hostname of original management node

Move IP from original server to the new

Use the OS/network tools to change the IPs.

Switching new POA to the original DB

Modification of config files

  1. pemui, pem, pau must be stopped on the original and then the new node.
  2. Copy the following files from the PEM directory on the original node to the new one without modifications, and make backups of the originals from new node:

    credentials\keystore.jks
    credentials\truststore.jks
    etc\keys\sn_private_key.pem
    jboss-eap-6.2\bin\ds-run.cli
    
  3. Copy following files as well:

    etc\Kernel.conf
    etc\pleskd.props
    jboss-eap-6.2\bin\tune-jboss-run.cli
    jboss-eap-6.2\standalone\configuration\standalone-full.xml
    

    and replace old POA location path to the Program Files (x86) in these files.

  4. Replace value of os.arch in pleskd.props with:

    os.arch=x86_64
    
  5. Change DB IP in registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\plesk\Server or
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\plesk\Server
  6. Copy all files from directory:

    ui\WEB-INF\conf\includes
    

    Except for

    specific.properties
    
  7. Change the hostname in registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SWsoft\PEM\<HOST_NAME>
    Where HOST_NAME should be the hostname of original node. Otherwise pleskd would not start since it is not able to locate its regstry config.

  8. Copy APS folder from original host to the location

    C:/Program Files (x86)/SWsoft/PEM/
    

    Except for

    APS/tools/apslin/apslint.bat
    

    This part is done due to some paths being hardcoded in this .bat.

DB Modifications

ALL BELOW EXAMPLES ASSUME THAT OLD LOCATION IS \Program Files\SWsoft\PEM
You may need to modify script for the specific location

  1. Get POA location path from DB:

    select cp.component_id, p.name, pv.value from  component_properties as cp join property_values as pv on cp.value_id = pv.value_id join properties as p on cp.prop_id = p.prop_id join components c on  pv.component_id=c.component_id and c.host_id=1 where name='plesk.rootpath';
    
  2. Execute queries below in the database to update properties of plesk package on the new node:

    update components set rootpath = replace(rootpath, 'Program Files', 'Program Files (x86)') where host_id = 1;
    
    update hosts set default_rootpath= replace(default_rootpath, 'Program Files', 'Program Files (x86)'), platform_id=(select platform_id from platforms where opsys='Win32' and osrel='6.2'), platform_desc='x86_64 Win32 6.2' where host_id=1;
    
    update ppm_mirrors set local_path = replace(local_path, 'Program Files', 'Program Files (x86)') where host_id=1;
    
    update proxies set proxy_root = replace(proxy_root, 'Program Files', 'Program Files (x86)') where host_id=1;
    
    update sc_instances set location_id = replace(location_id, 'Program Files', 'Program Files (x86)') where component_id in (select distinct component_id from components where host_id=1);
    
    update property_values set value = replace(value, 'Program Files', 'Program Files (x86)') where value like '%Program%PEM%' and component_id in (select distinct component_id from components where host_id=1);
    
    update aps_package set archive_uri = replace(archive_uri, 'Program Files', 'Program Files (x86)'), metafile_uri= replace(metafile_uri, 'Program Files', 'Program Files (x86)'), content_root_uri= replace(content_root_uri, 'Program Files', 'Program Files (x86)');
    
  3. Check if other records with incorrect paths are present in propery_values table:

    select * from property_values where value like ('%Program Files%') and value not like ('%x86%') and component_id in (select distinct component_id from components where host_id=1);
    
  4. Validate the result and update the table with the query:

    update property_values set value = replace(value, 'Program Files', 'Program Files (x86)') where value like ('%Program Files%') and value not like ('%x86%') and component_id in (select distinct component_id from components where host_id=1);
    

IIS bindings reconfiguration

Following commands modify the POA PPM local storage and the POA task logs website.

Open PowerShell:

> Import-Module WebAdministration
> cd IIS:\Sites
> $i = Get-Item "Initial POA tarballs storage"
> $i

In output check the NEW_IP in bindings section and execute:

> $i.bindings.Collection.Item(0).bindingInformation = $i.bindings.Collection.Item(0).bindingInformation –replace "NEW_IP", "ORIGINAL_IP"
> $i | Set-Item
> $i = Get-Item "POA Task Logs"
> $i

In output check the NEW_IP in the binding section and execute:

> $i.bindings.Collection.Item(0).bindingInformation = $i.bindings.Collection.Item(0).bindingInformation –replace "NEW_IP", "ORIGINAL_IP"
> $i | Set-Item

Troubleshooting

  • In case pau fails to start complaining about invalid deployment UUID(visible in console.log - locate the UUID from backed up standalone-full.xml and replace it in the current file.
  • In case pem service fails to start - you may try running pleskd.exe with key --log-to-stderr - some logging would appear in cmd window.

Internal content