Upgrade using Sitefinity CLI

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 delivery pipeline.

For more information, see Sitefinity CLI on GitHub.

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.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?