description |
---|
Learn how to migrate a Konstrukt solution to Umbraco UI Builder. |
This guide provides a step-by-step approach to migrating a default Konstrukt solution to Umbraco UI Builder.
Before outlining the exact steps, there are a few key changes to be aware of.
These changes will dictate the steps to take in the process of migrating to Umbraco UI Builder.
Konstrukt | Umbraco UI Builder |
---|---|
Konstrukt.Core | Umbraco.UIBuilder.Core |
Konstrukt.Infrastructure | Umbraco.UIBuilder.Infrastructure |
Konstrukt.Web | Umbraco.UIBuilder.Web |
Konstrukt.Web.UI | Umbraco.UIBuilder.Web.StaticAssets |
Konstrukt.Startup | Umbraco.UIBuilder.Startup |
Konstrukt | Umbraco.UIBuilder |
C# Class changes
- Namespace changes as documented above.
- Most classes prefixed with the
Konstrukt
keyword have had this prefix removed.- Examples:
IKonstruktRepository
is nowIRepository
- Exclusions: The root level
KonstruktConfig
andKonstruktConfigBuilder
have aUIBuilder
prefix instead, and theAddKonstrukt
extension forIUmbracoBuilder
has been replaced byAddUIBuilder
- Examples:
JavaScript changes
- All
Konstrukt
controllers have changed namespace toUmbraco.UIBuilder
. - All
Konstrukt
prefixed directives, services, and resources are now prefixed withuibuilder
.
UI Changes
- All static UI assets are served via a Razor Compiled Library (RCL) and are no longer found in the
App_Plugins
folder. - The folder with
App_Plugins
has been renamed fromKonstrukt
toUmbracoUIBuilder
.
In this first step, we will be replacing all existing Konstrukt dependencies with Umbraco UI Builder dependencies.
- Remove any installed Konstrukt packages:
dotnet remove package Konstrukt
- Delete the Konstrukt
App_Plugins
folder:
rmdir App_Plugins\Konstrukt
- Install
Umbraco.UIBuilder
:
dotnet add package Umbraco.UIBuilder
- Compile your project against .NET 7.0.
Based on the Key Changes outlined above update all Konstrukt references to the new Umbraco UI Builder alternatives. Ensure you update any Views/Partials that also reference these.
If all your configuration is in a single statement, it would be a case of swapping AddKonstrukt
to AddUIBuilder
. If you broke your configuration into multiple steps, or are using Action
or Card
classes, you will need to update the config builder/base classes. Those classes need to be updated to their UI Builder alternative names as detailed in Key Changes.
public class Startup
{
...
public void ConfigureServices(IServiceCollection services)
{
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddUIBuilder(cfg => {
// The rest of your configuration
})
.AddComposers()
.Build();
}
...
}
- Delete any obj/bin folders in your projects to ensure a clean build.
- Recompile all projects and ensure all dependencies are restored correctly
- Delete the existing Konstrukt license files in the
umbraco\Licenses
folder. - Add your new Umbraco.UIBuilder license key to the
appSettings.json
file:
"Umbraco": {
"Licenses": {
"Umbraco.UIBuilder": "YOUR_LICENSE_KEY"
}
}
- Run the project.