# Sitefinity CLI

## Overview

You use Sitefinity CLI to upgrade your project running on Sitefinity CMS version 10.0 or higher.\
We recommend that you always upgrade to the latest version. \
For information about the supported Sitefinity CMS versions, see [Sitefinity Life Cycle Policy Guide](https://www.progress.com/support/sitefinity-lifecycle-policy).

This upgrade approach has the following main advantages:

* Sitefinity CLI  automatically handles broken or missing references.
* The target framework of the upgraded project is automatically set to the relevant Sitefinity CMS framework version.
* Sitefinity CLI automatically fixes binding redirects.
* All Sitefinity projects in the solution are  automatically upgraded without the need to manually go through them.
* You can include it as a step in a Continuous integration pipeline.

> info  **PREREQUISITES**:
>
> * Sitefinity CLI only supports 64-bit Windows operating systems.
> * To be able to use Sitefinity CLI for upgrades, your project must be based on NuGet packages.
> * You have backed up your project and its database.
> * You must have installed the .NET framework version that is compatible with the Sitefinity CMS release you are upgrading to. For more information, see [Sitefinity CMS and .NET framework compatibility](https://www.progress.com/documentation/sitefinity-cms/system-requirements).
> * You have reviewed the API changes relevant for your upgrade path. For more information, see [API changes in Sitefinity CMS](https://www.progress.com/documentation/sitefinity-cms/api-changes-in-sitefinity-cms).

## Install Sitefinity CLI

Install Sitefinity CLI from Sitefinity GitHub repository » [Sitefinity CLI](https://github.com/Sitefinity/Sitefinity-CLI).

> important **IMPORTANT**: When you run Sitefinity CLI, we recommend that you keep the project under source control, because there is **no rollback mechanism** in case something goes wrong.\
> You must not close the Visual Studio that is opened by Sitefinity CLI, because this will cancel the upgrade.

## Upgrade using Sitefinity CLI

Run Sitefinity CLI and enter an upgrade command with the following syntax:

`sf upgrade "{{path to the solution you want to upgrade}}" "{{version you are upgrading to}}"`

Note that entering a specific Sitefinity CMS version is optional. In case you do not provide a version option, the latest version available will be used for the upgrade.

> success **EXAMPLE**: Run Sitefinity CLI and enter the following command:\
> `sf upgrade "D:\TestProject\SitefinityWebApp.sln" "14.4.8100"`

The upgrade command has the following optional parameters:

* `-nc` | `--nugetConfigPath`\
  This option allows you to use a custom NuGet feed that is different than the default feeds. By default, Sitefinity CLI uses `http://nuget.sitefinity.com` and `https://nuget.org/api/v3/index.json`.

  When using `-nc` or `--nugetConfigPath` parameter, you should provide the path to `NuGet.Config` file, in which the NuGet sources are listed.

  > success **EXAMPLE**: Run Sitefinity CLI and enter the following command:\
  > `sf upgrade "D:\TestProject\SitefinityWebApp.sln" "14.4.8100" --nugetConfigPath "D:\TestProject\NuGet.Config"`
* `--acceptLicense`\
  This option accepts Sitefinity EULA.

  > success **EXAMPLE**: Run Sitefinity CLI and enter the following command:\
  > `sf upgrade "D:\TestProject\SitefinityWebApp.sln" "14.4.8100" --acceptLicense`

  If you use this parameter, you automatically accept Sitefinity CMS license agreement and do not have to explicitly accept it. You can find the license after the upgrade in the Licenses folder in the Sitefinity package. For example, `~\packages\Progress.Sitefinity.MobileFormats.14.4.8100\LicenseAgreements`.

  > important **IMPORTANT**: Using this parameter means that you automatically accept the license agreement and any changes included in it. If you do not agree to the new license, you must uninstall the product.
* `--skipPrompts`\
  This option skips all warning prompts during the upgrade. You can use it, if you want the upgrade to run without the prompt that warns you to keep the project under source control.
* `--removeDeprecatedPackages`\
  This option аutomatically removes deprecated packages during the upgrade process to ensure a clean and up-to-date codebase.

## Result

When you run the command, the specified version of NuGet packages is downloaded in the folder of the solution. You are prompted to accept the license agreement. A new Visual Studio instance is launched and a NuGet command to install the NuGet packages is started. The `upgrade` command modifies the references in the `.csproj` project and binding redirects, if needed. The `upgrade` command modifies references for Sitefinity projects only.

Once Sitefinity CLI has completed the upgrade process, make sure to rebuild your project.

> info  **NOTE**: When you upgrade monolingual projects, make sure to reindex all frontend indices. If the indices are not reindexed, they could return two records for the same item - one with culture and one without. If your project uses Lucene and you upgrade to Sitefinity CMS 15.4.8640 or later, you must also reindex all Lucene search indexes. If your project uses Elasticsearch and you upgrade to Sitefinity CMS 15.4.8641 or later, you must also upgrade your Elasticsearch server to version 9.5.3 and reindex all Elasticsearch search indexes.
