You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many great resources for learning how to build a new solution using CMS 12 and Commerce 14. The official [developer documentation](https://world.optimizely.com) has been updated, the official [user guide](https://webhelp.optimizely.com) has been updated, and an excellent [masterclass](https://www.optimizely.com/support/education/product/migrating-to-optimizely-cms-12-and-commerce-14) is hosted by Mark Price and Scott Reed (to name a few). But there aren’t many resources sharing information on how to take an existing CMS 11 / Commerce 13 solution and upgrade it to .NET 5+.
7
+
There are many great resources for learning how to build a new solution using
8
+
CMS 12 and Commerce 14. The official [developer documentation](https://world.optimizely.com)
9
+
has been updated, the official [user guide](https://webhelp.optimizely.com) has
10
+
been updated, and an excellent [masterclass](https://www.optimizely.com/support/education/product/migrating-to-optimizely-cms-12-and-commerce-14)
11
+
is hosted by Mark Price and Scott Reed (to name a few). But there isn't much
12
+
information on how to take an existing CMS 11 / Commerce 13 solution and upgrade
13
+
it to .NET 5+.
14
+
15
+
This blog post is not intended to be the definitive guide for ugprading an
16
+
existing solution to .NET 5+, but rather a collection of learnings from
17
+
misadventures in upgrading two Commerce 13 solutions to date. One the eve of
18
+
.NET 5 falling out of LTS...
8
19
9
20
## Prerequisites
10
21
22
+
Make sure that your solution is ready to upgrade.
23
+
11
24
### 1. Read the official documentation
12
25
13
-
1.[Upgrading to Content Cloud (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/upgrading-to-content-cloud-cms-12)
14
-
2.[Breaking changes in Content Cloud (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/breaking-changes-in-content-cloud-cms-12)
15
-
3.[System requirements for Optimizely (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/system-requirements-for-optimizely)
26
+
1.[Upgrading to Content Cloud (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/upgrading-to-content-cloud-cms-12)
27
+
2.[Breaking changes in Content Cloud (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/breaking-changes-in-content-cloud-cms-12)
28
+
3.[System requirements for Optimizely (CMS 12)](https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/system-requirements-for-optimizely)
16
29
17
30
### 2. Be on .NET Framework 4.7.2 or higher
18
31
19
-
CMS 11 only [requires](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/system-requirements-for-optimizely) .NET Framework 4.6.1, but Microsoft [recommends](https://docs.microsoft.com/en-us/dotnet/core/porting/premigration-needed-changes) being on 4.7.2 or higher when using Upgrade-Assistant
32
+
CMS 11 only [requires](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/system-requirements-for-optimizely)
33
+
.NET Framework 4.6.1, but Microsoft [recommends](https://docs.microsoft.com/en-us/dotnet/core/porting/premigration-needed-changes)
34
+
being on 4.7.2 or higher when using Upgrade-Assistant
20
35
21
36
### 3. Update to the latest version of CMS11 (Commerce13) before upgrading
22
37
23
-
The official documentation doesn't explicitly say to do this, but is there any reason _not_ to?
38
+
The official documentation doesn't explicitly say to do this, but is there any
39
+
reason _not_ to?
24
40
25
41
### 4. Check the status of add-on packages
26
42
27
-
Optimizely maintains a list of the .NET 5 migration status of the official platform and addon NuGet packages:
43
+
Optimizely maintains a list of the .NET 5 migration status of the official
-[Add-Ons Status (Optimizely.com)](https://world.optimizely.com/resources/net5/add-ons)
31
48
32
-
No such list exists for unofficial add-ons (as of this writing). So, when planning the upgrade, give yourself time to check the status of your favorite third party add-ons. Having no workaround for unsupported add-ons could derail your whole upgrade project. Know what you’re getting into.
49
+
No such list exists for unofficial add-ons (as of this writing). So, when
50
+
planning the upgrade, give yourself time to check the status of your favorite
51
+
third party add-ons. Having no workaround for unsupported add-ons could derail
52
+
your whole upgrade project. Know what you’re getting into.
33
53
34
-
Note that some old, .NET Framework add-ons will still work, just with a warning. For example: Authorize.Net. There is no .NET Core+ package, but it still compiles and runs.
54
+
Note that some old, .NET Framework add-ons will still work, just with a warning.
55
+
For example: Authorize.Net. There is no .NET Core+ package, but it still compiles
56
+
and runs when you install it to your .NET 5+ solution via NuGet.
35
57
36
58
## Upgrade-Assistant
37
59
38
-
Phase 1: How to use Microsoft's CLI tool for upgrading to .NET 5+
60
+
Once you have reviewed the prerequisites and your solution is ready, it's time
61
+
to start making changes. The [.NET Upgrade-Assistant](https://dotnet.microsoft.com/en-us/platform/upgrade-assistant)
62
+
is Microsoft's CLI tool for upgrading .NET Framework solutions to .NET 5+.
63
+
64
+
Read and bookmark the official Optimizely documentation: [Upgrade Assistant](https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/upgrade-assistant)
39
65
40
-
### Delete Commerce Manager
66
+
### 5. Delete Commerce Manager
41
67
42
-
- As of Commerce 14, Commerce Manager is no more.
43
-
- 👏
44
-
- Remove the Commerce Manager project before getting started with Upgrade-Assistant.
45
-
- Note that some of Commerce Manager’s functionality hasn’t been ported over to the CMS yet and can only be done with APIs:
46
-
- Importing and exporting catalogs
47
-
- Adding countries and regions
48
-
- Adding currencies
49
-
- Working with business objects
50
-
- Working with catalog and order meta classes and fields
68
+
As of Commerce 14, Commerce Manager is no more. 👏
51
69
52
-
### Delete `node_modules`
70
+
Remove the Commerce Manager project before getting started with Upgrade-Assistant.
71
+
Take note that some of Commerce Manager’s functionality hasn’t been ported over
72
+
to the CMS yet and can only be done with APIs:
53
73
54
-
As a first step, Upgrade-Assistant copies all files in your solution/project folder into a Backup directory.
74
+
- Importing and exporting catalogs
75
+
- Adding countries and regions
76
+
- Adding currencies
77
+
- Working with business objects
78
+
- Working with catalog and order meta classes and fields
55
79
56
-
This can be disabled, but to play it safe:
57
-
If you have `node_modules` in the project folder you are upgrading, then delete it before running UA.
80
+
### 6. Delete `node_modules`
58
81
59
-
(don’t forget to stop any local watch)
82
+
As a first step, Upgrade-Assistant copies all files in your solution/project
83
+
folder into a Backup directory. If you have NPM's `node_modules` directory in
84
+
the solution you are upgrading, you _probably_ want to delete it first so you
85
+
don't have to sit around waiting for it to be backed up. Upgrade-Assistant's
86
+
backup step can be disabled, but to play it safe, delete your `node_modules`
87
+
folder before moving forward.
60
88
61
-
### Use Opti’s Upgrade-Assistant-Extensions
89
+
### 7. Use Opti’s Upgrade-Assistant-Extensions
62
90
63
-
Optimizely provides Upgrade-Assistant extensions with some Opti-specific capabilities:
91
+
Upgrade-Assistant can be extended to automatically execute additional commands.
92
+
Optimizely has a public GitHub repo for their own Upgrade-Assistant extensions
93
+
which provides some Opti-specific capabilities:
64
94
65
95
- String Replacement
66
96
- Remove Default Argument for the TemplateDescriptor Attribute
@@ -70,44 +100,51 @@ Optimizely provides Upgrade-Assistant extensions with some Opti-specific capabil
70
100
- Remove obsolete using statements like Mediachase.BusinessFoundation
71
101
- Type Mapping like EPiServer.Web.Routing to EPiServer.Core.Routing
72
102
73
-
Additionally, NuGet packages can be specified and templates for Program.cs and Startup.cs as they are required by .NET 5.0 can be added as well.
74
-
75
-
Read how it works (there are a couple gotchas):<br/>
Additionally, NuGet packages can be specified, and templates for `Program.cs` and
104
+
`Startup.cs` (required by .NET 5+) can be added as well.
80
105
81
-
Ugrade-Assistant-Extensions will do some nice things for you out of the box (i.e., replace `BlockController` with `BlockComponent`\*), but do consider spending some time customizing the config for string/type/class replacements.
106
+
Read how it works on GitHub (there are a couple gotchas): [Upgrade Assistant Extensions](https://github.com/episerver/upgrade-assistant-extensions).
107
+
Check the [Releases](https://github.com/episerver/upgrade-assistant-extensions/releases)
108
+
page to learn what the configuration options are and how to use them.
82
109
83
-
\*It does not, e.g., change `PageController``Index` methods into `IndexAsync` methods, though.
110
+
Note that, although Ugrade-Assistant-Extensions will do some nice things for you
111
+
out of the box (e.g., replace `BlockController`s with `BlockComponent`s), do
112
+
expect to spend time customizing the config for string/type/class replacements.
84
113
85
114
How to get it ready:
86
115
87
-
1. Download the latest release (Epi.Source.Updater.X.Y.Z.zip):
1. Download the latest release (Epi.Source.Updater.X.Y.Z.zip): [Releases](https://github.com/episerver/upgrade-assistant-extensions/releases)
117
+
2. Unzip it to your local file system, such as `C:\Temp\Epi.Source.Updater\`.
118
+
3. Make your preferred configuration changes.
92
119
93
-
### Make a plan-of-attack before running Upgrade-Assistant
120
+
### 8. Make a plan-of-attack before running Upgrade-Assistant
94
121
95
122
Upgrade-Assistant can run against a Solution file (`.sln`) or Project file (`.csproj`).
123
+
If you run it against the Solution, it is smart enough to analyze your project
124
+
dependency tree and execute against one project at a time, in order, starting with
125
+
those that has no project dependencies.
96
126
97
-
If you run it against the Solution, it will execute against the child Projects in sequence according to the project dependency tree.
98
-
99
-
Example (RE: onion architecture):
127
+
For example, consider a fictitious onion architecture inspired `MySolution.sln`.
128
+
If you run Upgrade-Assistant against the `.sln`, it will execute against each
129
+
project in this order:
100
130
101
131
1.`MySolution.Domain.csproj`
132
+
- Depends on nothing
102
133
2.`MySolution.Application.csproj`
134
+
- Depends on Domain
103
135
3.`MySolution.Web.csproj`
104
-
4. (done)
136
+
- Depends on Application, which depends on Domain
105
137
106
-
### Consider doing one CSPROJ at a time
138
+
### 9. Consider doing one CSPROJ at a time
107
139
108
-
Upgrade-Assistant will track progress and start where it left off if you cancel it at any time. But...
140
+
Upgrade-Assistant will track progress and start where it left off if you cancel
141
+
it at any time. But—do figure out the dependency sequence first and
142
+
consider running UA manually against each Project. This will allow you to
143
+
resolve code issues in isolation on a per-Project basis without getting confused
144
+
about where you are with UA. Especially if you find yourself mindlessly jamming
145
+
that Enter key while it runs.
109
146
110
-
Do figure out the dependency sequence first and then run UA manually against each Project. This will allow you to resolve code issues in isolation on a per-Project basis without getting confused about where you are with UA.
147
+
For example,
111
148
112
149
1.`MySolution.Domain.csproj`
113
150
1. Run Upgrade-Assistant
@@ -122,48 +159,59 @@ Do figure out the dependency sequence first and then run UA manually against eac
122
159
2. Fix code issues
123
160
3. Commit to source control
124
161
125
-
### Think about what flags to use
162
+
### 10. Think about which flags to use
126
163
127
-
Basic syntax if your terminal is at the solution root:
164
+
Upgrade-Assistant has a number of flags that can modify execution behavior.
128
165
129
-
```
166
+
The UA basic syntax, if your terminal is at the solution root, is the following:
0 commit comments