check tenant db
This commit is contained in:
Родитель
38bb68e9db
Коммит
bbf032922c
|
@ -28,11 +28,11 @@ function Get-MyFilePath([string]$FileName)
|
|||
|
||||
$installFromArtifacts = ($appArtifactPath -ne "" -and $platformArtifactPath -ne "")
|
||||
if ($installFromArtifacts) {
|
||||
Write-Host "Install from artifacts"
|
||||
Write-Host "Installing from artifacts"
|
||||
$navDvdPath = $platformArtifactPath
|
||||
}
|
||||
else {
|
||||
Write-Host "Install from DVD"
|
||||
Write-Host "Installing from DVD"
|
||||
}
|
||||
|
||||
if (!(Test-Path $navDvdPath -PathType Container)) {
|
||||
|
@ -257,7 +257,7 @@ $customConfig.SelectSingleNode("//appSettings/add[@key='SOAPServicesPort']").Val
|
|||
$customConfig.SelectSingleNode("//appSettings/add[@key='ODataServicesPort']").Value = "7048"
|
||||
$customConfig.SelectSingleNode("//appSettings/add[@key='DeveloperServicesPort']").Value = "7049"
|
||||
$customConfig.SelectSingleNode("//appSettings/add[@key='DefaultClient']").Value = "Web"
|
||||
$customConfig.SelectSingleNode("//appSettings/add[@key='Multitenant']").Value = "$multitenant"
|
||||
$customConfig.SelectSingleNode("//appSettings/add[@key='Multitenant']").Value = "$multitenant"
|
||||
$taskSchedulerKeyExists = ($customConfig.SelectSingleNode("//appSettings/add[@key='EnableTaskScheduler']") -ne $null)
|
||||
if ($taskSchedulerKeyExists) {
|
||||
$customConfig.SelectSingleNode("//appSettings/add[@key='EnableTaskScheduler']").Value = "false"
|
||||
|
@ -295,16 +295,16 @@ if (!$skipDb -and ($multitenant -or $installOnly -or $licenseFilePath -ne "" -or
|
|||
}
|
||||
|
||||
if ($multitenant) {
|
||||
Copy-NavDatabase -SourceDatabaseName "tenant" -DestinationDatabaseName "default"
|
||||
Copy-NavDatabase -SourceDatabaseName "tenant" -DestinationDatabaseName "default"
|
||||
Write-Host "Mounting tenant database"
|
||||
Mount-NavDatabase -ServerInstance $ServerInstance -TenantId "default" -DatabaseName "default"
|
||||
Mount-NavDatabase -ServerInstance $ServerInstance -TenantId "default" -DatabaseName "default"
|
||||
$startTime = [DateTime]::Now
|
||||
while ([DateTime]::Now.Subtract($startTime).TotalSeconds -le 60) {
|
||||
$tenantInfo = Get-NAVTenant -ServerInstance $ServerInstance -Tenant "default"
|
||||
if ($tenantInfo.State -eq "Operational") { break }
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
Write-Host "Tenant is $($TenantInfo.State)"
|
||||
while ([DateTime]::Now.Subtract($startTime).TotalSeconds -le 60) {
|
||||
$tenantInfo = Get-NAVTenant -ServerInstance $ServerInstance -Tenant "default"
|
||||
if ($tenantInfo.State -eq "Operational") { break }
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
Write-Host "Tenant is $($TenantInfo.State)"
|
||||
}
|
||||
|
||||
Write-Host "Stopping Business Central Service Tier"
|
||||
|
|
|
@ -145,7 +145,7 @@ if ($restartingInstance) {
|
|||
|
||||
} elseif ($databaseServer -eq "localhost" -and $databaseInstance -eq "SQLEXPRESS" -and $multitenant) {
|
||||
|
||||
if (!(Test-NavDatabase -DatabaseName $databaseName)) {
|
||||
if (!(Test-NavDatabase -DatabaseName "tenant")) {
|
||||
Copy-NavDatabase -SourceDatabaseName $databaseName -DestinationDatabaseName "tenant"
|
||||
Remove-NavDatabase -DatabaseName $databaseName
|
||||
Write-Host "Exporting Application to $DatabaseName"
|
||||
|
|
Загрузка…
Ссылка в новой задаче