I m getting an error,during creating a new database from Power Shell...

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

Best Answers

Answers

  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    Use Quotes around the 'FilePath' parameter.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • SuDSuD Member Posts: 102
    Now i m getting another error,saying
    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
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    It is saying file is not located on the path you have provided.

    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.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • SuDSuD Member Posts: 102
    DatabaseServer is the name of your SQL server (probably: RAYMUNDO )
    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.

    New-NAVDatabase : The device is not ready.
Sign In or Register to comment.