Skip to main content

NAV 2013 R2 - How to Backup Selected companies With Multi-Tenancy - Powershell (Using Direct Database & Service Tier)

Hi all,

In this post we will list down the steps to take backup using power shell Using Direct Database & Service Instance For a MultiTenant Database.

UPDATE - IF you face issues of Schema During This Process Please refer the Post Here for Issue Resolution.

If you haven't read the Previous post, please refer to Index of Posts.

Below is the Details of my MultiTenant Service -





And Below is the List of Companies in Each Tenant -



As we all alreday Know that below listed option are avilable in Export-NAVData Command-let -

1. UseDatabase_AllCompanies
2. UseDatabase_SomeCompanies
3. UseNST_AllCompanies
4. UseNST_SomeCompanies

1 & 2 can be used either the server instance is stopped or not available. [Direct Database]
3 & 4 will only be used if the server instance is running. [Navision Service Tier]

In the Post we will See 2 & 4 as (1 & 3 are similar to SQL Backup).

2. UseDatabase_SomeCompanies

Below are parameters of the command-lets 2 -

1.  Database Name - The Database name from which you want to backup.
2.  File Name - The File Path and name where you want to store the backup (ends with Extension => .navdata).
3.  ApplicationDatabaseName - The Name of Database which Contain Only Application Objects.
4.  ApplicationDatabaseServer - The Name of Database Server Where the Application Database Exist.
5.  CompanyName - Name of Company you want to backup (if multiple put them as comma separated).
    * Multi Character Name should be in ''.
6.  Database Server - Server Name where the database is placed.
7.  Description - Description to file that you want to give.
8.  Include Application - Want application objects or not.
9.  Include Application Data - Want  data that defines the application in the database.
10. Include Global Data - Want Data conman to all companies or not.

As shown below is the parameters set for the backup.



Below is the command generated for the all comapnies backup.
-------------------------------------------------------------------------
Export-NAVData -DatabaseName MyTenant1 -FileName C:\Tenant1_CompanyA_B_Backup.navadata -ApplicationDatabaseName MultiTenant_Application_Database -ApplicationDatabaseServer INDEL-SXD6995NB -CompanyName A,B -DatabaseServer INDEL-SXD6995NB -Description "Two Companies backup Using Direct DB Connection." -Force
-------------------------------------------------------------------------
Run the command and backup will be placed as shown below.


4. UseNST_SomeCompanies

* Remember the Service Instance Should be Running and Available.
* In this script we skip the application objects and global data.

Below are parameters of the command-lets 4 -

1.  File Name - The File Path and name where you want to store the backup (ends with Extension => .navdata).
2.  ServerInstance - Service Name which is connected to Database which we want to backup.
3.  CompanyName - Name of Company you want to backup (if multiple put them as comma separated).
    * Multi Character Name should be in ''.
4.  Description - Description to file that you want to give.
5.  Include Application - Want application objects or not.
6.  Include Application Data - Want  data that defines the application in the database.
7.  Include Global Data - Want Data common to all companies or not.
8.  Tenant - The Name of Tenant on which Company Listed Above Resides.

As shown below is the parameters set for the backup.



Below is the command generated for the all companies backup.
-------------------------------------------------------------------------
Export-NAVData -FileName C:\Tenant1_Company_C_Backup.navadata -ServerInstance MultiTenantBackup -CompanyName C -Description "Backup From Service Instance of Tenant." -Force -Tenant MyTenant1
-------------------------------------------------------------------------
Run the command and backup will be placed as shown below.



I hope you are able to understand the concept discussed above. In Next post we will see how to Restore these Backups in a MultiTenant Environment.

Regards,
Saurav Dhyani
saurav-nav.blogspot.com

Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.

Error After Restore SQL Backup of NAV 2013 Database

Hi all, we are facing a conman issue during restoring a SQL Database backup restored for NAV 2013. While Trying to run object from Object Designer we get below listed error (even the service is configured properly) - --------------------------- Microsoft Dynamics NAV Development Environment --------------------------- There are no NAV Server instances available for this database. You must ensure that a NAV Server instance is running and is configured to use the database before you perform this activity. --------------------------- OK    ---------------------------