Is this really the version you are looking for? Kentico Xperience 9 Documentation is no longer updated. Use the switcher in the header to choose your product version.
This page provides instructions for upgrading Kentico projects from version 8.2 to 9.
Upgrading non-standard projects
Warning
Using the Export and Import features to move sites from older versions of Kentico is NOT a valid way to perform the upgrade. During such imports, you risk overwriting database objects and files with older equivalents that may not be compatible. The import may prevent your site and the system as a whole from working correctly.
Importing of packages from older versions is supported to allow transferring of single objects or basic data, not as a way to upgrade entire sites.
Before you start the upgrade, please make sure that your environment fulfills the requirements of Kentico 9. See Server and hosting requirements for details.
Note: The upgrade must be applied to complete projects that use the standard folder structure (the solution file, GlobalAssemblyInfo.cs, the CMS and Lib sub-folders). You cannot directly upgrade web site deployments of the CMS folder – first upgrade the original complete project and then create a new deployment.
If you are upgrading from a Kentico version lower than 8.2, you need to go through a separate upgrade procedure for each version. Check the instructions for each upgrade version, and perform the required steps before and after the upgrade.
For each version, you always need to open the upgraded website in a browser before starting the upgrade for the next version and verify that the site loads correctly. During the first request after the upgrade, the system performs certain tasks required to finish the upgrade, including the import of new objects.
The following is a summary of the most important changes that the upgrade performs. To learn how to replace any removed features or components that you use, see the linked documentation or the required steps before and after the upgrade on this page.
This does not include all Kentico 9 features and changes – see Release notes - Kentico 9 for a comprehensive list.
Flat tax classes (tax classes with a fixed tax) are no longer supported.
Legacy field mapping of product page types for backward compatibility is no longer supported.
For a list of breaking changes in the Kentico 9 API, see the Release notes.
If your project contains any custom code (including virtual objects such as transformations), we strongly recommend using the Kentico code upgrade tool before you start the upgrade procedure.
Download the tool from the API Changes (opens in a new tab) page on the DevNet portal. See Upgrading custom code to learn more.
The tool has the following functionality:
The code upgrade tool’s output will help you update your custom code after you perform the upgrade.
If your Kentico project uses Windows authentication (integrated security) for its database connection, the database upgrade scripts run under the current Windows account, i.e. the user who runs the upgrade utility.
To avoid errors during the upgrade, you need to make sure that the corresponding database user has the same Default schema value as the schema of the objects in your Kentico database (dbo by default).
You can check the database authentication settings in the connection string within your project's web.config file.
If your system stores virtual objects on the file system (due to enabled deployment mode or source control options), you need to return the files to the database before performing the upgrade.
You can re-enable deployment mode or source control after you finish the upgrade.
If your project uses staging or the integration bus, you need to synchronize all staging and integration tasks before starting the upgrade procedure. Synchronization of existing tasks from older Kentico versions may fail after you perform the upgrade. To perform the synchronization, use the Staging or Integration bus applications.
If you have the Settings -> Versioning & Synchronization (opens in a new tab) -> Staging -> Log export tasks setting enabled, the system logs delete tasks when objects are deleted. These tasks can then be included in export packages and used to delete objects on other instances during the import. The data of logged delete tasks is NOT updated during upgrades, so existing tasks may not work correctly after you upgrade to a newer version.
We recommend clearing all delete tasks before you start the upgrade – go to Sites -> View export history -> Tasks and click Delete all tasks.
The upgrade does NOT update the data of:
After you perform the upgrade, it may not be possible to correctly restore or roll back certain types of objects from the recycle bin or version history. Before you start the upgrade, we recommend reviewing the content of your recycle bin and version history:
To successfully complete the upgrade, you will need to re-sign all macros after applying the upgrade. The upgrade procedure also re-signs the macros within certain object types automatically.
This can potentially be a security vulnerability, so we strongly recommend checking your system for invalid macros before you start the upgrade:
If you detect any macros that have invalid signatures or are otherwise suspicious, fix or delete them. For more information, see Working with macro signatures.
If some of your database tables contain very large amounts of data, timeout problems can occur when applying the database upgrade or during the processing of the first request after the upgrade. This may prevent the upgrade procedure from finishing successfully.
To avoid timeout-related issues, you can either increase the timeout settings of your SQL server for the duration of the upgrade, or try to clear unnecessary data.
For example, contact management features can generate a very large volume of contact and activity data on high‑traffic websites (in the OM_Contact and OM_Activity tables). You can trim down the data by running automatic deletion of contacts that meet certain conditions and are no longer relevant.
Flat tax classes (tax classes with a fixed tax) are no longer supported. If you apply flat taxes to shipping costs, implement a custom shipping carrier provider to replace flat taxes and to achieve the same result.
Obsolete macros in the ##MACRONAME## format are no longer supported. To replace the obsolete macros, use equivalent supported macros according to the following table:
Old macro | New macro |
|---|---|
##INVOICENUMBER## | {% Order.OrderInvoiceNumber %} |
##ORDERDATE## | {% Format(Order.OrderDate, "{0:d}") %} |
##ORDERNOTE## | {% HTMLEncode(Order.OrderNote) %} |
##BILLINGADDRESS## | {% BillingAddress.ApplyTransformation("Ecommerce.Transformations.Order_Address") %} + tweak transformation appearance |
##SHIPPINGADDRESS## | {% ShippingAddress.ApplyTransformation("Ecommerce.Transformations.Order_Address") %} + tweak transformation appearance |
##PAYMENTOPTION## | {% HTMLEncode(PaymentOption.PaymentOptionDisplayName) %} |
##SHIPPINGOPTION## | {% HTMLEncode(ShippingOption.ShippingOptionDisplayName) %} |
##PRODUCTLIST## | {% ContentTable.ApplyTransformation("Ecommerce.Transformations.Order_ContentTable", "Ecommerce.Transformations.Order_ContentTableHeader", "Ecommerce.Transformations.Order_ContentTableFooter") %} + tweak transformation appearance |
##TAXRECAPITULATION## | {% ContentTaxesTable.ApplyTransformation("Ecommerce.Transformations.Order_TaxesTable", "Ecommerce.Transformations.Order_TaxesTableHeader", "Ecommerce.Transformations.Order_TaxesTableFooter") %} + tweak transformation appearance |
##TOTALPRICE## | {% TotalPrice.Format(Currency.CurrencyFormatString) %} |
##TOTALSHIPPING## | {% TotalShipping.Format(Currency.CurrencyFormatString) %} |
##COMPANYADDRESS## | <span className="InvoiceCompanyAddressTitle">{$ Ecommerce.Invoice.CompanyAddressTitle $ }</span>{% CompanyAddress.ApplyTransformation("Ecommerce.Transformations.Order_Address") %} + tweak transformation appearance |
##TAXREGISTRATIONID## | {% Customer.CustomerTaxRegistrationID %} |
##ORGANIZATIONID## | {% Customer.CustomerOrganizationID %} |
##applicationurl## | {% Transformation.GetAbsoluteUrl("~/").TrimEnd("/") %} |
##NEWORDERLINK## | <a href="{% UIContext.GetElementUrl("CMS.Ecommerce", "OrderProperties", true, Order.OrderID) %}" target="_blank">{$ Ecommerce.OrderNotification.OpenOrder $}</a> |
##paymentreceivedtext## | {$ OrderPaymentNotificationToCustomer.PaymentReceived $} |
##thankyoutext## | {$ OrderNotification.ThankYouText $} |
The upgrade removes the obsolete Shopping cart preview web part. To replace the web part, see Displaying the shopping cart preview on pages.
The upgrade removes the obsolete Product filter web part. To replace the web part, see Configuring product listings with filtering.
The upgrade removes the E-commerce settings checker widget. Remove the widget from user dashboards in the Store overviewapplication or inform your users to remove the widget from their dashboards.
If you are using full-text search catalogs for any Kentico database tables, you need to remove the catalogs before starting the upgrade. The procedure drops and recreates indexes for most tables. You can set up the full-text search again after the upgrade is complete.
If you have more than 1 million records in the Newsletter_OpenedEmail or Newsletter_SubscriberLink database tables, the upgrade procedure could take more time than expected (likely within minutes) and the database could temporarily require more space (due to copying of the records). We recommend that you increase your database connection timeout using theConnection stringin the web.config.
If you are not using the CMSApp_MVC project for your MVC development, we recommend removing the project from the solution. We now recommend a different approach for developing MVC sites.
Kentico 9 allows storing of page attachment history in the file system. This allows you to lower the overall size of the system database. The settings are shared with published versions of attachments. Based on the value in the Store files in setting in Settings -> System -> Files, the system may start saving new attachment history to the file system after the upgrade, while keeping the old history in the database.
We recommend storing page attachment history on the file system.
If you want to keep storing attachment history in the database, add the following key into the appSettings section of your application's web.config file:
<add key="CMSForceAttachmentHistoryInDatabase" value="true" />We strongly recommend using the Kentico Upgrade Utility to perform the upgrade automatically.
Manual upgrade
If you cannot perform the upgrade automatically (for example when you cannot directly access the environment hosting the Kentico instance), you can perform the upgrade manually.
Open the folder where you installed the upgrade.
Run the Kentico Upgrade Utility (Upgrade.exe).
Enter the path to your Kentico 8.2 web project folder (you can select a folder using the Browse button).
Use the utility to back up your project files and/or database if you haven’t done so already.
Select whether you want to upgrade files, the database or both. To successfully perform the upgrade, you need to update both the project files and the database. Only change the settings in special scenarios (for example when performing part of the process manually).
Important: If you use a separated on-line marketing database, you need to disable the SQL script part of the upgrade:
Warning: If you enable the Overwrite all files option in advanced mode, the upgrade replaces all project files with the default Kentico 9 files, regardless of customizations. This includes the web.config file, which you need to configure again after applying the upgrade.
On web application projects, the upgrade utility rebuilds the solution at the end of the upgrade by default. If your project contains custom code that is no longer supported in Kentico 9, or has certain modules uninstalled, the rebuild will not be successful. You can disable the Rebuild web project option on customized projects, and perform the rebuild manually once you update the project after the upgrade.
Choose a method of taking the project offline and bringing it back online.
Click Next to start the upgrade procedure.
After the upgrade finishes, click Next to view any conflicts of customized files that occurred during the upgrade process. By default, the upgrade utility doesn’t overwrite modified files in order to preserve your customizations (unless you enabled the Overwrite all files option in the upgrade utility):
The upgrade attempts to automatically update your project’s web.config file (unless you enabled the Overwrite all files option in the upgrade utility). The process may fail if your web.config contains certain types of customizations. In this case, a new web.config file is created in the web project’s CMS folder with the .new extension. You need to:
Close the upgrade utility.
If your project uses a separated on-line marketing database, you need to manually run the upgrade SQL scripts after updating the project files:
Open the upgrade installation directory (C:\Program Files\Kentico\9.0\Upgrade82_90 by default).
Expand the SQL\Separation folder.
Manually run the script files in the following order:
Note: Kentico uses database objects with the dbo schema by default. If your database uses a different or no schema, you need to modify any schema occurrences in the script accordingly.
Once the databases are successfully upgraded, continue with the steps after the upgrade.
Workaround for separated databases without marketing emails
If your separated on-line marketing database does not contain any marketing emails (under email campaigns), an error will occur when running the first request after the upgrade and the finalization of the upgrade procedure will not finish.
To work around this problem, manually perform the following steps before you open the upgraded site in a browser:
Open the upgraded project in Visual Studio.
Expand the App_Code (for web site projects) or Old_App_Code folder (for web application projects), and edit the CMS\UpgradeProcedure.cs file.
Comment out the following code that executes queries related to marketing emails (line 1136 by default):
// Update the data in ClickedLink/OpenedEmail table using OM connection string (or default)
/*using (new CMSConnectionScope(DatabaseSeparationHelper.OM_CONNECTION_STRING, false, true))
{
ConnectionHelper.ExecuteQuery(updateClicksScript, null, QueryTypeEnum.SQLQuery);
ConnectionHelper.ExecuteQuery(updateOpensScript, null, QueryTypeEnum.SQLQuery);
ConnectionHelper.ExecuteQuery(deleteOpensWithNonExistingIssues, null, QueryTypeEnum.SQLQuery);
}*/Save the changes.
If you have a web application project type, build the CMSApp project (you may first need to resolve API changes in custom code – see the steps after the upgrade).
After you apply the upgrade to your project, please check the following sections and perform the required actions. Go through the sections in the listed order.
Important
After you apply the upgrade, clear your browser cache before you open the website or Kentico administration interface.
You need to update your custom code according to the new API of Kentico 9, including:
Use the output of the Kentico code upgrade tool (described in Custom code analysis) to find occurrences of invalid code and recommendations on how to fix or replace them.
Tip: Enable Deployment mode and fix the code of virtual objects in the corresponding physical files. This makes it easier to update the code of virtual objects according to the output of the code upgrade tool. Disable deployment mode to return the updated virtual objects back into the database.
You can also search for specific API resolutions on the DevNet portal (opens in a new tab).
The upgrade converts your web projects to version 9, but does not provide the associated setup files (i.e. the Kentico program files that are separate from individual web projects). The setup files contain external utilities, sample files, and allow you to install new Kentico 9 web projects.
To obtain the installer and setup files for Kentico 9:
If you made any customizations to the mimetypes.txt file located in '~CMSAdminControls/mimetypes.txt', you need to move the customizations to the same file in '~/App_Data'.
The upgraded web.config file no longer registers UrlRoutingModule (opens in a new tab) for handling of non-managed requests. As a result, the application only processes URL routes that are extensionless or have the .aspx extension by default.
On Kentico sites, URL routing can be used in the following ways:
If your website uses URL routes with custom extensions, you need to enable processing of all requests by managed modules:
Edit your application's web.config file.
Find the <modules> element inside the system.webServer section directly under the web.config root (i.e. not under a specific <location> element).
Set the runAllManagedModulesForAllRequests attribute to true for the opening <modules> tag:
<system.webServer>
...
<modules runAllManagedModulesForAllRequests="true">
...
</system.webServer>Kentico 9 no longer supports Application Pools with Managed Pipeline Mode set to Classic. If your application originally used Classic mode, you need to switch to Integrated mode after performing the upgrade:
Run Internet Information Services (IIS) Manager in Windows.
Select the Application Pool used by your application and click Basic settings.
Switch the Managed pipeline mode to Integrated and click OK.
Edit your project's web.config file.
Add the following <validation> element inside the system.webServer section directly under the web.config root (i.e. not under a specific <location> element):
<validation validateIntegratedModeConfiguration="false" />You may also need to adjust or remove any custom parts of your application that rely on Classic application pool mode.
If you plan on using the CMSApp_MVC project for your MVC development after upgrading to Kentico 9, you need to:
Objects that are stored in the server-side session state may have a different structure in the upgraded version. The changes may cause errors for users who access the upgraded site with outdated session data.
If your application uses a session state mode that preserves data through application restarts (StateServer, SQLServer or Custom), you need to manually clear any existing session data after you perform the upgrade:
Open the upgraded website in a browser. When handling the first request, the system performs certain tasks required to finalize the upgrade. Processing of the first request may take longer than usual.
The first request also includes the automatic import of new web part, widget, report and time zone objects.
Important: Once the website loads, log in to the administration interface and open the Event log application. Check for the presence of any errors or exceptions between the Upgrade - Start and Upgrade - Finish events:
You need to add Kentico version 9 licenses for the domains used by your sites:
In Kentico 9, the database view used when querying page data no longer contains the following columns:
You will encounter errors on your site if you use these columns when working with page data. We recommend searching your site for the following:
You need to remove or replace all occurrences of the given columns:
To replace the SiteName column, prepare modified queries or conditions based on the NodeSiteID column.
In ASCX transformations, you can use the ObjectTransformation control to get other values based on the NodeSiteID. For example:
<cms:ObjectTransformation
runat="server"
ObjectType="cms.site"
ObjectID='<%# Eval<int>("NodeSiteID") %>'
Transformation="{% SiteName %}"
/>To replace the NodeOwnerFullName, NodeOwnerUserName or NodeOwnerEmail columns, use the NodeOwner column (stores the ID of the given user).
To replace conditions such as Published = 1, use SQL code similar to the following:
[DocumentCanBePublished] = 1
AND
([DocumentPublishFrom] IS NULL OR [DocumentPublishFrom] <= GETDATE())
AND
([DocumentPublishTo] IS NULL OR [DocumentPublishTo] >= GETDATE())Kentico 9 no longer supports several web parts and widgets that were present in previous versions of Kentico (for example the Document library and Drop-down menu). The upgrade procedure deleted their code files but kept their object definitions are in the database. Follow the instructions in Recovering abandoned features, web parts and widgets and either recover the abandoned web parts and widgets or delete them from the system.
Kentico 9 abandons the Language selection, Language selection drop-down, and Language selection with flags web parts. We recommend building language selectors using the new Language data source web part. You can also recover the abandoned web parts.
Project management (opens in a new tab) features are no longer supported in Kentico 9. Decide whether you wish to continue using project management after you perform the upgrade procedure. See Recovering abandoned features, web parts and widgets for detailed instructions.
To ensure that macros and the administration interface work correctly after the upgrade:
The system resigns all macros. The new security signatures of all macros contain the username of your administrator account.
Validate that all macros in the system work correctly:
For more information, see the Macro expressions chapter.
The upgrade procedure automatically disables web farm functionality. If your Kentico instance runs on a web farm, you need to enable web farms after you complete the upgrade.
We recommend that you enable the web farm on one server or instance and after that you add the remaining servers to the web farm.
If you have UI personalization enabled for your site, we recommend reviewing the settings for all available roles. You may wish to enable access to new UI elements added by the upgrade (applications, tabs, etc.).
If your Kentico 8.2 instance contained orders imported from Kentico 7 or older that weren't recalculated before the upgrade to Kentico 9, taxes will be displayed with values of zero for every order item in invoices and email notifications. However, the final prices is be calculated correctly with taxes.
If you want to prevent this behavior, which can be unpleasant for unfinished orders, run the following code to assign current taxes to all unfinished orders (or all orders if preferred). For example, you can create a user control to run the code.
// Gets orders for recalculation, for example 1-month-old with a specific order status (orderStatusId) and from a specific site (siteId)
var orders = OrderInfoProvider.GetOrders(siteId)
.WhereGreaterOrEquals("OrderDate", DateTime.Now.AddMonths(-1))
.WhereEquals("OrderStatusID", orderStatusId)
.Column("OrderID")
.GetListResult<int>();
// Loops through the found orders
foreach(var orderId in orders)
{
// Gets the shopping cart from the order and recalculates it with current taxes, discounts, etc.
var cart = ShoppingCartInfoProvider.GetShoppingCartInfoFromOrder(orderId);
cart.InvalidateCalculations();
ShoppingCartInfoProvider.EvaluateShoppingCart(cart);
// Saves the recalculated shopping cart as an order without generating an invoice
bool generateInvoice = false;
ShoppingCartInfoProvider.SetOrder(cart, generateInvoice);
}Since Kentico 7 does not keep the tax values of every order item, you cannot restore the tax values from the time of order creation.
The Registration conversion name and Registration conversion value e-commerce settings that affect the obsolete Checkout process web part were hidden.
If you use the obsolete Checkout process web part and want to display the related settings, run the following SQL script against your Kentico database:
DECLARE @SiteID INT = YOUR_SITE_ID;
UPDATE dbo.CMS_SettingsKey
SET KeyIsHidden = 0
WHERE KeyName IN ('CMSStoreAllowAnonymousCustomers', 'CMSStoreUseExtraCompanyAddress', 'CMSStoreRequireCompanyInfo', 'CMSStoreShowOrganizationID', 'CMSStoreShowTaxRegistrationID', 'CMSStoreRegistrationConversionName', 'CMSStoreRegistrationConversionValue') AND (SiteID = @SiteID OR SiteID IS NULL)
UPDATE dbo.CMS_UIElement
SET ElementVisibilityCondition = NULL
WHERE ElementName = 'Configuration.Settings.CheckoutProcess' OR ElementName = 'Tools.Ecommerce.CheckoutSettings'The automatic contact deletion settings have changed. If you use automatic contact deletion, consider changing the settings to reflect your current requirements.
By default, Kentico 9 uses security tokens to protect pages against Cross site request forgery attacks. If your website uses the cookie law consent features to disable cookies of the Essential level, you will encounter CSRF errors for all POST requests (because the cookie storing security tokens is not available).
If you wish to continue using the restricted cookie level, you need to disable the CSRF security tokens by adding the following key to the appSettings section of your web.config file:
<add key="CMSEnableCsrfProtection" value="false" />Kentico does not provide an upgrade package for source code instances. We recommend using the following process if you need to upgrade a source code project:
If you want to log conversions in the currently recommended checkout process web parts (composed from multiple web parts), set the conversion properties directly while editing the Registration form web part.