How to Back Up and Restore a Dynamics NAV 2015 Database Using SQL and PowerShell:



Similar documents
Backup / migration of a Coffalyser.Net database

InformationNOW SQL 2005 Database Backup and Restoration

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

SELF SERVICE RESET PASSWORD MANAGEMENT BACKUP GUIDE

Introduction. There are several bits of information that must be moved:

Upgrading from MSDE to SQL Server 2005 Express Edition with Advanced Services SP2

SharePoint 2010 Backup and Restore Using Central Administrator & Powershell

Technical Bulletin. SQL Express Backup Utility

If you have questions or need assistance, contact PCS Technical Services using the contact information on page 10.

Restoring Sage Data Sage 200

How To Upgrade Your Microsoft SQL Server for Accounting CS Version

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

Server Installation: ServerTools

How to Create a Delegated Administrator User Role / To create a Delegated Administrator user role Page 1

1. CONFIGURING REMOTE ACCESS TO SQL SERVER EXPRESS

InformationNOW SQL 2008 Database Backup and Restoration

Moving the Web Security Log Database

Configuring Your Firewall for Client Access in Professional Edition

SmartBar for MS CRM 2013

Upgrading LytecMD from to 9.4 on Windows Server Best Practices. Revision Date: 7/29/2010 PLEASE READ:

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

How to Backup and FTP your SQL database using E2.

Buffalo Technology: Migrating your data to Windows Storage Server 2012 R2

Upgrading a computer to Windows 10 with PetLinx

Installing SQL Express. For CribMaster 9.2 and Later

Preparing an IIS Server for EmpowerID installation

TECHNICAL NOTE. The following information is provided as a service to our users, customers, and distributors.

QUANTIFY INSTALLATION GUIDE

Error: "Object reference not set to an instance of an object" When Opening Any Database

Moving the TRITON Reporting Databases

Welcome to the QuickStart Guide

Print Manager Plus 2010 How to Migrate your Database to a New SQL or Print Server

1 INTRODUCTION 2 INSTALLATION PLANNING 2.1 MINIMUM HARDWARE REQUIREMENTS 2.2 SOFTWARE REQUIREMENTS

Backing Up and Restoring Microsoft Exchange Server Cloud Attached Storage. August 2012 Version 3.2

Microsoft SQLServer Restore / Redirected Restore Procedure

Print Audit 6 - SQL Server 2005 Express Edition

Avatier Identity Management Suite

BSDI Advanced Fitness & Wellness Software

How To Install A New Database On A 2008 R2 System With A New Version Of Aql Server 2008 R 2 On A Windows Xp Server 2008 (Windows) R2 (Windows Xp) (Windows 8) (Powerpoint) (Mysql

Updates Click to check for a newer version of the CD Press next and confirm the disc burner selection before pressing finish.

for Networks Installation Guide for the application on a server September 2015 (GUIDE 2) Memory Booster version 1.3-N and later

The FTP Monitor application performs the following main functions:

DSS Support Backup / Restore DSS Databases using Windows Backup Windows XP Windows 2003 Server

This module explains the Microsoft Dynamics NAV architecture and its core components.

GO!NotifyLink. Database Maintenance. GO!NotifyLink Database Maintenance 1

Juris Installation / Upgrade Guide

Linko Software Express Edition Typical Installation Guide

Dream Report Version 4.5

Configuration Guide. Remote Backups How-To Guide. Overview

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

SlimDrivers User Manual

SharePoint Backup Guide

How to protect, restore and recover SQL 2005 and SQL 2008 Databases

Nintex Workflow 2010 Installation Guide. Installation Guide Nintex USA LLC, All rights reserved. Errors and omissions excepted.

Exchange Server Backup and Restore

Important Notes for WinConnect Server VS Software Installation:

Monitoring SQL Server with Microsoft Operations Manager 2005

Ocularis. Configuration Database Backup. For migration, redundancy, and preservation On-Net Surveillance Systems Inc.

SQL Server 2008 R2 Express Edition Installation Guide

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

SECURE USER GUIDE OUTLOOK 2000

SQL Express to SQL Server Database Migration Goliath Performance Monitor v11.5

Database Backup Datacolor Match Pigment and Datacolor Tools

How To Run Eve 5 On A Pc Or Mac Or Ipad (For Pc Or Ipa) On A Network (For Mac) On Your Computer Or Ipro (For Ipro) On An Ipro Or Ipo (For Windows)

MyNetFone Virtual Fax. Virtual Fax Installation

Published. Technical Bulletin: Use and Configuration of Quanterix Database Backup Scripts 1. PURPOSE 2. REFERENCES 3.

Online Backup and Recovery Manager Setup for Microsoft Windows.

Moving PCLaw Data to Another Location (For LexisNexis PCLaw TM version 8.20 and higher)

Notes Transfer instructions INTRODUCTION More information

Migrating helpdesk to a new server

TM Online Storage: StorageSync

Fax and SMS Quickguide

Table of Contents. RFMS SQL Backup

Setup and configuration for Intelicode. SQL Server Express

Quick Start Guide. User Manual. 1 March 2012

Table of Contents. CHAPTER 1 About This Guide CHAPTER 2 Introduction CHAPTER 3 Database Backup and Restoration... 15

Migrating MSDE to Microsoft SQL 2008 R2 Express

Adding Outlook to a Blackberry, Downloading, Installing and Configuring Blackberry Desktop Manager

Interfacing PC ChargePayment Server with Focus

Upgrade Guide BES12. Version 12.1

Tournament Pairing Program Installation Instructions for Windows 7

SSO Plugin. J System Solutions. Upgrading SSO Plugin 3x to 4x - BMC AR System & Mid Tier.

REDUCING YOUR MICROSOFT OUTLOOK MAILBOX SIZE

How To Restore Your From Backup On An Exchange Service Pack 1 On A Windows (Windows 7) On A Microsoft Powerbook (Windows) On An Ubuntu 2003 Power

Getting started with 2c8 plugin for Microsoft Sharepoint Server 2010

1.0 Doors.Net Database Backup Microsoft SQL Server 2005 Studio Express

Upgrading MySQL from 32-bit to 64-bit

Moving a CIMPLICITY SQL Database using Detach/Attach Proficy HMI/SCADA CIMPLICITY

Migrating Mobile Security for Enterprise (TMMS) 8.0 to version 9.0

How To Restore Your Data On A Backup By Mozy (Windows) On A Pc Or Macbook Or Macintosh (Windows 2) On Your Computer Or Mac) On An Pc Or Ipad (Windows 3) On Pc Or Pc Or Micro

Backing Up CNG SAFE Version 6.0

Configuring Jet Express for Microsoft Dynamics NAV 2013

Installing and Trouble-Shooting SmartSystems

Getting Started Guide

BackupAssist v6 quickstart guide

Portions of this product were created using LEADTOOLS LEAD Technologies, Inc. ALL RIGHTS RESERVED.

Click Studios. Passwordstate. Password Discovery, Reset and Validation. Requirements

SonicWALL CDP 5.0 Microsoft Exchange InfoStore Backup and Restore

Transcription:

How to Back Up and Restore a Dynamics NAV 2015 Database Using SQL and PowerShell: Prerequisite: NAV Server Instance: In these instructions, I do not cover how to configure a NAV Server Instances. However, in order for the following instructions to work, it is necessary to have a separate NAV Server Instance dedicated to the testing database/environment. The testing environment's NAV Server Instance needs to be configured properly, and you'll need to know a few of its specific configurations in order to setup the cmdlets explained below. Specifically, you'll need to know the Database Server and Database Name values. This information can be found within the Microsoft Dynamics NAV 2015 Administration application. The name of the testing database used in the following example is TPC NAV Staging. High Level Steps - How to Back Up and Restore a Dynamics NAV 2015 Database: In SQL, create a backup of the production NAV Database In SQL, delete the database you want to replace (if you're replacing an existing database) In PowerShell, restore the backup, using the New-NAVDatabase cmdlet In Microsoft Dynamics NAV 2015 Administration, restart the NAV Service In PowerShell, rename the NAV Companies, as appropriate, using the Rename-NAVCompany cmdlet Optional Step: in NAV, in the new testing database NAV Companies, change the System Indicator options on the Company Information setup page Detailed Steps - How to Create a NAV Database Backup Using SQL: Because the PowerShell restore process requires a.bak file, I'll first show you how to create this backup file using SQL. 1. Open SQL Server Management Studio a. Right click on your production database b. Focus on the Tasks menu option c. Click on the Back Up menu option The navigation path is shown in the following screenshot.

