Some CentreStack customers deploy the CentreStack server as an Microsoft Azure virtual machine and would like to use an Azure SQL Database for hosting the CentreStack back end database. This article describes the process of migrating the database from the "all-in-one" local database on the CentreStack server to Azure SQL. The existing "all-in-one" database can be either using the Microsoft SQL Server Express Edition engine or the MySQL engine. SQL Server Express was the default "all-in-one" database deployed prior to version 9.5.5409.41172, while MySQL is the default database engine since version 9.5.5409.41172.
- Create an empty Azure SQL Database. The first few steps of this guide may be used, however stop prior to executing the section that reads Migrate your database: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-migrate-your-sql-server-database
IMPORTANT: The Microsoft Data Migration Assistant must not be used to migrate the database. Instead, recent versions of CentreStack include a new feature to migrate the database from one database engine (or server) to another.
- Start an elevated command prompt (as Administrator) and execute these commands:
reg.exe export "HKLM\SOFTWARE\Gladinet\Enterprise" "%userprofile%\Documents\gcent64.reg"
reg.exe export "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Gladinet\Enterprise" "%userprofile%\Documents\gcent32.reg"
This will backup the registry settings that configure CentreStack for the existing SQL Server Express Edition database.
- Backup the SQL Server Express Edition database. Read this article and download the PowerShell script to backup the database, unless you are familiar with backing up SQL Server: https://support.centrestack.com/hc/en-us/articles/360003603493-SQL-Server-Backup-Script
- Ensure that server firewall rules Azure SQL server allow access from the CentreStack server. One quick test is to download the SysInternal Suite, psping.exe tool and test connectivity from the CentreStack server to the Azure SQL server with a command like this:
where '<azure-sql-server>.database.windows.net' is the fully qualified name of your Azure SQL server. TCP port 1433 is the SQL port Azure SQL is listening on. If feasible, backup the entire CentreStack operating system (as in "make an image"). If this is not feasible, at least backup the entire "C:\Program Files (x86)\Gladinet Cloud Enterprise" directory.
- Upgrade CentreStack to version 9.5.5409.41172 or later
- After the upgrade, sign into the CentreStack server console (or RDP) and use the browser to navigate to: http://localhost/management/migratedatabase.aspx
This screen will be displayed:
- Change the drop down to SQL Server and then set the values to match your Azure SQL deployment:
- Click the MIGRATE button.
- Click the CONTINUE button:
- Have patience. It may take a few minutes for the UI to update after clicking CONTINUE. You should see a message "Waiting for local host" in the browser.
- After a short time the data will be migrated:
- When this message is displayed the migration will be complete and the Azure SQL database will be live:
- Close the browser.
- Execute these PowerShell commands in an elevated PowerShell session to stop the SQL Server service and configure it to be disabled at boot time:
Set-Service 'MSSQL$CENTRESTACK' -StartupType Disabled
- In a browser navigate to: http://localhost/management/clustermgr.aspx
- If the CentreStack web site loads, it is a very good indication that the migration succeeded and the Azure SQL database is working correctly. You could use the Reports section to verify that old data (such as the Audit records) can be retrieved.