Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy automatic Microsoft Dynamics NAV

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to deploy automatic Microsoft Dynamics NAV, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Background:

Customers will add a new Microsoft Dynamics NAV system under the following circumstances

-- create a new branch

-- create a new series of tests

-- start a new fiscal year

-- wait.

In the practice phase, a "new Microsoft Dynamics NAV system" can make a new Microsoft Dynamics NAV instance, a database, a company, or a tenant. To simplify the introduction, we reuse existing Microsoft Dynamics NAV Service to create our new database.

Preparatory work:

We use import-module sqlps. To import SQLServer's PowerShell. SQLPS is provided when you install SQLServer, but you can get the module without installing SQL.

If SQLSever is not installed on the machine running PS, you can install Microsoft SQL Server 2012Feature Pack at the following address:

Http://www.microsoft.com/en-us/download/details.aspx?id=29065

Here is the code

# preparation $MyNAVServerName = "DynamicsNAV80" $MySQLServerName = "." $MyNewCustomerName = "NewCustomer" $MyNewDatabaseName = "NewCustomerDatabase" Set-ExecutionPolicy unrestrictedimport-module "C:\ Program Files\ Microsoft DynamicsNAV\ 80\ Service\ NavAdminTool.ps1" Push-Location # jump back to standard prompt with pop-locationimport-module sqlps # ignore any warnings you may get#Restore SQL db (NAV demo db) # Relocate database files http://stackoverflow.com/questions/26400752/cannot-bind-relocatefile-when-using-restore-sqldatabase-cmdlet $mdf = New-Object Microsoft. SqlServer.Management.Smo.RelocateFile ("Demo Database NAV (8-0) _ Data" "C:\ Program Files\ Microsoft SQL Server\ MSSQL12.MSSQLSERVER\ MSSQL\ DATA\ DB_Data_$MyNewCustomerName.mdf") $ldf = New-Object Microsoft.SqlServer.Management.Smo.RelocateFile ("Demo Database NAV (8-0) _ Log" "C:\ Program Files\ Microsoft SQLServer\ MSSQL12.MSSQLSERVER\ MSSQL\ DATA\ DB_Log_$MyNewCustomerName.ldf") restore-SqlDatabase-ServerInstance $MySQLServerName `- Database $MyNewDatabaseName`-BackupFile "C:\ NAVDVD\ SQLDemoDatabase\ CommonAppData\ Microsoft\ Microsoft Dynamics NAV\ 80\ Database\ DemoDatabase NAV (8-0) .bak" ` -ReplaceDatabase `- RelocateFile @ ($mdf $ldf) # Set network service as dbo$CreateServiceAccountUser = "CREATE USER [NT AUTHORITY\ NETWORK SERVICE] FOR LOGIN [NT AUTHORITY\ NETWORK SERVICE]" Invoke-Sqlcmd-ServerInstance $MySQLServerName-Database $MyNewDatabaseName-Query $CreateServiceAccountUser$AddServiceAccountAsDbo = "exec sp_addrolemember 'db_owner',' NT AUTHORITY\ NETWORK SERVICE'" Invoke-Sqlcmd-ServerInstance $MySQLServerName-Database $MyNewDatabaseName-Query $AddServiceAccountAsDbopop-location # Finished with SQL commands so popping back to normal PS prompt#For NAV 2013 (R2) To convert the database to latest executable version.#For NAV 2015 we don't need this (in fact we don't have the Invoke-DatabaseConversion cmdlet). Import-module "C:\ PSscripts\ Upgrade\ Cmdlets\ NAVUpgradeCmdlets.psm1" Invoke-NAVDatabaseConversion-DatabaseServer localhost-DatabaseName "Demo Database NAV (7-1)"-FinSqlExeFile "C:\ Program Files\ Microsoft Dynamics NAV\ 71\ Service\ finsql.exe" # At this point the next steps depend on whether we want a new NAV Service, connect to an existing one Etc. Here we just reuse existing NAV Service#Configure then restart the service and get statusSet-NAVServerConfiguration $MyNAVServerName-KeyName DatabaseName-KeyValue $MyNewDatabaseName Set-NAVServerInstance $MyNAVServerName-restartGet-NAVServerInstance $MyNAVServerName and above are all the contents of the article "how to deploy automatic Microsoft Dynamics NAV" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report