Install MBS Plugin on a FileMaker Server

Today we like to show you how to manually install the MBS FileMaker Plugin on a FileMaker Server.

Let's start with a freshly installed FileMaker Server:

Everything is off and we copy the MBS.fmplugin file on macOS to this folder:

/Library/FileMaker Server/Database Server/Extensions
/Library/FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins
/Library/FileMaker Server/Web Publishing/publishing-engine/wip/Plugins

for Windows you copy MBS.fmx64:

C:\Program Files\FileMaker\FileMaker Server\Database Server\Extensions
C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\cwpc\Plugins
C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\wip\Plugins

for Linux your copy MBS.fmx here:

/opt/FileMaker/FileMaker Server/Database Server/Extensions
/opt/FileMaker/FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins
/opt/FileMaker/FileMaker Server/Web Publishing/publishing-engine/wip/Plugins

The first folder is for server scripting (scheduled and PSoS), the second folder is for WebDirect and the third one for Data API.

Now we can turn on the switches for plugins. But the problem is that FileMaker doesn't notice yet that there is a new plugin. We restart the server. It may be enough to stop it, wait ten seconds till everything is done and then start it again.

After the restart we can login to the admin console and toggle on the MBS plugin for server scripting. For Data API and Web Direct the plugin is not listed and already turned on.

To verify you can go to the Logs folder, where you should see new files:

StdErrServerScripting.log StdErrDataAPI.log StdErrWeb.log

Where MBS Plugin redirects stderr to files, so you can read this separated (and not all in one stderr file). The fiels may show lines like this reporting the plugin version and platform:

MBS Plugin version 12.0.0.09 for Mac 64-bit loaded for Web Direct 19.4.

MBS Plugin version 12.0.0.09 for Mac 64-bit loaded for Data API 19.4.

MBS Plugin version 12.0.0.09 for Mac 64-bit loaded for ServerScripting 19.4.

Those stderr files also shows our trace output to log plugin calls.

We added a test script to return the plugin version on the FileMaker Server:

# Return version in file Tests (Christians-Mac.local)
Exit Script [ Text Result: MBS("Version") & " on " & MBS("Platform") ]

And a script to show the result:

# Show Version on Server in file Tests (Christians-Mac.local)
Perform Script on Server [ Specified: From list ; “Return version” ; Parameter: ; Wait for completion: On ]
Show Custom Dialog [ "Version on server" ; Get(ScriptResult) ]

You can run this and it should show the plugin version and where it is running. This helps to distinguish between running locally in FileMaker Pro and in one of the server components. If you see question marks, the plugin is not running.

When we add a Trace function call to the first script:

# Return version in file Tests (Christians-Mac.local)
Set Variable [ $r ; Value: MBS("Trace") ]
Exit Script [ Text Result: MBS("Version") & " on " & MBS("Platform") ]

and run it again, we see the log entries in the StdErrServerScripting.log file:

2022-02-20 10:58:00.332 fmsased[356:14144] Script "Return version" in file "Tests".
2022-02-20 10:58:00.333 fmsased[356:14144] MBS Plugin call #1 with 1 parameter.
2022-02-20 10:58:00.333 fmsased[356:14144] Parameter 0 FunctionName: "Trace"
2022-02-20 10:58:00.333 fmsased[356:14144] Result #1: "OK"
2022-02-20 10:58:00.333 fmsased[356:14144] MBS Plugin call #2 with 1 parameter.
2022-02-20 10:58:00.333 fmsased[356:14144] Parameter 0 FunctionName: "Version"
2022-02-20 10:58:00.333 fmsased[356:14144] Result #2: "12.1.0.03"
2022-02-20 10:58:00.334 fmsased[356:14144] MBS Plugin call #3 with 1 parameter.
2022-02-20 10:58:00.334 fmsased[356:14144] Parameter 0 FunctionName: "Platform"
2022-02-20 10:58:00.334 fmsased[356:14144] Result #3: "ServerScripting"

When you write server scripts, it is very easy to have errors and not knowing about it. With our Trace function you have a way to log plugin calls and you can add your own log entries with calls to our Log function like:

Set Variable [$r; Value: MBS("Log"; "RecordID: "; $RecordID)]

This may help a lot to log what happens in a script.

Finally you can automate the whole thing by installation of plugin via either FileMaker or shell scripts. Like if you have automated tools to monitor a dozen servers, you can of course have that software replace all those plugin files with a new version and restart the servers to have them load the new version.

See also: