C:\WINDOWS\system32> New-NAVDatabase -FilePath C:\Dynamics.90.W1.42815.DVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\90\Database\Demo Database N
AV(9-0).bak -DatabaseName NavBase -DatabaseServer RAYMUNDO\NAVDEMO
New-NAVDatabase : A positional parameter cannot be found that accepts argument 'Dynamics'.
At line:1 char:1
+ New-NAVDatabase -FilePath C:\Dynamics.90.W1.42815.DVD\SQLDemoDatabase ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-NAVDatabase], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavDatabase
0
Answers
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
C:\WINDOWS\system32> New-NAVDatabase -FilePath 'C:\DynamicsNAVW116\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft
Dynamics NAV\90\Database\Demo Database NAV (9-0).bak' -DatabaseName MyNavOriginal -DatabaseServer RAYMUNDO\NAVDEMO
New-NAVDatabase : Database restore operation failed due to the following error returned by SQL Server:
Directory lookup for the file "S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV (9-0)_Data.mdf" failed with the
operating system error 3(The system cannot find the path specified.).
File 'Demo Database NAV (9-0)_Data' cannot be restored to 'S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV
(9-0)_Data.mdf'. Use WITH MOVE to identify a valid location for the file.
Directory lookup for the file "S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV (9-0)_Log.ldf" failed with the
operating system error 3(The system cannot find the path specified.).
File 'Demo Database NAV (9-0)_Log' cannot be restored to 'S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV
(9-0)_Log.ldf'. Use WITH MOVE to identify a valid location for the file.
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
RESTORE DATABASE is terminating abnormally.
At line:1 char:1
+ New-NAVDatabase -FilePath 'C:\DynamicsNAVW116\SQLDemoDatabase\CommonA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [New-NAVDatabase], NavCommandException
+ FullyQualifiedErrorId : RAYMUNDO\NAVDEMO,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavDatabase
Can u suggest me,passing value to the parameters?
-DatabaseInstance =
-DatabaseServer =
-ServiceAccount =
Thanks in advance
DatabaseInstance is the name of the SQL Server instance (probably: NAVDEMO )
ServiceAccount is the name of the account that is running the SQL Server service; you probably can forget this parameter.
DatabaseInstance - You can check it in Services.msc
Database Sever: The name of your PC(Server)
Service Account: Varies.
What do you want to do? Do you want to restore the database from .bak file??
If yes then
-Get the bak file and restore it from SQL Management studio.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
New-NAVDatabase : The device is not ready.
I don't know about NAV2016, but in the NAV2017 version the New-NAVDatabase cmdlet has parameters to define where to create the database:
New-NAVDatabase -DestinationPath "x"
- or -
New-NAVDatabase -DataFilesDestinationPath "x" -LogFilesDestinationPath "y"
The first line sets the folder for datafiles and logfiles to a single location, with the second line you can set different locations for data files and log files.
Use just one of these lines.
Make sure that your SQL Server service account has access to the location you set.