Missing database schema Commerce 14 and CMS 12

Vote:
 

Hello, I'm trying to setup CMS12 and Commerce14 on my machine. I've checked the requirements and I've correct prerequisites installed those were needed for setup.

So far I've followed each command mentioned on documentation 

dotnet-episerver create-cms-database ProjectName.csproj -S . -E
dotnet-episerver create-commerce-database ProjectName.csproj -S . -E --reuse-cms-user
dotnet-episerver add-admin-user ProjectName.csproj -u username -p password -e user@email.com -c EcfSqlConnection

It creates the databases but all blank. Except the admin user command creates identity tables in commerce database. 

running application via terminal gives below exception, Which I believe is because there is no schema on the database. This is all empty

Thanks for looking into this

#275970
Mar 09, 2022 14:13
Vote:
 

Documentation is outdated. You should be able to install new templates using

dotnet new -i Episerver.Templates

If you the run 

dotnet new --list epi

it should list new templates like this


You should then be able to create new commerce site by running the following steps

dotnet new epi-commerce-empty
dotnet run

Next step is navigating to /util/register to register admin user.

#276430
Mar 16, 2022 14:31
Manoj Kumawat - Mar 17, 2022 13:27
Thankyou Mari, This helped. I couldn't get this documented. Could you please share the link?
- Mar 17, 2022 13:29
I saw this demoed by Optimizely in a webinar. I will report to the documentation team that documentation needs to be updated.
Manoj Kumawat - Mar 17, 2022 13:37
Thanks Mari, that would be a great help to the community.
Vote:
 

Mari is correct about the updated templates...

But if you created an empty Commerce site from the old templates, you'll need to add another package:  System.Configuration.ConfigurationManager (version 5.0.0)

Run this command:

dotnet add "[PROJECTNAME].csproj" package System.Configuration.ConfigurationManager -v 5.0.0
#276440
Mar 16, 2022 16:32
Manoj Kumawat - Mar 17, 2022 13:38
Thanks Chris, This worked too.
Vote:
 

Apparently register user seems only working for cms site not commerce site. I received the following error when access to commerce catalog, did anyone encounter this issue?

   Access denied. Failed loading content with content link: -1073741823__CatalogContent
      EPiServer.Core.AccessDeniedException: Access was denied to content -1073741823__CatalogContent. You do not have access to see the versions for this item.

#276841
Mar 22, 2022 5:57
Scott Reed - Mar 22, 2022 16:56
add the user to the administrators role
Bartosz Sekula - Mar 23, 2022 11:07
WebAdmins (which is added by default) should be enough: https://github.com/episerver/content-templates/blob/develop/templates/Commerce.Empty/appsettings.Development.json#L25

Vincent, are you sure you run the migrations? /episerver/commerce/migrate
Scott Reed - Mar 23, 2022 11:09
Yes looks like the template is setup that way now. Our current project is using the defaults without any specific roles set which means Administrators.
Vincent - Mar 23, 2022 23:27
Thank you for all your help.

@Scott, the user registration page will add the my user "WebAdmin" role. I was in the wrong spot at the beginning.

The problem is when I first time run the site, there is no user, however the commerce migration step is also firing up and I get the following error message from my console log. The way to fix this is after I registered my first user, then manually navigate to /episerver/commerce/migrate to re-rerun the migration as @Bartosz pointed out.

fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMGD3SD7UTTG", Request id "0HMGD3SD7UTTG:00000001": An unhandled exception was thrown by the application.
EPiServer.Core.EPiServerException: There are incomplete migration steps. The site can be in unstable state. Please navigate to front-end site and complete remaining migration steps, then restart Commerce Manager site. If you see this message on the front-end site, it means no Catalog Content models (decorated with the CatalogContentType attribute) were found. Add a Catalog Content type, or set the appSetting 'episerver:SkipCatalogContentModelCheck' to true to bypass this check. Warning! Bypassing this check in the Commerce Manager site or other application which does not have the content model types available could lead to data loss!
at EPiServer.Commerce.Internal.Migration.RedirectingRequest.InitializeAsync()
at EPiServer.Middleware.InitializeOnFirstRequestMiddleware.StartFirstInitializers(HttpContext httpContext)
at EPiServer.Middleware.InitializeOnFirstRequestMiddleware.InvokeAsync(HttpContext httpContext)
at EPiServer.Framework.DependencyInjection.Internal.VisitorGroupMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Vote:
 

Hello. The documentation was updated yesterday (3/22/2022). I hope this addresses your issues.

https://world.optimizely.com/documentation/installing-episerver/

#277003
Mar 23, 2022 15:05
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.