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 ?
0
Comments
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.
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.
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!