Navigation

Know How to Import SQL Server Database From One to Another

Know How to Import SQL Server Database From One to Another, Migrating by Backup & Restore, Move SQL database from one server to another

Introduction

Looking to import SQL Server database from one server to another ? Confused how to copy from one to another or which process method to use?
Here we will learn how to import data from one SQL Server database to another.
First let us understand what options you have to copy SQL Server database from one server to another.You can copy data from one SQL Server database to another by :
  • Copy Database Wizard
  • By Back & Restore
  • By detaching from old Server to new Server.
  • By SQL Database Migrator
Know How to Import SQL Server Database From One to Another

Let us understand these steps in brief:

Import data from one SQL Server Database to Another

By Detach & Attach:
You can import SQL Server database from one server to another by Detach/Attach method. For this follow the steps:
  • First you need to detach the database. For Detaching, Open SSMS, connect to the SQL Database Engine.
  • Expand the databases and select the name of the database you want to detach.
  • Right click on it --> Click on Tasks --> Detach. Pop up will come of Detach Database. Click Ok.
You can do this by T-SQL command also. You just need to run sp_detach_db command on the database.
  • In Command Prompt window, move the detached database file to the new location.
  • Now attach the copied database files. For attaching, Right click on the database and Click on Attach.
  • In Attach Database box, click on Add and in Locate Database Files box, select the drive where database is present and expand it to select the .mdf file.
Let us understand another method to import data from one SQL Server Database to Another. Now we will see Copy database by Backup & Restore.
Migrating by Backup & Restore
For importing database from one Server to another, you need to create new database first. The source and the destination can be any platform in which SQL Server runs.
  • First of all backup the source database on which SQL Server instance is running.
  • Connect to the instance of SQL Server in which you are planning to copy the database.
  • Now, restore the backup of the source database on destination computer. By restoring operation, you automatically create all the database files.
By Copy Database Wizard
For importing SQL Server database from one Server to another, you can do it by Copy database wizard method. For this;
  • Click on the Database you want to import from one SQL Server to another Server.
  • Right Click on it--> Tasks -->Copy Database Wizard.
  • The method requires Source and Destination credentials, enter it. And Select either Attach/ Detach or SMO type.
  • Click on Next and then Finish to execute.

Quick Import SQL Server database from one Server to another

One quick way to move SQL Server database from one to another is by using professional method ie SQL Database migration tool. The software migrates all SQL database objects from one to Server to another. Incase if your database is corrupted then the software helps it to repair it and then migrate it to another Server. You can move SQL database either in existing database or by creating a new one.
The steps are simple:
  1. Install and Open Database Migration Tool
  2. Click on Open and Load the MDF file
  3. Click on Advance scan and Choose the version either manually or by clicking on Auto-Detect.
  4. You will get the scanned report of the database items.
  5. Click on Export.
  6. You will get two option for exporting, either export as SQL Server Database or as .sql script.
  7. Under Database Authentication mode, Enter the IP of the Server in which you want to migrate the SQL Database. Select Windows Authentication Mode.
  8. You have option to export the database either in Existing or by creating a new one.
  9. Select the items you want to export and Select 'Schema & Data' option and Click Export.
Your database will get successfully get imported from one SQL Database to another.

Conclusion:

Get to know how to import SQL Server database from one Server to another. We have discussed various methods to move SQL Server Database from one to another. Make sure to carefully accomplish the task. We have also discussed a professional approach for all those users who want to import data from one SQL Server Database to Another quickly.
Share

andrew jackson

Outstanding journey in Microsoft Technologies (ASP.Net, C#, SQL Programming, WPF, Silverlight, WCF etc.), client side technologies AngularJS, KnockoutJS, Javascript, Ajax Calls, Json and Hybrid apps etc. I love to devote free time in writing, blogging, social networking and adventurous life

Post A Comment:

0 comments: