Organizations often migrate the ADManager Plus database from the built-in PostgreSQL to an external Microsoft SQL Server or other external databases to enhance performance, scalability, and reliability.
An external database is better suited for handling large datasets, especially when managing multiple domains. It also supports high availability configurations, ensuring continuous service during failures. Additionally, external databases offer advanced backup, recovery options, and centralized management, while meeting stricter security and compliance requirements.
However, migration can sometimes fail, resulting in errors such as the process stopping unexpectedly, data transfer issues, or connection failures.
The database migration failure may occur due to one or more of the following reasons:
Missing bcp files: The bcp.exe and bcp.rll from the SQL Server installation must be placed in the ADManager Plus bin folder.
Incorrect ODBC driver or command-line utilities: The correct ODBC driver and SQL command-line utilities, corresponding to the SQL Server version, must be installed.
Connectivity issues between ADManager Plus and SQL Server: Firewall rules or network restrictions may be blocking the connection.
The service account does not have the necessary permission: Windows authentication and SQL Server authentication do not have permission to create a database.
The logged-in user lacks permissions to the installation folder: The account that executed the ChangeDB.bat file from the Command Prompt may not have adequate permissions to update configuration files in the Conf directory.
Password complexity for the SQL account: If an SQL account is used, it must comply with the SQL Server password policy.
Before troubleshooting, ensure:
SQL Server is accessible from the ADManager Plus server.
The necessary ODBC drivers and SQL command-line utilities are installed.
The service account has the necessary permissions.
Follow these steps to diagnose and fix the Microsoft SQL database migration failure.
Navigate to the SQL Server installation directory on your database server.
Locate the following files:
bcp.exe: Found under:
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\<version>\Tools\Binn\
bcp.rll: Found under:
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\<version>\Tools\Binn\Resources\1033\
Copy both the bcp.exe and bcp.rll files.
Paste them into the ADManager Plus bin folder:
C:\ManageEngine\ADManager Plus\bin\
Download the corresponding ODBC driver and SQL command-line utilities from the official Microsoft Download Center.
Install the ODBC driver and utilities on the ADManager Plus server.
Restart the server and retry the migration.
Open the Command Prompt on the ADManager Plus server.
Run the following command to test connectivity:
tnc <SQL_SERVER_HOSTNAME> -port <SQL_SERVER_PORTNUMBER>
If the test connection fails, check the firewall settings.
Ensure that the SQL Server port (1433 by default) is accessible from the ADManager Plus server.
To grant the required permissions:
Open SQL Server Management Studio (SSMS).
Right-click the user (service account used for migration) > Properties > Server Roles. Check whether the user has been assigned the sysadmin role and follow the steps below:
If yes, proceed to migration.
If not, check the Sysadmin box and then click OK.
Note: To grant the user only the minimum permissions required instead of a sysadmin role, follow the two steps below:
Right-click the user > Properties > User Mapping. Check the boxes next to db_datareader, db_datawriter, and db_ddladmin and click OK.
Right-click the database > Properties > Permissions, provide Execute permission for the user, and click OK.
Go to the Security tab.
Select the logged-in user and ensure they have Full Control.
Click Apply and OK.
Retry the migration process.
Open SSMS.
Navigate to Security > Logins.
Right-click the SQL account used for migration and select Properties.
Go to the General tab and verify the password complexity settings.
If needed, reset the password to meet the SQL Server password policy.
Retry the database migration.
Create a dedicated SQL service account with necessary permissions instead of using high-privileged accounts like the sysadmin role for better security and fewer conflicts.
Install the ODBC driver and SQL command-line utilities matching the SQL Server version to avoid compatibility issues during migration.