Update Xperience by Kentico projects
Updates for Xperience by Kentico are released in the form of:
- Hotfixes – weekly fixes of bugs and potential security issues.
- Refreshes – more extensive updates that add new features, introduce changes, and fix issues. Note that refreshes may contain breaking changes to the code base. Refreshes are planned for every month, but the release schedule may vary depending on the features included in each refresh.
We recommend that you update your Xperience projects regularly.
Check the Changelog for additional details, workarounds and instructions related to individual update versions.
For Refreshes, check the Breaking changes sections of the Changelog to see if your codebase or other important functionality is affected.
Before updating
- Create a backup of your Xperience database and project folder.
- When updating a development project with Continuous Integration enabled, familiarize yourself with the Update instructions for CI.
The update process depends on your development and deployment flow, as well as your site's hosting environment. For example, the following steps describe how to apply the update in a basic scenario with a local development instance and a live production site:
- Set up a local development instance of your website project, including the database.
- You can either maintain a permanent local development instance or get backups of your production site's web projects and database for each update.
- Update the project's Xperience NuGet packages.
- Update the project's database.
- Test that the updated local project works correctly.
- Temporarily stop your production site (provide a suitable offline page or a mirrored duplicate of the website that you can later swap).
- Redeploy the updated project files to your production environment.
- Apply the database update to your production database.
- For example, you can switch your local project to a separate "live" configuration that connects to the production database, and repeat the database update.
- Relaunch the updated production site.
In addition to updating individual projects, we also recommend updating the templates used for installing new projects. See Update project templates.
Update NuGet packages
Start by updating your project's Xperience code libraries and administration, which are provided in the form of NuGet packages.
- Open your application in Visual Studio.
- Right-click your website project in the Solution Explorer and select Manage NuGet Packages.
- On the Updates card, select all Kentico.Xperience NuGet packages and click Update.
- Kentico.Xperience.WebApp
- Kentico.Xperience.Admin
- All installed extension packages
- Rebuild the solution.
The application will not start until the NuGet package version matches your database version. Continue by updating the database.
Update the database
After updating your project's NuGet packages, update the database using the .NET command-line interface (CLI).
- Shut down your Xperience application if it is running and receives traffic.
- Open the command line prompt.
- Navigate to the root folder of the project you want to update.
Run the following command:
dotnet run --no-build --kxp-update
Command parameters
Add the
--no-build
parameter to the dotnet run command if you have already rebuilt your project after updating the NuGet packages. This option saves time and avoids another unnecessary project build before the database update.Add the
--
syntax separator before any command parameters that you wish to pass directly to the Xperience application (--kxp-update
). This prevents conflicts with general .NET CLI parameters, for example when using the--help
option.
The command updates the project's database, using primarily SQL scripts and in certain cases API operations. The database version should then match the version of the project's Xperience NuGet packages.
The database update process does not automatically start the application when finished. After the update, you can run the application again using the dotnet run
command, or another suitable approach depending on your hosting environment.
Update development projects with Continuous Integration
If you are updating a development project with Continuous Integration enabled:
- Before running the update, disable CI.
- Apply the update separately for each instance in your development environment. You cannot fully synchronize the database update using your source control system and CI.
- If you use the
<IncludedObjectTypes>
element in your CI repository.config file to filter object types, check Reference - CI/CD object types for any new object types introduced by the update. Add any new object types that you wish to include in CI. - After updating, every developer needs to run complete serialization for all objects to recreate the content of the CIRepository folder on their instance (use the
--kxp-ci-store
CLI command). - After one developer commits the update changes to the source control, other developers CANNOT commit or load changes until they apply the update to their own instance.
Example – Update process with CI
The following steps show an example of the update process for a local development instance using Continuous Integration (suitable for an automated script, etc.).
- Commit all pending changes under the CI repository to your source control.
- Create a backup of your Xperience database and project folder.
- Shut down the Xperience application, and any other applications that connect to the same database.
- Update the project's NuGet packages.
Disable CI.
SQLUPDATE CMS_SettingsKey SET KeyValue = N'False' WHERE KeyName = N'CMSEnableCI'
- .NET CLI
dotnet run --no-build --kxp-update
Re-enable CI.
SQLUPDATE CMS_SettingsKey SET KeyValue = N'True' WHERE KeyName = N'CMSEnableCI'
Serialize all objects to the CIRepository folder.
.NET CLIdotnet run --no-build --kxp-ci-store
- Commit the update changes to your source control.
Update projects in the SaaS environment
Xperience by Kentico applications deployed to the SaaS environment need to be updated manually. Use the following process:
- Update your project in a local development environment to the desired version.
- See Update NuGet packages and Update the database.
- Create a new deployment package.
- Update the $CDRepository/repository.config file according to your Continuous Deployment object filtering requirements. If you use the
<IncludedObjectTypes>
element, check Reference - CI/CD object types for any new object types introduced by the update.
- Update the $CDRepository/repository.config file according to your Continuous Deployment object filtering requirements. If you use the
- Redeploy the package to your Xperience Portal project.
The deployment process automatically ensures that the database in the SaaS environment is up-to-date.
Update administration customization projects
If you have one or more projects for custom administration development, remember to perform the following when updating to a newer Xperience by Kentico version:
- Update the Xperience by Kentico NuGet packages installed in the custom admin back-end project.
Update the dependencies of your custom admin client project – @kentico/xperience-admin-base, @kentico/xperience-admin-components, @kentico/xperience-webpack-config, etc. Use the npm-update command:
# Switches to the directory containing client module code cd ..\Acme.Web.Admin\Client npm update
Update project templates
If you have installed the Xperience project templates package on your machine, we recommend keeping the templates up-to-date. This is required if you wish to create new projects that include released features and fixes.
To update the Xperience project templates, open the command line and run the following command (depending on the .NET SDK version installed on your machine):
dotnet new --update-apply
dotnet new update