2. Back Up Database Window: From the General page, I configure the backup as shown in the following screenshot. a. Note that you may need to use the Add / Remove buttons to specify a unique file name and path for the new.bak file you'll create. i. Important: Make note of the file path used in the Destination section, as you'll need it when constructing your PowerShell cmdlet later in the process (or better yet, just copy/past it somewhere so you've got exactly what you'll need later) b. When you're ready to create the backup file, click on the OK button. c. After the back up process is finished, you now have the.bak file needed for the PowerShell restore.

3. If replacing an existing testing database, delete that database. a. To do this, open SQL Server Management Studio and do the following: i. Right click on the testing database ii. Click on the Delete menu option The navigation path is shown in the following screenshot.

a. Delete Object Window: From the General page, I configure the delete process as shown in the following screenshot. When you're ready, click OK.

Detailed Steps - How to Restore a NAV Database Using PowerShell: NOTE: For cmdlets on items 1-3 provided below, you can simply copy and paste them into PowerShell, and run them. Cmdlets shown in items 4 and 6 need to be configured with specific data like your NAV Server Instance, Server Name, Database Name, file paths, etc. 1. Open Windows PowerShell ISE. a. Note: You'll need to run PowerShell as an administrator. One way to do this is to hold down the Shift key, right click the PowerShell icon, and selecting the 'Run as administrator' option. Answer 'Yes' to any prompts that are presented. 2. If PowerShell has never been used before, you'll need to run through the following one time setup. You'll need to answer 'Yes' to the warning/prompt that is presented. a. Run the following cmdlet: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser b. Run the following cmdlet to see if your previous cmdlet worked properly. Get-ExecutionPolicy -List If the initial cmdlet worked properly, PowerShell will present the following information, stating that the CurrentUser ExecutionPolicy = RemoteSigned

1. Next, you need to load the NAV administration cmdlets into PowerShell by executing the following cmdlets. a. Note: You'll need to run these two import cmdlets every time you open PowerShell, as PowerShell does not save these cmdlets. b. Note: The file location paths used in the cmdlets below are the default file location paths used when installing NAV. It's possible that these files might be in a different location, but check these file paths first. Import-Module 'C:\Program Files\Microsoft Dynamics NAV\80\service\NAVAdminTool.ps1' -Verbose Import-Module 'C:\Program Files (x86)\microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -Verbose 3. In PowerShell, create the restored database by run the following cmdlet: New-NAVDatabase. a. Example cmdlet: New-NAVDatabase -DatabaseName "TPC NAV Staging" -FilePath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\Prod Backup 5.20.15" - DatabaseServer SERVERNAME -DestinationPath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\Staging DATA" -Timeout 5000 -verbose NOTES: -DatabaseName this is the name of the database you'll create. This value needs to match the Database Name value specified in the NAV Server Instance you want to use for running this separate database. -FilePath this is the file path that specifies the exact location of the.bak file you're trying to restore. -DatabaseServer this is the address of the server to which you're trying to restore the database. -DestinationPath this is the file location (on the -DatabaseServer) where you'll be putting the new database. 4. In the Microsoft Dynamics NAV 2015 Administration application, restart the NAV Server Instance that's associated to the new NAV database. This step is not strictly needed, but it's solved problems I've run into before, so I've included it in my standard process. a. Highlight your NAV Server Instance and run the Restart option.

6. In PowerShell, rename the appropriate NAV Companies by using the following cmdlet: Rename- NAVCompany. This step is to help users easily distinguish between the production database and the testing database. a. Example cmdlet: Rename-NAVCompany -CompanyName TPC -NewCompanyName "TPC - Staging" - ServerInstance NAV80Staging -verbose NOTES: -CompanyName this is the name of the NAV Company you want to rename, as it existed in the production database. In the example above, the Company name is as follows: TPC -NewCompanyName this is the new name you want your NAV Company to have. In the example above, the new Company name is as follows: TPC - Staging -ServerInstance this is the name of the NAV Server Instance associated to the testing database you've setup 7. Optional Setup: In NAV, you can use the Company Information page's System Indicator Style field to change the color of the system indicator bar displayed at the top right of all NAV pages. I use this to make it easy for users to differentiate their production and testing databases. When the System Indicator Style field is set to 'Accent2,' the System Indicator is shaded blue, as show below. In my testing database, I set the value to 'Accent1,' which makes the System Indicator red. I like to do this, because it's an easy way for users to know if they're in the production or testing database. If it's blue, they're in production. If it's red, they're in testing.