web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

BC On-Premises - Create New Database from Powershell

(0) ShareShare
ReportReport
Posted on by

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
    toLL Profile Picture
    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.

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

    Thanks for update.

  • Suggested answer
    Saurav.Dhyani Profile Picture
    on at
    RE: BC On-Premises - Create New Database from Powershell

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans