Skip to main content

NAV 2013 R2 - How to Backup and Restore Selected companies CONCEPT.

Hi all,

The most awaited feature in NAV 2013 R2 by most of the consultants around the globe have been finally come as a work around. All Thanks to Microsoft Product Team.

In this post we will see the various ways of taking the Backup of the Database available in NAV 2013 R2 and in subsequent posts we will see how to take backup using Powershell and Windows Client.

** The NAV 2013 R2 Should Have the Build 7.1.36987.
** Uninstall the Previous Version of NAV 2013 R2 and install the latest build.

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

Post in this series -

1. The Concept (This Post).

Without Tenants -
2.   Backup Using Direct Connection to Database.            
3.   Backup Using Service Tier.                                        
4.   Backup Using Windows Client.                                  
5.   Restore Using Direct Connection to Database.          
6.   Restore Using Service Tier.                                      
7.   Restore Using Windows Client.                                

With Tenants - 



THEORY - 

In earlier versions of Microsoft Dynamics NAV, we could move or copy all or part of the data in a database by using the Microsoft Dynamics NAV backup functionality.

In Microsoft Dynamics NAV 2013 R2, the support for the .fbk files was removed.

But With Cumulative Update 8 for Microsoft Dynamics NAV 2013 R2, Microsoft introduce Windows PowerShell cmdlets so you can export data from a Microsoft Dynamics NAV database and import it into another Microsoft Dynamics NAV database. We can also export and import data in the Microsoft Dynamics NAV Windows client and the Microsoft Dynamics NAV Web client.

The Way Around for .bak have been released.

IMPORTANT THINGS TO REMEMBER- 

When we export data to a .navdata file, we must import the data into a database that is compatible with the data in the .navdata file.

For example, we cannot import a company into a database that has a different database schema, and you cannot import Microsoft Dynamics NAV 2013 data into a Microsoft Dynamics NAV 2013 R2 database.

Also, you must import a company into a database that contains the data and application that the company's data depends on. This means that you must import a company into a database that is based on the same application as in the database that the company was exported from.

What to Export - 

We can export specific sets of data, such as a company or other data. Below are the details of what is exported depending on your choices.

Company => Exports the specified company or companies, or all companies in the database. This includes the company-specific business data but no other data.

Global data => Exports data that is common to all companies in the database. This includes the report list, user IDs, and printer selections, but no company-specific business data.

Application data => Exports the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.

Application Exports => all application objects. Data is not included. This is similar to exporting all objects to an .fob file.


What to Import - 

We can import all data from a .navdata file, or you can choose the data that you want to import.

For example, if the file contains four companies, you can choose to import only one company. Similarly, if the file contains all data, you can choose to import only global data, for example. To import applications, you must use the Import-NAVData Windows PowerShell cmdlet.

You can import other data, such as companies, in the Microsoft Dynamics NAV Windows client and the Microsoft Dynamics NAV Web client. You can export and import the four types of data in different combinations. However, you must maintain database integrity and not leave databases in a state when you cannot open Microsoft Dynamics NAV.

Windows PowerShell Cmdlets - 

You can import and export companies and data in the Microsoft Dynamics NAV 2013 R2 Administration Shell. The cmdlets take different parameter sets depending on how you connect to the database that you want to export data from or import data into. You can access the database through the Microsoft Dynamics NAV Server instance, or you can access the database directly as described in the following table.

Access => Through the Microsoft Dynamics NAV Server instance =>

Use Parameter sets that include –ServerInstance when the database that you want to access is mounted against a Microsoft Dynamics NAV Server instance. The user account for the Microsoft Dynamics NAV Server instance must have access to write to the location that is specified by the –FileName parameter.

Access => Through a direct connection to the database =>

Use parameter sets that include –DatabaseServer and –DatabaseName when the Microsoft Dynamics NAV Server instance is stopped or not available. For example, if you want to import an updated application into a database, you stop the service so that users cannot access the database. You must have access to write to the location that is specified by the –FileName parameter.

In multitenant deployments of Microsoft Dynamics NAV, if you export or import business data, you must specify the ID of the tenant database. If you export or import applications, you must specify the application database and database server. You can only import application data if the specified tenant is mounted with the –AllowAppDatabaseWrite parameter.

C/AL Functions You can use the following C/AL functions to handle export and import of data programmatically:

EXPORTDATA Function (Database) 
IMPORTDATA Function (Database) 
DATAFILEINFORMATION Function (Database) 

We start tomorrow morning with database backup using direct connection to database and will continue the series in multiple posts to make it easy to understand.

Stay tuned for more.

Regards,
Saurav Dhyani
saurav-nav.blogspot.com

Comments

Popular posts from this blog

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.