Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

BC On-Premises - Create New Database from Powershell

Posted on by 305

Hi,

I try to deploy BC On-Prem 2022 release wave 1 CU12. For some technical reasons I'm not able to restore a Demo Database in our environment. So I'm following instructions found on MS site: Creating Databases in Business Central

I installed all BC Components. Then I created the database

New-NAVApplicationDatabase -DatabaseServer 'SQLSERVER\SQLINSTANCE' -DatabaseName 'PRODUCTION' -Collation Polish_100_CS_AS
Set-NAVServerConfiguration -ServerInstance 'BC_Service' -KeyName DatabaseName -KeyValue 'PRODUCTION'

db_owner privileges granted to BC Service Account.

I can start the BC Service without any errors.

Next I executed following commands

Set-NAVApplication -ServerInstance 'BC_Service' -ApplicationVersion 20.0.54861 -Force
New-NAVCompany -ServerInstance 'BC_Service' -CompanyName 'Company' -CompanyDisplayName 'Company Name' 
Sync-NAVTenant -ServerInstance 'BC_Service' -Mode ForceSync -Verbose 

I restarted the BC Service. When I try to open BC an error occures: The metadata object Page 0 was not found.

So I tried to install all the system apps, even if MS is saying "For Business Central 2021 release wave 1 and later, you don't have to publish the symbols, because they've been automatically published for you.".

Publish-NAVApp -ServerInstance 'BC_Service' -Path 'C:\DVD\Applications\system application\source\Microsoft_System Application.app' -Verbose
Publish-NAVApp -ServerInstance 'BC_Service' -Path 'C:\DVD\Applications\BaseApp\Source\Microsoft_Base Application.app' -Verbose
Publish-NAVApp -ServerInstance 'BC_Service' -Path 'C:\DVD\Applications\Application\Source\Microsoft_Application.app' -Verbose

I ran Sync-NAVTenant, Sync-NAVApp and restarted the BC Service several times, no luck, still same error The metadata object Page 0 was not found.

In SSMS I can see all the SQL Tables and Views were created successfully.

Am I missing something? How to create and deploy new empty BC On-Prem Database?

  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 17,965 Super User 2024 Season 2 on at
    RE: BC On-Premises - Create New Database from Powershell

    Hope this helps.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: BC On-Premises - Create New Database from Powershell

    Thanks for update.

  • Suggested answer
    toLL Profile Picture
    toLL 305 on at
    RE: BC On-Premises - Create New Database from Powershell

    I forgot to run

    Install-NAVApp -ServerInstance 'BC_Service' -Name 'System Application' -SyncMode ForceSync -Verbose

    it works now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans