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
Let us understand these steps in brief:
Import data from one SQL Server Database from one Server to Another
By Detach & Attach:
You can move SQL Database from one to another database 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 SQL Server database to another Server. 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:
- Install and Open Database Migration Tool
- Click on Open and Load the MDF file
- Click on Advance scan and Choose the version either manually or by clicking on Auto-Detect.
- You will get the scanned report of the database items.
- Click on 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 SQL Server database from one to another quickly.