How change sql database in BC Container?

Pashkovskiy
Member Posts: 3
Hello.
I have BC18 Container that use standard CRONUS database. I restored one more database. And now how can I change from CRONUS to new one?
I have BC18 Container that use standard CRONUS database. I restored one more database. And now how can I change from CRONUS to new one?
1
Answers
-
Have you restored the database in the SQL Express inside the container or have you restored the database on a other SQL instance?
If you have restored the database inside the container, you can just change the database name in the service tier with powershell.
Enter-navcontainer -containername xxxxx
Set-NAVServerConfiguration -ServerInstance xxxxx-KeyName DatabaseName -KeyValue xxxxx
restart-NAVServerInstance -ServerInstance xxx
if your have restored the database outside the container the you can just recreate your container pointing to your host SQL with:
new-navcontainer -databaseServer xxxxx
-databaseInstance xxxxx
-databaseName xxxxx
-databaseCredential xxxxxFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.1 -
Have you restored the database in the SQL Express inside the container or have you restored the database on a other SQL instance?
If you have restored the database inside the container, you can just change the database name in the service tier with powershell.
Enter-navcontainer -containername xxxxx
Set-NAVServerConfiguration -ServerInstance xxxxx-KeyName DatabaseName -KeyValue xxxxx
restart-NAVServerInstance -ServerInstance xxx
if your have restored the database outside the container the you can just recreate your container pointing to your host SQL with:
new-navcontainer -databaseServer xxxxx
-databaseInstance xxxxx
-databaseName xxxxx
-databaseCredential xxxxx
Thanks.
I restored inside the container.
For some reason powershell doesn't recognize commands Set-NAVServerConfiguration and restart-NAVServerInstance. But in the same time I can find them in the list of available commands. Strange.
1 -
Have you restored the database in the SQL Express inside the container or have you restored the database on a other SQL instance?
If you have restored the database inside the container, you can just change the database name in the service tier with powershell.
Enter-navcontainer -containername xxxxx
Set-NAVServerConfiguration -ServerInstance xxxxx-KeyName DatabaseName -KeyValue xxxxx
restart-NAVServerInstance -ServerInstance xxx
if your have restored the database outside the container the you can just recreate your container pointing to your host SQL with:
new-navcontainer -databaseServer xxxxx
-databaseInstance xxxxx
-databaseName xxxxx
-databaseCredential xxxxx
I have done it, but now I can't enter the web client and I can't download symbols in VS Code.
After that I tried to create new user in shell and I got error "The tenant 'Default' is not mounted or does not exist.":
$credentials = New-Object pscredential 'xxxx', (ConvertTo-SecureString -String 'xxxx' -AsPlainText -Force)
New-BcContainerBcUser -Credential $credentials -assignPremiumPlan -containerName "xxxxxxxx" -PermissionSetId super -tenant xxxxx
Any ideas?0 -
Are your database you are restoring a multi tenant database?
Per. default containers created with new-bccontainer are multitenant.
If the database you have restored is not configured as a multitenant DB the you cannot mix the databases.
On your new-bccontainer you can specify that the container is -multitenant:$false.
Why are you restoring a database inside of a container? It is way faster to use the host SQL instance and your passed parameters to the container to use the DB found in the host?For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions