Change/Migrate PostgreSQL to MS-SQL Server

In a simple three stage process, migrate the PostgreSQL data and run the RecoveryManager Plus Server with MS SQL Server.

Backing up PostgreSQL Data

  1. Stop the RecoveryManager Plus Server/Service.
  2. Invoke the  <RecoveryManager Plus Home>\bin\backupDB.bat in command prompt, to backup the data available in PostgreSQL database. By default backup file will be stored under <RecoveryManager Plus Home>\Backup\OfflineBackup_YYYYMMDDHHmmss directory .

Configuring MS SQL Server

Common Settings to be performed in MS SQL Server

  1. Open SQL Server Configuration Manager.
  2. Goto ‘SQL Server Services’ and ensure the service 'SQL Server Browser' is running.
  3. 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.
  4. 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 RecoveryManager Plus 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'

Description: note

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 <RecoveryManager Plus Home>\bin folder.

  1. bcp.exe- <MSSQL Installation Dir>\Tools\Binn\bcp.exe
  2. bcp.rll- <MSSQL Installation Dir>\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 RecoveryManager Plus machine as per the MS SQL Server version and CPU type of RecoveryManager Plus machine.


Description: note

SQLServer Version

Command line Utilities

Native Client

2008 R2

Download

Download

2012

Download

Download

2014

Download

Download

2016

Download

Download

After installing the Command Line utilities, please copy the following files:
Copy the files to → RecoveryManager Plus Home → \bin folder.

  1. bcp.exe → MSSQL Installation Dir → \Tools\Binn\bcp.exe
  2. bcp.rll → MSSQL Installation Dir → \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 the 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.

Migrating PostgreSQL Data to MS SQL

  1. Stop the server from start menu or invoke the <RecoveryManager Plus Home>\bin\shutdown.bat to stop the RecoveryManager Plus server in the command prompt.
  2. To migrate database from PostgreSQL to MSSQL with all data intact:
      Open command prompt and navigate to location <RecoveryManager Plus Home>\bin
      Enter the command "changeDB.bat" to migrate database with data intact.

    (OR)

    To change database from PostgreSQL to MSSQL without data:
      Open command prompt and navigate to location <RecoveryManager Plus Home>\bin
      Enter the command "changeDB.bat false" to change database without data.
  1. Database Setup Wizard pops-up.

  1. In the wizard screen, select Server Type as MSSQL ServerAvailable SQL Server Instances are listed in a combo box. Enter the Host Name and Named instance of the SQL Server from the instances.
  2. Select the authentication type using the "Connect Using:" options.
  3. The options are:
    1. Windows Authentication

      For Windows Authentication, the credentials of the Domain user are automatically taken.

    2. SQL Server Authentication

      For MS SQL Server Authentication, enter the User Name and Password.

  4. Click Test Connection to check whether the credentials are correct. If the test fails, the credentials may be wrong, recheck and enter the correct credentials.
  5. Click Save button to save the MS SQL Server configuration. Note that, it will take few minutes to configure the settings of the SQL Server database.
  6. Start the RecoveryManager Plus Server/Service to work with the MS SQL SERVER as the database.
Get download link