Update primedocs server
This page concerns the OnPremises option.
With the "Software as a Service" option, no server installations by the customer are necessary.
Before the update:
Prerequisites
- Existing installation: A prerequisite for updating the primedocs server is a complete primedocs installation (carried out as described here).
- Create a backup: Before the update, create a backup of the following components:
- SQL databases (primedocs and operation database, e.g. via full database backup)
primedocs.configcert.pfx(or the signing certificate, if in the certificate store)- Data protection keys (
key-*.xml) nlog.config(if adjusted)
- .NET 10 Hosting Bundle: An update to primedocs 4.1 requires the installed .NET 10 Windows Hosting Bundle (see system requirements).
- Rollback: If the update fails, the previous state can be restored by restoring the backup (copy back application and configuration files, restore the databases).
Updating
The installation package contains a PowerShell script “Update.ps1”, which updates an existing installation. The script must be executed as administrator.
Before running the script, make sure that:
- A verified restore point or backup exists (see Prerequisites).
- The correct installation directory is selected — it must contain the
primedocs.config. - No external process locks files in the installation directory: stop the JobHost task set up by the installer and end any other access to the directory. The update script stops the website and app pools, but not the JobHost.
- A short maintenance window is scheduled — the website and app pools are stopped during the update, typically for a few minutes. The desktop client can continue working in offline mode during that time; the web app and the add-ins are unavailable.
When updating, the application files are mirrored via Robocopy. Only certain configurations are retained:
- The central
primedocs.configis not replaced. nlog.configis backed up and copied back for the affected applications.- The
Web.configof theDataSourceAdminAppis retained for the detected on-premises variant.
Other web.config files are not protected in general and can be overwritten by the mirroring. Back up any individually adjusted values in them before the update.
NOTE
The update script (“Update.ps1”) is designed for updating exactly one primedocs environment on a server. If several primedocs environments run on the same server, the script must be called separately for each environment with the respective installation path.
Robocopy is retried once on error. If the error persists, the script exits with exit code 1, before the website and app pools are restarted. In that case, check the exit code, the script output and the IIS state — the website and app pools may remain stopped and then have to be restarted manually.
The primedocs server runs exclusively as a 64-bit application. The update script therefore sets enable32BitAppOnWin64 to false on all primedocs app pools before restarting them — including existing pools that previously ran in 32-bit mode. If setting it fails for a pool, a warning is shown and the update continues; that pool then has to be switched to 64-bit manually.
Run Script
The installation zip file must be unpacked beforehand.
The Update.ps1 is signed and can be called with the arguments. These are described in the file in a large comment (under “Usages”).
Standard call (for this, you must first navigate to the installation directory, e.g. with cd "C:\temp\primedocs_Install_Package") if primedocs has been installed under c:\inetpub\wwwroot\primedocs:
.\Update.ps1
Further call options are described in “Update.ps1” under “Usages”.
Update via reinstallation
To ensure that the IdentityServer signature (cert.pfx) and ASP.NET Core data protection keys are retained across new installations in fully automated primedocs deployments, and that existing OIDC sessions/tokens continue to be accepted, the following steps are necessary:
- Before reinstalling: Back up the relevant files/artifacts:
To prevent the files from being overwritten or deleted during a new installation, they should be stored outside the installation directory.
primedocs.configcert.pfx(or existing signing certificate, if in the store)- Data-Protection Keys (
key-*.xml) nlog.config(if adjusted)
- Perform a new installation / run the installation script
- Restore backed-up files to their previous locations or import certificates into the store
Database Migrations
After an update, the DataSourceAdminApp should be called to carry out any database migrations.
After the update
After a successful update, verify operation:
- Apply any pending database migrations (see Database Migrations).
- Run the operation test.
- Check monitoring and current application errors; if there are problems, consult troubleshooting.