Removing MFSQL Connector¶
MFSQL Connector has no uninstall program. To remove it, follow the steps below in order, once for each Connector
database. Run the SQL steps as a member of the SQL Server sysadmin role.
Back up the Connector database first if you may need its data later: the class tables, the logs and the settings are all in it.
1. Record the names¶
Several of the names the steps need are kept in the Connector database. Read them before you drop it:
SELECT Name, Value
FROM dbo.MFSettings
WHERE Name IN (N'AppUser', N'AppUserRole', N'AssemblyInstallPath', N'RootFolder', N'FileTransferLocation');
AppUseris the SQL login that MFSQL Connector uses,MFSQLConnectby default.AppUserRoleis the role that login holds inmsdbfor Database Mail.AssemblyInstallPath,RootFolderandFileTransferLocationare folders on the SQL Server.
2. Remove the Web API instance¶
If the vault uses the MFSQL Connector Web API, remove its instance on the web server with
.\Install.ps1 -Instance <Key> -Remove. Section R10 of the
Web API reference describes what the command
removes and what it keeps.
3. Remove the vault applications¶
In M-Files Admin, open the vault’s Applications window and uninstall MFSQL Connector VaultApp. If MFSQL Connector Context Menu UIX V2 is still listed afterwards, uninstall it too. Restart the vault when M-Files Admin asks. Do this in each vault that the Connector database is connected to.
4. Remove the SQL Server Agent jobs and alert¶
The installation creates three jobs and one alert for each Connector database. Replace <database> with the name of
the Connector database:
EXEC msdb.dbo.sp_delete_alert @name = N'MFSQL <database> - M-Files Update Detected';
EXEC msdb.dbo.sp_delete_job @job_name = N'MFSQL Delete History for <database>';
EXEC msdb.dbo.sp_delete_job @job_name = N'MFSQL Validate <database> M-Files Version';
EXEC msdb.dbo.sp_delete_job @job_name = N'MFSQL <database> - Set Assembly Update Flag';
The job MFSQL Delete History for <database> is owned by the Connector login, so remove the jobs before the login
(step 6). Leave the job category Database Maintenance in place: other jobs may use it.
5. Drop the Connector database¶
USE master;
ALTER DATABASE [<database>] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [<database>];
The MFSQL Connector CLR assemblies are inside the database and go with it.
6. Remove the msdb user and role, and the login¶
Skip this step while another Connector database on the same SQL Server still uses the login. Otherwise, use the names from step 1:
USE msdb;
DROP USER [<AppUser>];
DROP ROLE [<AppUserRole>];
USE master;
DROP LOGIN [<AppUser>];
7. Server settings¶
The installation turns on the server options clr enabled and Database Mail XPs. Leave them on if anything else
on the SQL Server uses CLR or Database Mail. A Database Mail profile set up for MFSQL Connector can be removed in the
Database Mail configuration if nothing else uses it.
8. Folders and the installation package¶
Delete the folders recorded in step 1 once you no longer need the files in them, and the installer’s log folder
%USERPROFILE%\AppData\Local\MFSQL Vault Install in the profile of the user who ran the installation. If MFSQL Connector
is listed under Installed apps in Windows, uninstall it there.
9. Metadata in the vault¶
Uninstalling the vault application does not remove the metadata it added to the vault:
the object type MFSQLConnector and the class User Messages;
the properties MFSQL Message, Process Batch, File Unique Ref, Class Table, User and Count;
the workflows ContextMenuFlow and MFSQL Messages;
the user group ContextMenu.
Remove them in M-Files Admin only when no object uses them. Remove or disable the M-Files user that MFSQL Connector used to log in to the vault if nothing else uses it.