Overview
When migrating a Vault database from Firebird to SQL Server, you may get an error like this:
The operation failed
Migrating document vault "Vault Name" failed.
Unspecified error. (mfserver)
The login already has an account under a different user name. (ERROR: 15603, SQLSTATE 42000)
Figure 1: Error: The Login already has an account under a different name
Cause
When defining the settings for the SQL server connection, you need to provide two sets of user credentials - a system administrator (or at the minimum, database owner) and a regular user.
There are two known reasons for this error:
- You have added database users manually
- The same credentials are used for both users
You have added database users manually
If the administrator user is not a sysadmin user, you need to create the basic user manually (see the Setting M-Files to Operate Without Sysadmin Role in Microsoft SQL Server.pdf document). It requires that you create the database and set the administrator user as its dbo.
You must not create users for the database, M-Files will create them.
If you create the users in the vault database yourself, you will get that error because M-Files will try to create them as well.
If you can provide sysadmin credentials, it is best to let M-Files generate the basic user.
The same credentials are used for both users
When you provide the same credentials for both users, you will get this error.
Here is a sample configuration that will result in the error. This example uses Windows Authentication on both places, but you may have selected SQL Server Authentication.
Figure 2: Using the same credentials for both users cause the error
Solution
Use different credentials for the two users.
The "Basic user credentials" denote the user that performs the daily operations in the database and as such it does not require system administrator or database owner rights. Therefore, it is recommended that they are not given such rights.
The easiest approach is to select the "Use an automatically generated login" option and let the M-Files server to create an account for the basic user to the SQL server and the database used by the vault. This way you do not have to create the user yourself or manage the password of this user. However, this setting does not work if you are using the database in a high availability group or the DBO user does not have sysadmin rights to the SQL server instance.
Figure 3: Use automatically generated login by M-Files Server for the daily operations
If you cannot use an automatically generated login, you should create a user on the SQL server that is dedicated to this task and is different from the admin/DBO user (such as "sa") used in the first section. This user should not have the sysadmin or DBO role.
You can read more about configuring the users and what to do in case you cannot provide an administrator account in the user guide: Migrating the Vault Database to Microsoft SQL Server
