# SQL Server - Upgrade

## **PaaS upgrade workflow** <a href="#sqlserverupgradeinplace-sqlserverpaasupgrade" id="sqlserverupgradeinplace-sqlserverpaasupgrade"></a>

### Request <a href="#sqlserverupgrade-request" id="sqlserverupgrade-request"></a>

The upgrade of a SQL Server PaaS instance is the responsibility of **cegedim.cloud**. Requests must be submitted via an [ITCare ticket](https://itcare.cegedim.cloud/support?createTicket=true\&step=Request\&requestTypeIndex=-1\&formName=DB_MSSQL), specifying a preferred time window for the operation.

Please indicate if the upgrade must be performed **outside of business hours**, to allow for proper RFC planning.

It is strongly recommended to first perform the upgrade in a **non-production environment**, to validate compatibility of the entire process with the client's technical and application constraints.

{% hint style="warning" %}
Upgrades of SQL Server clusters **older than version 2016** are **not supported** by **cegedim.cloud**.

This limitation is due to major changes introduced in the SQL Server engine starting with version 2016, particularly regarding AlwaysOn features and the deprecation of legacy components.

> Major version upgrades (e.g., from SQL Server 2019 to 2022) require a different approach, namely the full reprovisioning of the environment. In this case, a **new PaaS instance** must be provisioned with the target version, followed by a **manual migration of databases**.

> This process only covers the application of **Cumulative Updates (CU)** published by Microsoft. These updates contain security, stability, and performance fixes for SQL Server.
> {% endhint %}

### Process <a href="#sqlserverupgrade-procedure" id="sqlserverupgrade-procedure"></a>

The upgrade process involving Cumulative Updates follows these steps:

1. **Snapshot of virtual machines** (to enable rollback in case of failure)
2. **Full backup** of customer databases using Rubrik
3. **Installation of SQL Server Cumulative Updates** (official Microsoft patches)
4. **Server reboot** to apply the updates
5. **Integrity checks** on databases and review of error logs

For **AlwaysOn clusters**:

* Secondary nodes are patched first
* A **manual failover** to the secondary node is performed prior to updating the primary
* **Controlled reboot** of the updated node
* The process is repeated for remaining nodes

### Impacts <a href="#sqlserverupgrade-impatcs" id="sqlserverupgrade-impatcs"></a>

Applying Cumulative Updates can lead to temporary service interruptions or changes in application behavior.

Points to consider:

* **Temporary unavailability** of SQL Server during reboot
* Risk of **functional regressions** due to internal behavior changes in CU
* Possible rollback required if installation fails

**Potential risks:**

* Failure to rejoin the AlwaysOn cluster
* Data corruption if backups are invalid
* Broken application dependencies due to changes introduced by the CU

### Estimated Duration <a href="#sqlserverupgrade-estimatedduration" id="sqlserverupgrade-estimatedduration"></a>

The duration of an upgrade depends on several factors, including the **data volume to be backed up** and the **deployment mode** (standalone vs AlwaysOn).

Estimated durations:

* Standalone instance with low volume: **\~1 hour**
* AlwaysOn cluster with failover: **\~2 to 3 hours**

> These durations are indicative only and should be adjusted according to the specific constraints of the target environment (I/O, load, network latency, etc.).

## Operating System Updates <a href="#sqlserverupgrade-operatingsystemupdates" id="sqlserverupgrade-operatingsystemupdates"></a>

Windows Server updates are performed exclusively during scheduled **"Patch Parties"**—maintenance windows during which critical security and stability patches are applied in a coordinated manner, in line with **cegedim.cloud**'s maintenance schedule.

These operations are **outside the scope** of the SQL Server upgrade. If an OS version change is required, the following steps must be taken:

* Request **reprovisioning** of a PaaS instance with the new OS version via ITCare
* Perform a **manual migration** of the databases to the new instance

> In-place upgrades of the operating system are **not supported**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.cegedim.cloud/databases/sql-server/sql-server-upgrade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
