Migrating the Built-in database server (PostgreSQL) to MS SQL Server or another instance of a PostgreSQL Server.

Supported database migrations:

  • PostgreSQL Server to MS SQL Server or another instance of PostgreSQL Server.
  • MS SQL Server to PostgreSQL Server or another instance of MS SQL Server.

Supported database versions:

  • PostgreSQL: 9.3 to 9.5
  • MS SQL: 2005 and above

To migrate the built-in PostgreSQL to a different database, follow the steps listed below.

Backing up PostgreSQL Data

  • Stop the AD360 Server/Service.
  • Invoke the <AD360 Home>\bin\backupDB.bat in command prompt to backup the data available in PostgreSQL database. By default, the backup file will be stored under <AD360 Home>\Backup\AD360_Backup<Backup_time> directory.

Configuring MS SQL Server

Common Settings to be performed in MS SQL Server

  • Open SQL Server Configuration Manager.
  • Goto SQL Server Services and ensure the service SQL Server Browse' is running.
  • Goto SQL Server Network Configuration → Protocols for SQLEXPRESS (the given instance while configuring the MS SQL) → Enable TCP/IP. Then restart the SQL Server (SQLEXPRESS - the given instance) Service.
  • Set the following configuration for the SQL Server Configuration Manager:
    • SQL Server Network Configuration → Protocols for <instances> → Enable everything.
    • SQL Native Client Configuration → Client Protocols → Enable all.

Providing credentials to other users in the domain

  • Go to SQL Server Management Studio.
  • Expand the following <MACHINE_NAME>\SQLEXPRESS → Security → Logins.
  • Check whether the user provided in the AD360 Service is already in the list.

If not, right click the Logins, New Login and provide a corresponding user name. The New user must have the sysadmin server level role and database level role of db_owner.

Follow the steps to provide the sysadmin role permission:
Right click the user, click 'Properties'
Go to 'Server Roles' → Check sysadmin and click 'OK'

Note: Details about user roles: Refer the documents in the following links:
For Server Level Roles: http://msdn.microsoft.com/en-us/library/ms188659.aspx
For Database Level Roles: http://msdn.microsoft.com/en-us/library/ms189121.aspx
For additional resources: http://www.mssqlcity.com/Articles/Adm/SQL70Roles.htm
Server Role of the user should be 'sysadmin' and Database Role of the user should be 'db_owner'.
The members of sysadmin server role can perform any activity in SQL Server and have completes control over all database functions.
The members of db_owner database role can perform any activity in the database.


MS SQL Server in local computer

Copy the following files to <AD360 Home>\bin folder.

  • bcp.exe- <MSSQL_installed_folder>\Client SDK\ODBC\130\Tools\Binn\bcp.exe
  • bcp.rll- <MSSQL_installed_folder>\Client SDK\ODBC\130\Tools\Binn\Resources\1033\bcp.rll

MS SQL Server in remote computer

Note: Please install the corresponding SQL Native Client / Command line Utilities in the AD360 machine as per the MS SQL Server version and CPU type of AD360 machine.

MS SQL Server Version

Command line Utilities and Native Client

2005

Download

2008

Download

2008 R2 (x64)

Download

2008 R2 (x86)

Download

2012

Download

2014

Download

2016

Download

2017

Download

After installing the Command Line utilities, please copy the following files:

Copy the files to <AD360 Home>\bin folder.

  • bcp.exe- <MSSQL_installed_folder>\Client SDK\ODBC\130\Tools\Binn\bcp.exe
  • bcp.rll- <MSSQL_installed_folder>\Client SDK\ODBC\130\Tools\Binn\Resources\1033\bcp.rll

Windows Firewall Settings

If the Firewall is enabled in MS SQL Server machine, the TCP and UDP Ports need to be opened.

UDP Port is normally 1434.

To check TCP Port settings, open SQL Configuration Manager:

  • SQL Server Network Configuration → Protocols for <instances>
  • Right click TCP/IP → Properties → Goto IP Addresses Tab and scroll until TCP Dynamic Ports and enter the current value in your Firewall.

Steps to migrate database

  1. Log in to AD360 as an administrator.
  2. Navigate to Admin → General Settings → Database Settings → Database Configuration.
  3. Select AD360 under Component Name.
  4. From the Select Database Server menu, select the database server that you want to change to.
  5. If you select PostgreSQL Server, then:
    • In the DB Server Name/IP and Port field, enter the host name or IP address and the port number of the PostgreSQL database server.
    • Enter the Username and Password of a user who has permission to create a new database.
  6. If you select MS SQL Server, then:
    • In the DB Server Name/IP and Port field, enter the host name or IP address and the port number of the MS SQL database server.
    • In the DB Server Instance field, select the SQL Server instance you want to use.
    • If you have already moved the bcp.exe and bcp.rll files, the same will be visible in the Select bcp.exe File and Select bcp.rll File fields. If not, click Browse and select the bcp.exe and bcp.rll files from SQL Server installed directory.
    • For Authentication, you can either use Windows credentials or a SQL Server user account.
    • If you want to use a SQL Server user account, then select SQL Authentication and enter the Username and Password.
    • If you want to use Windows authentication, select Windows Authentication, and enter the username and password of a Windows domain user account. To autofill the username and password of the user currently logged into the machine check the box against Use Default Windows Authentication.
    • Note: The user account used must have permission to create a database in the selected MS SQL Server.

  7. Check the box against Migrate Existing Data to copy the data from your old database to the new database.

    IMPORTANT: Leave this box unchecked only if you want to change the database of a fresh installation of AD360 or its components.

  8. Click Save.