Upgrades and hotfixes¶
M-Files and MFSQL Connector regularly publish upgrades and hot fixes. Lately, M-Files updates are automated and can be scheduled. MFSQL Connector updates are not automated and the latest available releases are published on the website.
M-Files upgrades on workstations and the M-Files Server (in cases where the MFSQL SQL instance is not on the M-Files Server) does not affect MFSQL Connector, however, MFSQL Connector is directly affected by an upgrade of M-Files on the SQL Server.
Special routines, highlighted below aim at keeping the MFSQL Connector responsive to an M-Files upgrade. We nevertheless recommend to set M-Files upgrades on the SQL server as manual and to only upgrade M-Files when a new version of MFSQL connector is deployed.
This chapter elaborates on
How to perform a MFSQL Connector upgrade
Exception handling when MFSQL Connector did not update when M-Files upgraded
Considerations when copying, moving, or restoring an MFSQL Connector database
MFSQL Connector change management¶
Changes to the connector and new functionality released in specific releases are highlighted in Version Control. The change control of each procedure is documented as a section in the procedure documentation.
Types of Upgrades¶
Connector upgrades will differ depending on what is driving the upgrade.
Connector update following a Mfiles-upgradeindex upgrade on the SQL server (automated)
Connector update following a manual M-Files upgrade on the SQL Server
Upgrade and hotfixes of SQL procedures only.
Major Release upgrade.
Upgrades from Release 3 (version 3.1.4.40 and earlier) to Release 4 (version 4.1.5.41 and higher).
Note
There is no need to update the Connector if the M-Files version changes on the user desktop or M-Files server, where the M-Files server is not the same as the SQL server.
Preparation for upgrading¶
The upgrade method of a package is intended to be replace the previous package taking into account any migration of the standard functionality from a previous to the new version. Any customization of procedures, tables or other objects of any of the standard content of the package will be lost. We recommend that changes are never made to the connector objects. Custom procedures and other objects should use the schema ‘’custom’’ with a distinctive naming convention. Application requirements for adjustments to the standard objects must be made through Laminin Solutions.
Before commencing with an upgrade always ensure that backups are available
MFSQL Connector Database
M-Files Vault
On occasion it is necessary to restart the SQL server after the upgrade to allow M-Files to release the API’s from the previous version from memory and load the new version API’s into memory
Automatic updates¶
The Connector will detect if the M-Files Version has changed when the automatic update has been configured. Follow the steps in mfiles-upgrade/index
Manual update of the Connector¶
The installation package for the same version as the installed version of the Connector can be repeatedly executed on the SQL Server. This may be necessary to refresh the installation or to recover from an issue.
As an alternative, and when only the assemblies require updating the procedure spMFUpdateAssemblies may be applied.
Upgrade the Connector to a new version¶
The latest published version of the connector is available for download
Note the installed version before updating with Version Check. If only the third or last segment of the version have changed, then the upgrade must only be applied to the SQL Server. (e.g. 4.8.24.55 to 4.8.24.56)
When the second segment has changed, the package must be applied to both SQL Server and M-Files Server. (e.g. 4.7.22.48 to 4.8.23.50)
Version Check¶
The current version of MF-Files and MFSQL Connector that has been deployed in the database can be reviewed using MFDeploymentDetail table
SELECT * FROM [dbo].[MFDeploymentDetail] AS [mdd] ORDER BY id desc
==== =================================== ====================== ========== ==========
ID LSWrapperVersion MFilesAPIVersion DeployedBy DeployedOn
1019 2.1.1.11 / MFSQL Connector 2.1.1.13 7.0.0.0 :11.3.4330.134 RemoteSQL 12/11/2016
==== =================================== ====================== ========== ==========
M-Files automatic upgrade¶
M-Files automatically upgrades to keep the M-Files software up to date.
MFSQL Connector requires M-Files Desktop on the SQL Server where MFSQL Connector is deployed. Since MFSQL Connector 5.13.38.82, an M-Files upgrade on the SQL Server no longer requires a manual response in the normal case — see M-Files Interop Loading Redesign (Release 5.13.38.82) and M‑Files API version and CLR assembly updates for the current detection/reload model.
Methods to update MFSQL Connector¶
Automatic update (default, Integration Connector)
A WMI Event Alert (
35.703.script.CreateMFilesUpdateAlert.sql) detects the M-Files version change within seconds and calls spMFUpdateAssemblies to reload the assemblies. A daily spMFCheckAndUpdateAssemblyVersion Agent job (see Using Agent for automated updates) is a fallback in case an alert firing is missed. Neither is available on SQL Server Express (no SQL Server Agent) — use the manual or scheduled options below instead.Manual update
Run the procedure directly on the SQL Server:
EXEC [dbo].[spMFUpdateAssemblies]
Scheduled update on SQL Server Express
SQL Express has no SQL Server Agent, so neither automatic path above is available. The Setup powershell utilities
SQLSchedulerutility can schedule the manual update call above on a recurring basis as an alternative to running it by hand after every M-Files upgrade.Rerun the installation package
Another way to reset the assemblies is to re-run the installation package of the MFSQL Connector.
Check the M-Files version on the SQL Server
Declare @IsUpdateAssembly int, @MFilesVersion nvarchar(25) Exec spMFGetMFilesAssemblyVersion @IsUpdateAssembly = @IsUpdateAssembly output, @MFilesVersion = @MFilesVersion output Select @IsUpdateAssembly as IsUpdateRequired, @MFilesVersion as InstalledVersion