ProbmExporting Application to a separate Database in 2013-R2

thorjthorj Member Posts: 4
edited 2013-11-20 in NAV Three Tier
I have a problem exporting the NavApplication to a New Database, splitting a 2013-R2 Database into Tenant and Aplication Databases in a customized Database.
Exporting and Merging the standard Nav Database is working fine.

In Windows PowerShell I do the following :
Export-NAVApplication –DatabaseServer localhost –DatabaseName 'Customized Database' –DestinationDatabaseName NavApp

And get the error :
PS C:\Windows\system32> Export-NAVApplication –DatabaseServer localhost –Customized Database' –DestinationDatabaseName NavApp
Export-NAVApplication : The 'NavApp' database that is specified in the ApplicationDatabaseName, contains NAV application tables.
Please invoke 'Remove-NAVApplication -DatabaseName NavApp' to clean up application tables from the database.
At line:1 char:1
+ Export-NAVApplication –DatabaseServer localhost –DatabaseName 'Customized Database ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Export-NAVApplication], NavCommandException
+ FullyQualifiedErrorId : localhost,Microsoft.Dynamics.Nav.Management.Cmdlets.ExportNavApplication


PS C:\Windows\system32>

All objects compile and run normally.
Does anyone know what I need to do to make this work ?

Comments

  • benrbenr Member Posts: 11
    If your NavApp DB is truly empty, then you have probably hit a bug with the Export-NavApplication cmdlet where you have to have and identical filegroup structure in your destination database.

    In the SQL Server, manually create a new empty database that has the same filegroup structure as the Microsoft Dynamics NAV database from which you want to export application tables. The filegroup that is in addition to the PRIMARY filegroup must have the name Data Filegroup 1.

    Run the Export-NAVApplication cmdlet and use the new database as the destination database for the application.
  • thorjthorj Member Posts: 4
    Thank you benr.
    This did the trick. But in my case the "Data Filegroup 1" filegroup is the Default Filegroup in the Customized Database. Thus I needed to create one new File in the SQL, link it to the new filegroup to be able to make "Data Filegroup 1" the default in the NavApp.
    If the default Filegroups were different the cmdlet was able to create the tables in the new Database but ended in an error and did not finish.
  • soetiesoetie Member Posts: 61
    edited 2020-03-31
    Hi, have the same issue with 2016. Can you explain in more detail how did you fix this. Also with keeping the existing company data:

    database that is specified in the ApplicationDatabaseName, contains NAV application tables.
    Please invoke 'Remove-NAVApplication -DatabaseName 'database' to clean up application tables from the database.

    when i run that command (Remove-NAVApplication -DatabaseName) it just succeeds!
  • soetiesoetie Member Posts: 61
    nobody?
Sign In or Register to comment.