# Upgrading Jitbit

## Notes

Use `ccmjitbitservicedesk-server-admin` to run upgrade scripts. `JitbitHelpDeskUser` has permissions for the app but not for database schema changes.

## Prerequisites

1. Download the latest version from the [Jitbit support website](https://www.jitbit.com/helpdesk/securedownload/).
2. Expand the ZIP and copy the `helpdesk` folder to another location. Upload the contents of that folder.
3. The `helpdesk` folder also contains SQL scripts to run as the user noted above.

## Process

### Database

1. In the Azure portal, navigate to `rg-servicedesk` → `ccmjitbititservicedesk` → **Settings → Backups**.
2. Verify that a sufficiently recent backup of the app service exists.
3. In the resource group, navigate to `itJitbitServiceDeskDB` and select **Query Editor**.
4. Log in as `ccmjitbitservicedesk-server-admin`, create a query, copy in the contents of `UpgradeFromOlderVersions.sql`, and execute it.

If the query finishes without errors, continue with the web files.

### Web app

1. Create a ZIP of the files inside the `helpdesk` folder. **Do not include the folder itself.**
2. Go to `ccmjitbititservicedesk` in `rg-servicedesk`.
3. Select **Deployment → Deployment Centre**.
4. Select **Manual deployment**, then upload the ZIP.
5. Select **Skip server-side build** and deploy.

Review the deployment logs and confirm there are no errors.
