Upgrade from Sitefinity CMS 12.0 and above

Overview

You can use Sitefinity CLI to upgrade your project to Sitefinity CMS version 12.0 or later.

This approach has the following advantages:

  • CLI automatically handles broken or missing references
  • The target framework of the upgraded project is automatically set to the relevant Sitefinity CMS framework version.
  • The 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.

PREREQUISITES: To be able to use Sitefinity CLI for upgrades, your project must be based on NuGet packages.

Installation

Install Sitefinity CLI from Sitefinity’s GitHub repository » Sitefinity CLI.

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.

Syntax

The upgrade command has the following syntax:

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

EXAMPLE: Run the CLI and enter the following command:
sf upgrade "D:\TestProject\SitefinityWebApp.sln" "13.0.7300"

The upgrade command has the following option parameters:

  • --packageSources
    This option allows you to specify a NuGet feed that is different than the default feeds. By default, Sitefinity CLI uses http://nuget.sitefinity.com and https://nuget.org/api/v2/.

    EXAMPLE: Run the CLI and enter the following command:
    sf upgrade "D:\TestProject\SitefinityWebApp.sln" "13.0.7300" --packageSources "https://customfeed/nuget,
    https://nuget.org/api/v2/"

  • --acceptLicense
    This option accepts Sitefinity EULA.
  • EXAMPLE: Run the CLI and enter the following command:
    sf upgrade "D:\TestProject\SitefinityWebApp.sln" "13.0.7300" --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.12.1.7121\LicenseAgreements.

    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 the warning prompt 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.

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.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?