01/05/2016

About M-Files Databases

Background

M-Files always stores it's data in a Sql Database. As of this writing two Database vendors are supported:

  • Firebird (default)

    Firebird is an open source Sql Server, you can find out more about it on http://firebirdsql.org. As it is free, it's the default option when you install M-Files.

  • MS-SQL Server

    Microsoft's Sql Server is the second option. Because it's rather expensive, it's not the default option and the M-Files customer has to buy and install it themselves.

Database Engines in the wild

Both Firebird and MS-Sql should be able to handle M-Files Vaults of considerable size, but in practice Firebird gets used more often in smaller businesses and MS-Sql Server gets used more often in bigger firms.

While the price tag certainly does matter, more often than not it depends on whetever there is a preexisting investment into MS-Sql Server or not. If the company already has a MS-SQL Server on premise, it's a no brainer to tack on an additional Database. Even if they don't have a DBA who already has experience with administrating the server, a lot of companies already depend on the MS-Sql Server if they run on the Microsoft Stack at all for different reasons, maybe they already have a CMS or Website that depends on it.

MS Sql Server Express

Although a free version of Microsofts Sql Server called "Sql Server Express" is available for download (it even comes with reporting Services and an ok GUI for Administration if you pick up the SQL Server Express with Advanced Services) it's often a poor choice for M-Files, because of the 10 GB limit on database.

Don't get me wrong - 10 GB is not a small amount of data, but in this case remember that M-Files does not only store your customers and invoices as numbers and strings, but it also stores all binary files in the database as well - that means all word documents, powerpoints and pdfs with their high resolution cat pictures. If you throw in revisions of the same file and multiply that by a couple of users you get to a lot of data very quickly.

If you think that that's not an issue in your case, you should be able to use the express version as mentioned in this thread on the M-Files Forum.

Backing up and Restoring a M-Files Vault

Backing up and Restoring an M-Files Vault depends on your backend Database.

If you're using the default firebird sql server, than the backup is done using the M-Files Admin tool.

But if you are using the Microft Sql Server as the backend, then you'll need to a tool like the Sql Server Management Studio to create a backup of your vault and restore it back again, which is rather simple to do for anyone that has used the tool once before.

A problem when restoring a MS-SQL based Vault

What prompted this quick writeup is that yesterday a client had a problem restoring an M-Files Vault on the SQL Server.

Restoring the Database using the Management Tools worked fine, but the target system had a newer version of M-Files running and was trying an upgrade but failed with the following error message:

Upgrading the document vault 'Vaultname' failed.
ALTER ASSEMBLY for assembly 'MFMSSQLCLRObjs' failed because assembly 'MFMSSQLCLRObjs' is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an assymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission. (ERROR: 10327, SQLSTATE: 42000)

After checking that the dbo had the correct permissions, I found that the problem was that the restored database did not have the TRUSTWORTHY property set.

I fixed that by excecuting the following command in the Sql Management Studio as explained in this Microsoft Article:

ALTER DATABASE Vaultname SET TRUSTWORTHY ON;

After that I was able to attach the document vault without problems.

References

Last updated 01/05/2016 03:47:07
blog comments powered by Disqus
Questions?
Ask Martin