From 4d9bcd886dfac686d8adec6aee671c0c18ef28f2 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:07:23 +0300 Subject: [PATCH 01/11] Create migrating-from-open-source.md --- en/migrating-from-open-source.md | 90 ++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 en/migrating-from-open-source.md diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md new file mode 100644 index 00000000..d3052022 --- /dev/null +++ b/en/migrating-from-open-source.md @@ -0,0 +1,90 @@ +# Migrating From ABP Framework + +This guide provides you a step-by-step guidance to migrating your existing application (that uses the ABP Framework) to ABP Commercial. Since, ABP Commercial uses the main structure of the ABP Framework and built top of that, this process is pretty straight-forward, you can apply the steps mentioned in the each steps and easily migrate your project to ABP Commercial. + +> After following this documentation, you should be able to migrate your project to ABP Commercial. However, if you had any problems or could not migrate your project, we are providing paid consultancy, which you can find details at [https://commercial.abp.io/additional-services](https://commercial.abp.io/additional-services). In this page, you can find related informations about our trainings, custom project development and porting existing projects services, and you can fill-out the contact form, so we can reach out to you! + +## ABP Commercial Migration Steps + +> In this guide, we assume that you have a middle-complex ABP based solution and want to migrate to ABP Commercial. Throuhgout this documentation, `Acme.BookStore` application will be used as a reference solution (example application that described in ABP's tutorial documents), which you can find at [https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore) but all of these steps are applicable for your own applications, only some of them can be changed according to your project choose and structure. However, the migration flow is the same. + +There are 4 main steps to migrating from ABP Framework to ABP Commercial, and each one of them are explained in the following sections, step-by-step and for project based: + +### 1. License Transition + +First step is to obtaining the necessary license for ABP Commercial to be able to get benefit of the pro modules and unlock the additional features. To do that, you should first get your `AbpLicenseCode` and `ApiKey` from the [organization's detail page](https://commercial.abp.io/my-organizations). + +Then, you can update the **NuGet.Config** file in the root directory of your solution and add the *packageSource* as follows (don't forget to replace `` placeholder): + +```diff + + + + ++ + + +``` + +After that, you can open the `appsettings.json` files under the `*.DbMigrator` and `*.Domain` projects and add your `AbpLicenseCode`: + +```json +{ + //... + + "AbpLicenseCode": "" +} + +``` + +> `ApiKey` is needed to be able to use ABP Commercial's NuGet packages and `AbpLicenseCode` is needed for license check per module. + +### 2. Installing the ABP Commercial Modules + +After, we have added the `ApiKey` and `AbpLicenseCode` to the relevant places, now we can add [ABP Commercial's modules](modules/index.md) to our solution. ABP Commercial provides plent of modules that extend the ABP Framework modules, such as `Account PRO` module over `Account` module or `Identity Pro` module over `Identity` module. + +To replace these modules and also add the additional modules provided by ABP Commercial, we can use the `abp add-module` command. This command finds all packages of the specified module, finds the related projects in the solution and adds each packages into the corresponding project in the solution. Therefore, by using this command, we don't need to manually add the package references to the `*.csproj` files and add related `[DependsOn(typeof(<>))]` statements to the module classes, instead this command do this behalf of us. + +You can run the following commands one after another in your solution directory and add all the related modules into your solution, like you have started with [one of the startup templates of ABP Commercial](startup-templates/index.md): + +1. `abp add-module Volo.Identity.Pro --skip-db-migrations` → [Identity Module](modules/identity.md) +2. `abp add-module Volo.OpenIddict.Pro --skip-db-migrations` → [OpenIddict Module](modules/openiddict.md) +3. `abp add-module Volo.Saas --skip-db-migrations` → [SaaS Module](modules/saas.md) +4. `abp add-module Volo.AuditLogging.Ui --skip-db-migrations` → [Audit Logging UI Module](modules/audit-logging.md) +5. `abp add-module Volo.Account.Pro --skip-db-migrations` → [Account Module](modules/account.md) +6. `abp add-module Volo.TextTemplateManagement --skip-db-migrations` → [Text Template Management Module](modules/text-template-management.md) +7. `abp add-module Volo.LanguageManagement --skip-db-migrations` → [Language Management Module](modules/language-management.md) +8. `abp add-module Volo.Gdpr --skip-db-migrations` → [GDPR Module](modules/gdpr.md) +9. `abp add-module Volo.Abp.BlobStoring.Database --skip-db-migrations` → [Blob Storing - Database Provider](https://docs.abp.io/en/abp/latest/Blob-Storing-Database) + +> These 9 modules are pre-installed to the [startup templates of ABP Commercial](startup-templates/index.md). Therefore, you can install all of them if you want to align your project with the startup templates, but it's totally optional, so if you you can skip running the command above for a module that you don't want to add into your solution. + +After running the commands above, all of the related commercial packages and their dependencies will be added into your solution. In addition to these module packages, we can add `Volo.Abp.Commercial.SuiteTemplates` package into our domain application to be able to use ABP Suite later on. By doing that you will be able to add your solution from [ABP Suite UI](abp-suite/index.md) and generate CRUD pages for your applications whenever you want. + +So, open your `*Domain.csproj` file and add the line below (don't forget to replace the `` placeholder): + +```xml + +``` + +Then, for the final step, we need to add the related `DependsOn` statement to the `*DomainModule.cs` file as follows: + +```cs +[DependsOn(typeof(VoloAbpCommercialSuiteTemplatesModule))] +public class BookStoreDomainModule : AbpModule +{ + //ommited for code brevity... +} +``` + +### 3. Removing the ABP Framework Module References + +//TODO: + +### 4. Updating Configurations + +//TODO: dbcontext, dataseeder vs. + creating migration and applying to the db. + +## Consultancy + +If you find the migration process challenging or prefer professional assistance, we offer a [paid consultancy service](https://commercial.abp.io/additional-services). Our experienced consultants can help ensure a smooth transition to ABP Commercial, addressing any specific needs or challenges your project may encounter. For detailed guidance and support, feel free to [reach out](https://commercial.abp.io/contact)! \ No newline at end of file From bb8a75bd1c8556ca18c65e66718555c68bbc7a96 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:49:40 +0300 Subject: [PATCH 02/11] Update migrating-from-open-source.md --- en/migrating-from-open-source.md | 160 +++++++++++++++++++++++++++++-- 1 file changed, 151 insertions(+), 9 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index d3052022..9caa973d 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -41,9 +41,9 @@ After that, you can open the `appsettings.json` files under the `*.DbMigrator` a ### 2. Installing the ABP Commercial Modules -After, we have added the `ApiKey` and `AbpLicenseCode` to the relevant places, now we can add [ABP Commercial's modules](modules/index.md) to our solution. ABP Commercial provides plent of modules that extend the ABP Framework modules, such as `Account PRO` module over `Account` module or `Identity Pro` module over `Identity` module. +After, you have added the `ApiKey` and `AbpLicenseCode` to the relevant places, now you can add [ABP Commercial's modules](modules/index.md) to your solution. ABP Commercial provides plent of modules that extend the ABP Framework modules, such as `Account PRO` module over `Account` module or `Identity Pro` module over `Identity` module. -To replace these modules and also add the additional modules provided by ABP Commercial, we can use the `abp add-module` command. This command finds all packages of the specified module, finds the related projects in the solution and adds each packages into the corresponding project in the solution. Therefore, by using this command, we don't need to manually add the package references to the `*.csproj` files and add related `[DependsOn(typeof(<>))]` statements to the module classes, instead this command do this behalf of us. +To replace these modules and also add the additional modules provided by ABP Commercial, you can use the `abp add-module` command (and then remove the free modules in the next section). This command finds all packages of the specified module, finds the related projects in the solution and adds each packages into the corresponding project in the solution. Therefore, by using this command, you don't need to manually add the package references to the `*.csproj` files and add related `[DependsOn(typeof(<>))]` statements to the module classes, instead this command do this behalf of you. You can run the following commands one after another in your solution directory and add all the related modules into your solution, like you have started with [one of the startup templates of ABP Commercial](startup-templates/index.md): @@ -59,7 +59,7 @@ You can run the following commands one after another in your solution directory > These 9 modules are pre-installed to the [startup templates of ABP Commercial](startup-templates/index.md). Therefore, you can install all of them if you want to align your project with the startup templates, but it's totally optional, so if you you can skip running the command above for a module that you don't want to add into your solution. -After running the commands above, all of the related commercial packages and their dependencies will be added into your solution. In addition to these module packages, we can add `Volo.Abp.Commercial.SuiteTemplates` package into our domain application to be able to use ABP Suite later on. By doing that you will be able to add your solution from [ABP Suite UI](abp-suite/index.md) and generate CRUD pages for your applications whenever you want. +After running the commands above, all of the related commercial packages and their dependencies will be added into your solution. In addition to these module packages, you can add `Volo.Abp.Commercial.SuiteTemplates` package into our domain application to be able to use ABP Suite later on. By doing that you will be able to add your solution from [ABP Suite UI](abp-suite/index.md) and generate CRUD pages for your applications whenever you want. So, open your `*Domain.csproj` file and add the line below (don't forget to replace the `` placeholder): @@ -67,23 +67,165 @@ So, open your `*Domain.csproj` file and add the line below (don't forget to repl ``` -Then, for the final step, we need to add the related `DependsOn` statement to the `*DomainModule.cs` file as follows: +Then, for the final step, you need to add the related `DependsOn` statement to the `*DomainModule.cs` file as follows: ```cs [DependsOn(typeof(VoloAbpCommercialSuiteTemplatesModule))] public class BookStoreDomainModule : AbpModule { - //ommited for code brevity... + //omited for code abbreviation... } ``` -### 3. Removing the ABP Framework Module References +### 3. Removing the ABP Framework Module References & Updating Configurations -//TODO: +After the license transition and installing the ABP Commercial Modules, now you can remove the unnecessary free modules. For example, now you don't need the `Identity` module in your solution, because you have added the `Identity PRO` module in the previous section and it's already has dependcy to the free module and extends it. -### 4. Updating Configurations +You should remove various dependencies and references in different projects in your solution. All of the required changes are listed below in different sections, please apply the following steps to remove the unnecessary ABP Framework Modules: -//TODO: dbcontext, dataseeder vs. + creating migration and applying to the db. +#### 3.1 - Domain.Shared Project + +`*Domain.Shared.csproj`: + +```diff +- +- +- +``` + +`*DomainSharedModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpIdentityDomainSharedModule), +- typeof(AbpOpenIddictDomainSharedModule), +- typeof(AbpTenantManagementDomainSharedModule) +``` + +#### 3.2 - Domain Project + +`*Domain.csproj`: + +```diff +- +- +- +``` + +`*DomainModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpIdentityDomainModule), +- typeof(AbpOpenIddictDomainModule), +- typeof(AbpTenantManagementDomainModule), +``` + +After removing the unnecessary references, we should update the namespaces in the `BookStoreDbMigrationService` class under the **Data** folder: + +```diff +- using Volo.Abp.TenantManagement; ++ using Volo.Saas.Tenants; +``` + +#### 3.3 - EntityFrameworkCore Project + +`*EntityFrameworkCore.csproj`: + +```diff +- +- +- +``` + +`*EntityFrameworkCoreModule.cs`: + +```diff +- using Volo.Abp.TenantManagement.EntityFrameworkCore; + +- typeof(AbpIdentityEntityFrameworkCoreModule), +- typeof(AbpOpenIddictEntityFrameworkCoreModule), +- typeof(AbpTenantManagementEntityFrameworkCoreModule) +``` + +`*DbContext.cs`: + +```diff +- using Volo.Abp.TenantManagement; +- using Volo.Abp.TenantManagement.EntityFrameworkCore; ++ using Volo.Saas.Editions; ++ using Volo.Saas.EntityFrameworkCore; ++ using Volo.Saas.Tenants; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +- [ReplaceDbContext(typeof(ITenantManagementDbContext))] ++ [ReplaceDbContext(typeof(ISaasDbContext))] +[ConnectionStringName("Default")] +public class BookStoreDbContext : + AbpDbContext, + IIdentityDbContext, +- ITenantManagementDbContext ++ ISaasDbContext +{ + //... + +- // Tenant Management +- public DbSet Tenants { get; set; } +- public DbSet TenantConnectionStrings { get; set; } + ++ // SaaS ++ public DbSet Tenants { get; set; } ++ public DbSet Editions { get; set; } ++ public DbSet TenantConnectionStrings { get; set; } + + //... + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + //... + +- builder.ConfigureIdentity(); ++ builder.ConfigureIdentityPro(); +- builder.ConfigureOpenIddict(); ++ builder.ConfigureOpenIddictPro(); +- builder.ConfigureTenantManagement(); ++ builder.ConfigureSaas(); + + } +} +``` + +#### 3.4 - Application.Contracts Project + +`*Application.Contracts.csproj`: + +```diff +- +- +- +``` + +`*ApplicationContractsModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpAccountApplicationContractsModule), +- typeof(AbpTenantManagementApplicationContractsModule), +``` + +#### 3.5 - Application Project +#### 3.6 - HttpApi Project +#### 3.7 - HttpApi.Client Project +#### 3.8 - Web Project + +### 4. Creating Migrations & Running Application + +//TODO: creating migration, applying to the db and running the application ## Consultancy From 897aff037acde9fa00ee7d5e179da86070044830 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:05:45 +0300 Subject: [PATCH 03/11] Update migrating-from-open-source.md --- en/migrating-from-open-source.md | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index 9caa973d..991fa8a4 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -219,10 +219,85 @@ public class BookStoreDbContext : ``` #### 3.5 - Application Project + +`*Application.csproj`: + +```diff +- +- +- +``` + +`*ApplicationModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpAccountApplicationModule), +- typeof(AbpTenantManagementApplicationModule), +``` + #### 3.6 - HttpApi Project + +`*HttpApi.csproj`: + +```diff +- +- +- +``` + +`*HttpApiModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpAccountHttpApiModule), +- typeof(AbpTenantManagementHttpApiModule), +``` + #### 3.7 - HttpApi.Client Project + +`*HttpApi.Client.csproj`: + +```diff +- +- +- +``` + +`*HttpApiClientModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpAccountHttpApiClientModule), +- typeof(AbpTenantManagementHttpApiClientModule), +``` + #### 3.8 - Web Project +`*Web.csproj`: + +```diff +- ++ +- +- +- +``` + +> Notice, we have also changed LeptonXLite theme reference with the [LeptonX Theme](themes/lepton-x/index.md), which is a commercial theme provided by ABP Commercial and has superior features than LeptonX Lite theme. + +`*WebModule.cs`: + +```diff +- using Volo.Abp.TenantManagement; + +- typeof(AbpAccountWebModule), +- typeof(AbpTenantManagementWebModule), +``` + ### 4. Creating Migrations & Running Application //TODO: creating migration, applying to the db and running the application From 93a08381ebaee3eb174408205bae78f4789a7788 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:48:17 +0300 Subject: [PATCH 04/11] Update migrating-from-open-source.md --- en/migrating-from-open-source.md | 138 +++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 5 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index 991fa8a4..c87672e7 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -282,25 +282,153 @@ public class BookStoreDbContext : ```diff - + + - -- - + +- ++ + ``` > Notice, we have also changed LeptonXLite theme reference with the [LeptonX Theme](themes/lepton-x/index.md), which is a commercial theme provided by ABP Commercial and has superior features than LeptonX Lite theme. -`*WebModule.cs`: +Let's update namespaces as follows for the `*WebModule.cs`: ```diff -- using Volo.Abp.TenantManagement; +- using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +- using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; ++ using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX; ++ using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX.Bundling; + +- using Volo.Abp.TenantManagement.Web; ++ using Volo.Abp.Gdpr.Web.Extensions; ++ using Volo.Abp.LeptonX.Shared; ++ using Volo.Abp.PermissionManagement; +``` + +Then, we can update the configurations and add missing middlewares to the request pipeline in the same file, as follows: -- typeof(AbpAccountWebModule), +```diff +- typeof(AbpAccountWebOpenIddictModule), ++ typeof(AbpAccountPublicWebOpenIddictModule), - typeof(AbpTenantManagementWebModule), +- typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), ++ typeof(AbpAspNetCoreMvcUiLeptonXThemeModule), + + public override void ConfigureServices(ServiceConfigurationContext context) + { + //other configurations... + ++ context.Services.AddAbpCookieConsent(options => ++ { ++ options.IsEnabled = true; ++ options.CookiePolicyUrl = "/CookiePolicy"; ++ options.PrivacyPolicyUrl = "/PrivacyPolicy"; ++ }); + ++ Configure(options => ++ { ++ options.DefaultStyle = LeptonXStyleNames.System; ++ }); + ++ Configure(options => ++ { ++ options.ApplicationLayout = LeptonXMvcLayouts.SideMenu; ++ }); + ++ Configure(options => ++ { ++ options.IsDynamicPermissionStoreEnabled = true; ++ }); + } + + //... + + Configure(options => + { + options.StyleBundles.Configure( +- LeptonXLiteThemeBundles.Styles.Global, ++ LeptonXThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + //... + ++ app.UseAbpCookieConsent(); + app.UseCorrelationId(); ++ app.UseAbpSecurityHeaders(); + app.UseStaticFiles(); + + //... + } +``` + +> **Note:** In the startup templates of ABP Commercial, beside these configurations, there are some additional configurations, such as [configuring impersonation](modules/account/impersonation.md), [configuring external providers](https://docs.abp.io/en/abp/latest/Modules/Account#configure-the-provider) and configuring health checks. These configurations are optional, and for the sake of the simplicity, in this documentation, we did not mention them. You can apply the related configurations by checking the related documentations and from the default startup templates. + +Update the namespaces in the `BookStoreMenuContributor` file as follows: + +```diff +- using Volo.Abp.TenantManagement.Web.Navigation; ++ using Volo.Abp.TextTemplateManagement.Web.Navigation; ++ using Volo.Abp.AuditLogging.Web.Navigation; ++ using Volo.Abp.LanguageManagement.Navigation; ++ using Volo.Abp.OpenIddict.Pro.Web.Menus; +``` + +Then, update the `ConfigureMainMenuAsync` method in this file as follows: + +```csharp +private Task ConfigureMainMenuAsync(MenuConfigurationContext context) +{ + //other configurations for menu items... + + //Administration + var administration = context.Menu.GetAdministration(); + administration.Order = 5; + + //Administration->Identity + administration.SetSubItemOrder(IdentityMenuNames.GroupName, 1); + + //Administration->OpenIddict + administration.SetSubItemOrder(OpenIddictProMenus.GroupName, 2); + + //Administration->Language Management + administration.SetSubItemOrder(LanguageManagementMenuNames.GroupName, 3); + + //Administration->Text Template Management + administration.SetSubItemOrder(TextTemplateManagementMainMenuNames.GroupName, 4); + + //Administration->Audit Logs + administration.SetSubItemOrder(AbpAuditLoggingMainMenuNames.GroupName, 5); + + //Administration->Settings + administration.SetSubItemOrder(SettingManagementMenuNames.GroupName, 6); + + return Task.CompletedTask; +} ``` ### 4. Creating Migrations & Running Application -//TODO: creating migration, applying to the db and running the application +That's it, you have applied the all related steps to migrate your application from ABP Framework to ABP Commercial. Now, you can create a new migration, apply it to your database and run your application! + +To create a new migration, open a terminal in your `*.EntityFrameworkCore` project directory, and run the following command: + +```bash +dotnet ef migrations Migrated_To_ABP_Commercial +``` + +Then, to apply the database into your database and seed the initial data, you can run the `DbMigrator` project. After it's completed, you can run the `*.Web` project to see your application as working. ## Consultancy From 363d068413fb4f58f2578724ac28b9f7ef07cc48 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:38:12 +0300 Subject: [PATCH 05/11] Complete the "Migrating From ABP Framework" doc. --- en/migrating-from-open-source.md | 75 +++++++++++++++++--------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index c87672e7..e9abefcd 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -1,18 +1,18 @@ # Migrating From ABP Framework -This guide provides you a step-by-step guidance to migrating your existing application (that uses the ABP Framework) to ABP Commercial. Since, ABP Commercial uses the main structure of the ABP Framework and built top of that, this process is pretty straight-forward, you can apply the steps mentioned in the each steps and easily migrate your project to ABP Commercial. +This guide provides you a step-by-step guidance to migrating your existing application (that uses the ABP Framework) to ABP Commercial. Since ABP Commercial uses the main structure of the ABP Framework and is built on top of that, this process is pretty straightforward, you can apply the steps mentioned in each step and easily migrate your project to ABP Commercial. -> After following this documentation, you should be able to migrate your project to ABP Commercial. However, if you had any problems or could not migrate your project, we are providing paid consultancy, which you can find details at [https://commercial.abp.io/additional-services](https://commercial.abp.io/additional-services). In this page, you can find related informations about our trainings, custom project development and porting existing projects services, and you can fill-out the contact form, so we can reach out to you! +> After following this documentation, you should be able to migrate your project to ABP Commercial. However, if you have any problems or cannot migrate your project, we are providing paid consultancy, which you can find details at [https://commercial.abp.io/additional-services](https://commercial.abp.io/additional-services). On this page, you can find related pieces of information about our trainings, custom project development, and porting existing projects services, and you can fill-out the contact form, so we can reach out to you. ## ABP Commercial Migration Steps -> In this guide, we assume that you have a middle-complex ABP based solution and want to migrate to ABP Commercial. Throuhgout this documentation, `Acme.BookStore` application will be used as a reference solution (example application that described in ABP's tutorial documents), which you can find at [https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore) but all of these steps are applicable for your own applications, only some of them can be changed according to your project choose and structure. However, the migration flow is the same. +In this guide, we assume that you have a middle-complex ABP based solution and want to migrate to ABP Commercial. Throughout this documentation, `Acme.BookStore` application will be used as a reference solution (example application that is described in ABP's tutorial documents), which you can find at [https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore) but all of these steps are applicable for your own applications, only some of them can be changed according to your project choose and structure. However, the migration flow is the same. -There are 4 main steps to migrating from ABP Framework to ABP Commercial, and each one of them are explained in the following sections, step-by-step and for project based: +There are 4 main steps to migrating from ABP Framework to ABP Commercial, and each one of them is explained in the following sections, step-by-step and project-based: ### 1. License Transition -First step is to obtaining the necessary license for ABP Commercial to be able to get benefit of the pro modules and unlock the additional features. To do that, you should first get your `AbpLicenseCode` and `ApiKey` from the [organization's detail page](https://commercial.abp.io/my-organizations). +The first step is to obtain the necessary license for ABP Commercial to be able to get the benefit of the pro modules and unlock the additional features. To do that, you should first get your `AbpLicenseCode` and `ApiKey` from the [organization's detail page](https://commercial.abp.io/my-organizations). Then, you can update the **NuGet.Config** file in the root directory of your solution and add the *packageSource* as follows (don't forget to replace `` placeholder): @@ -37,15 +37,15 @@ After that, you can open the `appsettings.json` files under the `*.DbMigrator` a ``` -> `ApiKey` is needed to be able to use ABP Commercial's NuGet packages and `AbpLicenseCode` is needed for license check per module. +> `ApiKey` is needed to be able to use ABP Commercial's NuGet packages and `AbpLicenseCode` is needed for license checks per module. ### 2. Installing the ABP Commercial Modules -After, you have added the `ApiKey` and `AbpLicenseCode` to the relevant places, now you can add [ABP Commercial's modules](modules/index.md) to your solution. ABP Commercial provides plent of modules that extend the ABP Framework modules, such as `Account PRO` module over `Account` module or `Identity Pro` module over `Identity` module. +After, you have added the `ApiKey` and `AbpLicenseCode` to the relevant places, now you can add [ABP Commercial's modules](modules/index.md) to your solution. ABP Commercial provides plenty of modules that extend the ABP Framework modules, such as the `Account Pro` module over the `Account` module or the `Identity Pro` module over the `Identity` module. -To replace these modules and also add the additional modules provided by ABP Commercial, you can use the `abp add-module` command (and then remove the free modules in the next section). This command finds all packages of the specified module, finds the related projects in the solution and adds each packages into the corresponding project in the solution. Therefore, by using this command, you don't need to manually add the package references to the `*.csproj` files and add related `[DependsOn(typeof(<>))]` statements to the module classes, instead this command do this behalf of you. +To replace these modules and also add the additional modules provided by ABP Commercial, you can use the `abp add-module` command (and then remove the free modules as described in the next section). This command finds all packages of the specified module, finds the related projects in the solution, and adds each package to the corresponding project in the solution. Therefore, by using this command, you don't need to manually add the package references to the `*.csproj` files and add related `[DependsOn(typeof(<>))]` statements to the module classes, instead, this command does this on behalf of you. -You can run the following commands one after another in your solution directory and add all the related modules into your solution, like you have started with [one of the startup templates of ABP Commercial](startup-templates/index.md): +You can run the following commands one after another in your solution directory and add all the related modules into your solution as you would have started with [one of the startup templates of ABP Commercial](startup-templates/index.md): 1. `abp add-module Volo.Identity.Pro --skip-db-migrations` → [Identity Module](modules/identity.md) 2. `abp add-module Volo.OpenIddict.Pro --skip-db-migrations` → [OpenIddict Module](modules/openiddict.md) @@ -57,9 +57,9 @@ You can run the following commands one after another in your solution directory 8. `abp add-module Volo.Gdpr --skip-db-migrations` → [GDPR Module](modules/gdpr.md) 9. `abp add-module Volo.Abp.BlobStoring.Database --skip-db-migrations` → [Blob Storing - Database Provider](https://docs.abp.io/en/abp/latest/Blob-Storing-Database) -> These 9 modules are pre-installed to the [startup templates of ABP Commercial](startup-templates/index.md). Therefore, you can install all of them if you want to align your project with the startup templates, but it's totally optional, so if you you can skip running the command above for a module that you don't want to add into your solution. +> These 9 modules are pre-installed on the [startup templates of ABP Commercial](startup-templates/index.md). Therefore, you can install all of them if you want to align your project with the startup templates, but it's totally optional, so you can skip running the command above for a module that you don't want to add to your solution. -After running the commands above, all of the related commercial packages and their dependencies will be added into your solution. In addition to these module packages, you can add `Volo.Abp.Commercial.SuiteTemplates` package into our domain application to be able to use ABP Suite later on. By doing that you will be able to add your solution from [ABP Suite UI](abp-suite/index.md) and generate CRUD pages for your applications whenever you want. +After running the commands above, all of the related commercial packages and their dependencies will be added to your solution. In addition to these module packages, you can add `Volo.Abp.Commercial.SuiteTemplates` package into our domain application to be able to use ABP Suite later on. By doing that you will be able to add your solution from [ABP Suite UI](abp-suite/index.md) and generate CRUD pages for your applications whenever you want. So, open your `*Domain.csproj` file and add the line below (don't forget to replace the `` placeholder): @@ -79,13 +79,13 @@ public class BookStoreDomainModule : AbpModule ### 3. Removing the ABP Framework Module References & Updating Configurations -After the license transition and installing the ABP Commercial Modules, now you can remove the unnecessary free modules. For example, now you don't need the `Identity` module in your solution, because you have added the `Identity PRO` module in the previous section and it's already has dependcy to the free module and extends it. +After the license transition and installing the ABP Commercial Modules, now you can remove the unnecessary free modules. For example, now you don't need the `Identity` module in your solution, because you have added the `Identity PRO` module in the previous section and it already has dependency on the free module and extends it. You should remove various dependencies and references in different projects in your solution. All of the required changes are listed below in different sections, please apply the following steps to remove the unnecessary ABP Framework Modules: #### 3.1 - Domain.Shared Project -`*Domain.Shared.csproj`: +Remove the unnecessary references from the `*Domain.Shared.csproj`: ```diff - @@ -93,7 +93,7 @@ You should remove various dependencies and references in different projects in y - ``` -`*DomainSharedModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*DomainSharedModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -105,7 +105,7 @@ You should remove various dependencies and references in different projects in y #### 3.2 - Domain Project -`*Domain.csproj`: +Remove the unnecessary references from the `*Domain.csproj`: ```diff - @@ -113,7 +113,7 @@ You should remove various dependencies and references in different projects in y - ``` -`*DomainModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*DomainModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -132,7 +132,7 @@ After removing the unnecessary references, we should update the namespaces in th #### 3.3 - EntityFrameworkCore Project -`*EntityFrameworkCore.csproj`: +Remove the unnecessary references from the `*EntityFrameworkCore.csproj`: ```diff - @@ -140,7 +140,7 @@ After removing the unnecessary references, we should update the namespaces in th - ``` -`*EntityFrameworkCoreModule.cs`: +Remove the unnecessary namespaces from `*EntityFrameworkCoreModule.cs`: ```diff - using Volo.Abp.TenantManagement.EntityFrameworkCore; @@ -150,7 +150,7 @@ After removing the unnecessary references, we should update the namespaces in th - typeof(AbpTenantManagementEntityFrameworkCoreModule) ``` -`*DbContext.cs`: +Then, update the`*DbContext.cs` and make the related configurations: ```diff - using Volo.Abp.TenantManagement; @@ -158,6 +158,7 @@ After removing the unnecessary references, we should update the namespaces in th + using Volo.Saas.Editions; + using Volo.Saas.EntityFrameworkCore; + using Volo.Saas.Tenants; ++ using Volo.Abp.LanguageManagement.EntityFrameworkCore; [ReplaceDbContext(typeof(IIdentityDbContext))] - [ReplaceDbContext(typeof(ITenantManagementDbContext))] @@ -195,13 +196,15 @@ public class BookStoreDbContext : - builder.ConfigureTenantManagement(); + builder.ConfigureSaas(); ++ builder.ConfigureLanguageManagement(); + } } ``` #### 3.4 - Application.Contracts Project -`*Application.Contracts.csproj`: +Remove the unnecessary references from the `*Application.Contracts.csproj`: ```diff - @@ -209,7 +212,7 @@ public class BookStoreDbContext : - ``` -`*ApplicationContractsModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*ApplicationContractsModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -220,7 +223,7 @@ public class BookStoreDbContext : #### 3.5 - Application Project -`*Application.csproj`: +Remove the unnecessary references from the `*Application.csproj`: ```diff - @@ -228,7 +231,7 @@ public class BookStoreDbContext : - ``` -`*ApplicationModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*ApplicationModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -239,7 +242,7 @@ public class BookStoreDbContext : #### 3.6 - HttpApi Project -`*HttpApi.csproj`: +Remove the unnecessary references from the `*HttpApi.csproj`: ```diff - @@ -247,7 +250,7 @@ public class BookStoreDbContext : - ``` -`*HttpApiModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*HttpApiModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -258,7 +261,7 @@ public class BookStoreDbContext : #### 3.7 - HttpApi.Client Project -`*HttpApi.Client.csproj`: +Remove the unnecessary references from the `*HttpApi.Client.csproj`: ```diff - @@ -266,7 +269,7 @@ public class BookStoreDbContext : - ``` -`*HttpApiClientModule.cs`: +Remove the unnecessary namespaces, and **DependsOn** statements from `*HttpApiClientModule.cs`: ```diff - using Volo.Abp.TenantManagement; @@ -277,7 +280,7 @@ public class BookStoreDbContext : #### 3.8 - Web Project -`*Web.csproj`: +Remove the unnecessary references from the `*Web.csproj`: ```diff - @@ -291,9 +294,9 @@ public class BookStoreDbContext : ``` -> Notice, we have also changed LeptonXLite theme reference with the [LeptonX Theme](themes/lepton-x/index.md), which is a commercial theme provided by ABP Commercial and has superior features than LeptonX Lite theme. +> Notice, that you have also changed the LeptonXLite theme reference with the [LeptonX Theme](themes/lepton-x/index.md), which is a commercial theme provided by ABP Commercial and has superior features to the LeptonX Lite theme. -Let's update namespaces as follows for the `*WebModule.cs`: +Update namespaces for the `*WebModule.cs`: ```diff - using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; @@ -373,7 +376,7 @@ Then, we can update the configurations and add missing middlewares to the reques } ``` -> **Note:** In the startup templates of ABP Commercial, beside these configurations, there are some additional configurations, such as [configuring impersonation](modules/account/impersonation.md), [configuring external providers](https://docs.abp.io/en/abp/latest/Modules/Account#configure-the-provider) and configuring health checks. These configurations are optional, and for the sake of the simplicity, in this documentation, we did not mention them. You can apply the related configurations by checking the related documentations and from the default startup templates. +> **Note:** In the startup templates of ABP Commercial, besides these configurations, there are some additional configurations, such as [configuring impersonation](modules/account/impersonation.md), [configuring external providers](https://docs.abp.io/en/abp/latest/Modules/Account#configure-the-provider), and configuring health checks. These configurations are optional, and for the sake of simplicity, in this documentation, we did not mention them. You can apply the related configurations by checking the related documentation and from the default startup templates. Update the namespaces in the `BookStoreMenuContributor` file as follows: @@ -385,7 +388,7 @@ Update the namespaces in the `BookStoreMenuContributor` file as follows: + using Volo.Abp.OpenIddict.Pro.Web.Menus; ``` -Then, update the `ConfigureMainMenuAsync` method in this file as follows: +Then, we can update the `ConfigureMainMenuAsync` method in this file to specify the order of the menu items: ```csharp private Task ConfigureMainMenuAsync(MenuConfigurationContext context) @@ -420,15 +423,17 @@ private Task ConfigureMainMenuAsync(MenuConfigurationContext context) ### 4. Creating Migrations & Running Application -That's it, you have applied the all related steps to migrate your application from ABP Framework to ABP Commercial. Now, you can create a new migration, apply it to your database and run your application! +That's it, you have applied the all related steps to migrate your application from ABP Framework to ABP Commercial. Now, you can create a new migration, apply it to your database, and run your application! To create a new migration, open a terminal in your `*.EntityFrameworkCore` project directory, and run the following command: ```bash -dotnet ef migrations Migrated_To_ABP_Commercial +dotnet ef migrations add Migrated_To_ABP_Commercial ``` -Then, to apply the database into your database and seed the initial data, you can run the `DbMigrator` project. After it's completed, you can run the `*.Web` project to see your application as working. +Then, to apply the database into your database and seed the initial data, you can run the `*.DbMigrator` project. After it's completed, you can run the `*.Web` project to see your application as working. + +> **Note:** If you have an existing database, then creating a new migration and applying it to the database may not happen correctly. At that point, if it's possible you can drop the existing database and create a new one, or you can have a backup of your existing db, and after applying the new migration, you can synchronize the database with the backup. ## Consultancy From 1938a27a38591b81f7918e39594ad8d78023c1ac Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:43:28 +0300 Subject: [PATCH 06/11] Update docs-nav.json --- en/docs-nav.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/en/docs-nav.json b/en/docs-nav.json index 66c71cf2..2f29cf22 100644 --- a/en/docs-nav.json +++ b/en/docs-nav.json @@ -88,6 +88,10 @@ "text": "Customizing the Modules", "path": "guides/customizing-modules.md" }, + { + "text": "Migrating from ABP Framework", + "path": "migrating-from-open-source.md" + }, { "text": "Migrating to OpenIddict", "path": "migration-guides/openIddict-step-by-step.md" From 8923408f9137462117f5a2099bd384ced9ab3334 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:07:04 +0300 Subject: [PATCH 07/11] Update migrating-from-open-source.md --- en/migrating-from-open-source.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index e9abefcd..f81c69a5 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -12,9 +12,9 @@ There are 4 main steps to migrating from ABP Framework to ABP Commercial, and ea ### 1. License Transition -The first step is to obtain the necessary license for ABP Commercial to be able to get the benefit of the pro modules and unlock the additional features. To do that, you should first get your `AbpLicenseCode` and `ApiKey` from the [organization's detail page](https://commercial.abp.io/my-organizations). +The first step is to obtain the necessary license for ABP Commercial to be able to get the benefit of the pro modules and unlock the additional features. To do that, you should first get your `ApiKey` from the [organization's detail page](https://commercial.abp.io/my-organizations). -Then, you can update the **NuGet.Config** file in the root directory of your solution and add the *packageSource* as follows (don't forget to replace `` placeholder): +You can update the **NuGet.Config** file in the root directory of your solution and add the *packageSource* as follows (don't forget to replace `` placeholder): ```diff @@ -26,7 +26,7 @@ Then, you can update the **NuGet.Config** file in the root directory of your sol ``` -After that, you can open the `appsettings.json` files under the `*.DbMigrator` and `*.Domain` projects and add your `AbpLicenseCode`: +After that, you can obtain an `AbpLicenseCode` by creating a startup template and copying the code from the `appsettings.json` file. Then, you can open the `appsettings.json` files under the `*.DbMigrator` and `*.Domain` projects and add your `AbpLicenseCode`: ```json { @@ -437,4 +437,4 @@ Then, to apply the database into your database and seed the initial data, you ca ## Consultancy -If you find the migration process challenging or prefer professional assistance, we offer a [paid consultancy service](https://commercial.abp.io/additional-services). Our experienced consultants can help ensure a smooth transition to ABP Commercial, addressing any specific needs or challenges your project may encounter. For detailed guidance and support, feel free to [reach out](https://commercial.abp.io/contact)! \ No newline at end of file +If you find the migration process challenging or prefer professional assistance, we offer a [paid consultancy service](https://commercial.abp.io/additional-services). Our experienced consultants can help ensure a smooth transition to ABP Commercial, addressing any specific needs or challenges your project may encounter. For detailed guidance and support, feel free to [reach out](https://commercial.abp.io/contact). \ No newline at end of file From 096d99c1d895facadbbcda919bb67a315205ed8c Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Tue, 12 Mar 2024 17:43:08 +0300 Subject: [PATCH 08/11] Use appsettings.secrets.json --- en/migrating-from-open-source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index f81c69a5..538688af 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -26,7 +26,7 @@ You can update the **NuGet.Config** file in the root directory of your solution ``` -After that, you can obtain an `AbpLicenseCode` by creating a startup template and copying the code from the `appsettings.json` file. Then, you can open the `appsettings.json` files under the `*.DbMigrator` and `*.Domain` projects and add your `AbpLicenseCode`: +After that, you can obtain an `AbpLicenseCode` by creating a startup template and copying the code from the `appsettings.secrets.json` file. Then, you can open the `appsettings.secrets.json` files under the `*.DbMigrator` and `*.Domain` projects and add your `AbpLicenseCode`: ```json { @@ -437,4 +437,4 @@ Then, to apply the database into your database and seed the initial data, you ca ## Consultancy -If you find the migration process challenging or prefer professional assistance, we offer a [paid consultancy service](https://commercial.abp.io/additional-services). Our experienced consultants can help ensure a smooth transition to ABP Commercial, addressing any specific needs or challenges your project may encounter. For detailed guidance and support, feel free to [reach out](https://commercial.abp.io/contact). \ No newline at end of file +If you find the migration process challenging or prefer professional assistance, we offer a [paid consultancy service](https://commercial.abp.io/additional-services). Our experienced consultants can help ensure a smooth transition to ABP Commercial, addressing any specific needs or challenges your project may encounter. For detailed guidance and support, feel free to [reach out](https://commercial.abp.io/contact). From f356de3fb4fff3a82d7466f64d4d55999bb67ccb Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Tue, 12 Mar 2024 17:45:57 +0300 Subject: [PATCH 09/11] Add replacing npm packages section --- en/migrating-from-open-source.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index 538688af..a9b7d09d 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -421,6 +421,12 @@ private Task ConfigureMainMenuAsync(MenuConfigurationContext context) } ``` +Replace LeptonX Lite npm package with LeptonX package in `package.json` file: +```diff +- "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.0.3", ++ "@volo/abp.aspnetcore.mvc.ui.theme.leptonx": "~3.0.3", +``` + ### 4. Creating Migrations & Running Application That's it, you have applied the all related steps to migrate your application from ABP Framework to ABP Commercial. Now, you can create a new migration, apply it to your database, and run your application! From 7507df3539329c684507167804bf0e70211751ab Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Tue, 12 Mar 2024 17:47:46 +0300 Subject: [PATCH 10/11] Add namespace for SuiteTemplates; --- en/migrating-from-open-source.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index a9b7d09d..91dfc22b 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -70,6 +70,10 @@ So, open your `*Domain.csproj` file and add the line below (don't forget to repl Then, for the final step, you need to add the related `DependsOn` statement to the `*DomainModule.cs` file as follows: ```cs +using Volo.Abp.Commercial.SuiteTemplates; + +// ... + [DependsOn(typeof(VoloAbpCommercialSuiteTemplatesModule))] public class BookStoreDomainModule : AbpModule { From 32e640cff3dbc1db0e0a1bcb7461b9f928079799 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:13:45 +0300 Subject: [PATCH 11/11] Add mongodb section to the migrating-from-open-source docs. --- en/migrating-from-open-source.md | 37 ++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/en/migrating-from-open-source.md b/en/migrating-from-open-source.md index 91dfc22b..d60eec23 100644 --- a/en/migrating-from-open-source.md +++ b/en/migrating-from-open-source.md @@ -1,12 +1,19 @@ # Migrating From ABP Framework +````json +//[doc-params] +{ + "DB": ["EF", "Mongo"] +} +```` + This guide provides you a step-by-step guidance to migrating your existing application (that uses the ABP Framework) to ABP Commercial. Since ABP Commercial uses the main structure of the ABP Framework and is built on top of that, this process is pretty straightforward, you can apply the steps mentioned in each step and easily migrate your project to ABP Commercial. > After following this documentation, you should be able to migrate your project to ABP Commercial. However, if you have any problems or cannot migrate your project, we are providing paid consultancy, which you can find details at [https://commercial.abp.io/additional-services](https://commercial.abp.io/additional-services). On this page, you can find related pieces of information about our trainings, custom project development, and porting existing projects services, and you can fill-out the contact form, so we can reach out to you. ## ABP Commercial Migration Steps -In this guide, we assume that you have a middle-complex ABP based solution and want to migrate to ABP Commercial. Throughout this documentation, `Acme.BookStore` application will be used as a reference solution (example application that is described in ABP's tutorial documents), which you can find at [https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore) but all of these steps are applicable for your own applications, only some of them can be changed according to your project choose and structure. However, the migration flow is the same. +In this guide, we assume that you have a middle-complex ABP based solution and want to migrate to ABP Commercial. Throughout this documentation, `Acme.BookStore` application will be used as a reference solution (example application that is described in ABP's tutorial documents){{if DB == "EF"}}, which you can find at [https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore){{end}} but all of these steps are applicable for your own applications, only some of them can be changed according to your project choose and structure. However, the migration flow is the same. There are 4 main steps to migrating from ABP Framework to ABP Commercial, and each one of them is explained in the following sections, step-by-step and project-based: @@ -134,6 +141,8 @@ After removing the unnecessary references, we should update the namespaces in th + using Volo.Saas.Tenants; ``` +{{ if DB == "EF" }} + #### 3.3 - EntityFrameworkCore Project Remove the unnecessary references from the `*EntityFrameworkCore.csproj`: @@ -206,6 +215,30 @@ public class BookStoreDbContext : } ``` +{{ else }} + +#### 3.3 - MongoDB Project + +Remove the unnecessary references from the `*MongoDb.csproj`: + +```diff +- +- +- +``` + +Remove the unnecessary namespaces from `*MongoDbModule.cs`: + +```diff +- using Volo.Abp.TenantManagement.MongoDb; + +- typeof(AbpIdentityMongoDbModule), +- typeof(AbpOpenIddictMongoDbModule), +- typeof(AbpTenantManagementMongoDbModule) +``` + +{{ end }} + #### 3.4 - Application.Contracts Project Remove the unnecessary references from the `*Application.Contracts.csproj`: @@ -435,7 +468,7 @@ Replace LeptonX Lite npm package with LeptonX package in `package.json` file: That's it, you have applied the all related steps to migrate your application from ABP Framework to ABP Commercial. Now, you can create a new migration, apply it to your database, and run your application! -To create a new migration, open a terminal in your `*.EntityFrameworkCore` project directory, and run the following command: +To create a new migration, open a terminal in your {{ if DB == "EF" }}`*.EntityFrameworkCore`{{else}}`*.MongoDb`{{end}} project directory, and run the following command: ```bash dotnet ef migrations add Migrated_To_ABP_Commercial