Web API: upgrade an existing instance to 5.13.24.1

Caution

Before you upgrade a production instance, run the upgrade on a test instance first, and contact Laminin Solutions support if any step does not complete as described.

This page upgrades a Web API instance that runs an earlier package (version 1.0.0.0) to Web API 5.13.24.1, without the vault losing the Web API.

Why the order matters

From 5.13.24.1, each Web API instance needs a token signing key of its own in its web.config (see Web API: the per-instance signing key (new installations)). The new Web API refuses every login, with HTTP 503, until the instance has a key. Earlier packages ignore the key.

So write the key first, while the old files still run, and replace the files second.

Before you start

  • Get the Web API 5.13.24.1 package and the install scripts 3.2.0 from Laminin Solutions (see Web API 5.13.24.1 security update).

  • Take a restore point of the web server.

  • Choose a quiet time for the vault (see What the vault notices below).

Instances installed with the install scripts

Run each step from the MFSQLConnectWebAPI-Install folder, in Windows PowerShell 5.1 as administrator, on the web server.

  1. Put the new package and the new scripts folder side by side in the staging folder.

  2. Preview, then write the key. No password is asked for, nothing else in web.config changes, and the application pool is neither stopped nor started:

    .\Run-Step.ps1 7 -Instance <Key> -SigningKeyOnly
    .\Run-Step.ps1 7 -Instance <Key> -SigningKeyOnly -Apply
    
  3. Open the vault’s Dashboard. It still works: the old files ignore the key.

  4. Replace the files, keeping web.config:

    .\Run-Step.ps1 6 -Instance <Key> -Apply -PreserveWebConfig
    

    Step 6 refuses to keep a web.config without a usable key before it changes anything, and names the command for step 2.

  5. Test with .\Run-Step.ps1 8 -Instance <Key>, then open the vault’s Dashboard and run a context menu action.

  6. Repeat for each instance on the server, then run .\Run-Step.ps1 validate.

Instances installed by hand

The same order applies (key first, files second), but the install scripts deploy only under the site they create. Contact Laminin Solutions before you start.

What the vault notices

Tokens issued by the old files are refused once the new files run. The vault application logs in again before each Dashboard load, context menu call and action, so those recover by themselves. Queued tasks reuse the last token and fail until the next of those logins, as they do today when a token expires after 30 minutes. Upgrade when the vault is quiet.

Nothing changes in M-Files Admin: the Web API URL, username and password stay the same.

Rolling back

Restore the files from the backup Step 6 made in the backup folder. The key can stay in web.config: earlier packages ignore it.