Import Database From bacpac And bak File In SQL Server

Introduction

 
In this article we are going to discuss about importing the Database from bacpac & bak file from SQL Server in a step by step process.
 
Bak files are snapshots of entire Database as it existed at a point in time and Bacpac files are snapshots of how the Database existed over the period of time while the backup was made.
 
To perform this action we need to have SQL Server Express Edition for our local usage or we can do with any server storage where as I was performing in my local storage.
 
Here I am sharing the links to install and SSMS and SQL Server Express Edition.
  • SQL Server Express Edition - Visit the browser and Click on Download now under Express and install from that setup file.
  • SQL Server Management Studio - Visit the browser and Click on the Download SQL Server Management Studio (SSMS) under Download SSMS and install from that setup file.

.bak File Importing

 
Step 1
 
Open SSMS and click on Connect. as of now I am going with Windows Authentication, but if you have SQL Server authentication you can go with that one as well.
 
 
Step 2
 
First let us go with Bak File importing 
 
Right Click on Database - Click on Restore Database
 
 
Step 3
 
Check the Device Button and Click on .. Button to add the File 
 
 
Step 4
 
Click on Add Button, choose the Appropriate bak file and then click on Ok.
 
The Database has been created with respective tables or functions or Stored Procedures whcih are already presented at the time of generating the .bak file. Now let's see about bacpac file.
 

.bak File Importing

 
Step 1
 
Right Click on Database
 
Click on Import Data-tier Application
 
 
Click on Next Button.
 
Step 2
 
 
Add the bacpac file through Browse option and click on Next button.
 
Step 3
 
Add the Respective Database name of whatever you want as shown in the figure and Click on Next and a new database will be created with all necessary tables or functions or stored procedures.
 

Summary

 
In this article we have seen how to import  databases from particular file formats in a clear structured manner.  Also we learned to make sure we have proper file extensions like .bak and .bacpac file for importing.
 
I hope this article helps you.


Similar Articles