# Upgrade ServiceControl from Version 6 to Version 7 ServiceControl version 7 adds [SQL Server](/servicecontrol/storage/sqlserver/index.md) and [PostgreSQL](/servicecontrol/storage/postgresql/index.md) as storage options for Error and Audit instances. Upgrading an existing instance does not change its storage: it continues to use RavenDB with its existing data. To move an instance to SQL Server or PostgreSQL after upgrading, see [Migrating from RavenDB to SQL storage](/servicecontrol/migrations/ravendb-to-sql/index.md). The following changes can require action when upgrading: | Change | Action required | | --- | --- | | [Storage type is required](#storage-type-is-required) | Upgrading with the ServiceControl Management Utility or PowerShell: none.
PowerShell scripts that create instances: add `-StorageType RavenDB`.
Containers: add `STORAGETYPE=RavenDB`. | | [Integration events disabled by default](#integration-events-disabled-by-default) | Only if `DisableExternalIntegrationsPublishing` is set, or endpoints subscribe to integration events. | | [Event log changes](#event-log-changes) | Only if a script or tool reads failed messages from the event log. | | [Error instance audit retention setting removed](#error-instance-audit-retention-setting-removed) | None. | | [Maintenance mode restricted to embedded RavenDB](#maintenance-mode-restricted-to-embedded-ravendb) | Only if an instance that uses an external RavenDB server runs in maintenance mode. | ## Prerequisites Review the [upgrade tips](/servicecontrol/upgrades/index.md) and [back up the RavenDB database](/servicecontrol/storage/ravendb/backup-sc-database.md) before upgrading. ## Storage type is required Version 7 has no default storage type. Each Error and Audit instance must set [`ServiceControl/StorageType`](/servicecontrol/servicecontrol-instances/configuration.md#storage-servicecontrolstoragetype) or [`ServiceControl.Audit/StorageType`](/servicecontrol/audit-instances/configuration.md#storage-servicecontrol-auditstoragetype) to `RavenDB`, `SQLServer`, or `PostgreSQL`, and an instance without it does not start. `StorageType` replaces the `PersistenceType` setting. - **Upgrading with the ServiceControl Management Utility or PowerShell:** no action is required. Upgrading an instance sets its storage type to `RavenDB` in the configuration file. - **PowerShell scripts that create instances:** add `-StorageType RavenDB` to each `New-ServiceControlInstance` and `New-ServiceControlAuditInstance` call. The version 7 cmdlets require the parameter, and the version 6 cmdlets do not accept it. - **Containers:** add the [`STORAGETYPE`](/servicecontrol/servicecontrol-instances/deployment/containers.md#required-settings-storage-selection) environment variable with the value `RavenDB` to each Error and Audit container. Version 6 images selected RavenDB automatically. Before (version 6), the environment variables of an Error or Audit container: ```text TRANSPORTTYPE=RabbitMQ.QuorumConventionalRouting CONNECTIONSTRING=host=rabbitmq RAVENDB_CONNECTIONSTRING=http://servicecontrol-db:8080 ``` After (version 7): ```text TRANSPORTTYPE=RabbitMQ.QuorumConventionalRouting CONNECTIONSTRING=host=rabbitmq RAVENDB_CONNECTIONSTRING=http://servicecontrol-db:8080 STORAGETYPE=RavenDB ``` Before (version 6), the storage parameters of a script that creates an Error instance: ```ps1 New-ServiceControlInstance ` -DBPath C:\ServiceControl\DB ` -DatabaseMaintenancePort 33335 ``` After (version 7): ```ps1 New-ServiceControlInstance ` -DBPath C:\ServiceControl\DB ` -DatabaseMaintenancePort 33335 ` -StorageType RavenDB ``` ## Integration events disabled by default Version 7 publishes [integration events](/servicecontrol/contracts.md) only when [`ServiceControl/EnableExternalIntegrationsPublishing`](/servicecontrol/servicecontrol-instances/configuration.md#host-settings-servicecontrolenableexternalintegrationspublishing) is `true`. Version 6 published them unless `ServiceControl/DisableExternalIntegrationsPublishing` was `true`. Version 7 no longer supports `DisableExternalIntegrationsPublishing`: an Error instance that has it in its configuration file or environment does not start, whatever its value. Most systems do not use integration events and need no change. Check each Error instance for the following cases before upgrading. ### Publishing turned off If publishing was turned off with `DisableExternalIntegrationsPublishing`, remove the setting. Publishing is off by default in version 7, so the instance behaves the same as before. Before (version 6): ```xml ``` ```text # Container environment variable SERVICECONTROL_DISABLEEXTERNALINTEGRATIONSPUBLISHING=true ``` After (version 7): no setting and no environment variable. ### Endpoints subscribe to integration events If endpoints subscribe to integration events, enable publishing. Endpoints that subscribe reference the [ServiceControl.Contracts](https://www.nuget.org/packages/ServiceControl.Contracts/) package, for example to send a notification when a message fails. > [!WARNING] > If publishing is not enabled, subscribers stop receiving events after the upgrade, without any error. Before (version 6): no setting, because version 6 published integration events by default. After (version 7): ```xml ``` ```text # Container environment variable SERVICECONTROL_ENABLEEXTERNALINTEGRATIONSPUBLISHING=true ``` If the instance has `DisableExternalIntegrationsPublishing` set to `false`, remove it as well. ## Event log changes Version 7 no longer writes an event log entry for each failed message, which reduces the write and retention load on the event log. Failed messages are listed on the failed messages screen in ServicePulse. No action is required unless a script or monitoring tool reads failed messages from the event log. In that case, change it to [subscribe to `MessageFailed` integration events](/servicecontrol/contracts.md#messagefailed-events) and [enable integration event publishing](#integration-events-disabled-by-default-endpoints-subscribe-to-integration-events). ## Error instance audit retention setting removed Error instances no longer read the `ServiceControl/AuditRetentionPeriod` setting, which had no effect on them. Audit retention is configured on each Audit instance with [`ServiceControl.Audit/AuditRetentionPeriod`](/servicecontrol/audit-instances/configuration.md#data-retention-servicecontrol-auditauditretentionperiod). No action is required. Upgrading an instance with the ServiceControl Management Utility or PowerShell removes the setting from the configuration file. Error containers ignore the `SERVICECONTROL_AUDITRETENTIONPERIOD` environment variable, which can be removed. ## Maintenance mode restricted to embedded RavenDB Error and Audit instances that use an external RavenDB server, including the RavenDB container, no longer start in maintenance mode. Maintenance mode remains available for embedded RavenDB, as deployed by the ServiceControl Management Utility and PowerShell, where ServiceControl manages the database process. For instances that use an external RavenDB server, remove `ServiceControl/MaintenanceMode` or `ServiceControl.Audit/MaintenanceMode`, and any maintenance-mode argument, from the instance's configuration and startup commands. To perform database maintenance, stop the ServiceControl instance instead, leaving the database server running. See [accessing the ServiceControl database](/servicecontrol/storage/ravendb/accessing-database.md). Before (version 6), database maintenance on a container deployment: ```shell # Restart the Error instance in maintenance mode docker rm -f servicecontrol docker run -d --name servicecontrol {OPTIONS} -e SERVICECONTROL_MAINTENANCEMODE=true particular/servicecontrol:6 ``` After (version 7): ```shell # Stop the Error instance; the database container keeps running docker stop servicecontrol # Perform maintenance on port 8080 of the database container, then: docker start servicecontrol ``` ## Support for version 6 Version 6 is supported for one year after version 7 is released as defined by the [ServiceControl support policy](/servicecontrol/upgrades/support-policy.md). The ServiceControl support end date is available at [ServiceControl supported versions](/servicecontrol/upgrades/supported-versions.md).