Method 1: Move SQL Database by Backup and Restore
It is a two-step method. First, take a backup of your existing SQL database. After that restore the backup file.
Step 1: – Create Backup File
- Launch SQL Server Management Studio (SSMS) and go to object explorer.
- Click on Databases and right-click on the database that you want to transfer.
- Then click on Tasks > Back Up
- In the Backup Database dialogue box, set the Back type as full and Destination as Disk.
- Click on Add to set your backup destination.
- Click on OK to end the backup process.
Your backup will be created in a few minutes. After this backup, you now have to restore it on your new server or system. Follow the steps below to restore the database from one server to another.
Step 2: – Restore Backup Using SSMS
- Launch SSMS and connect to your database.
- Right-click on your database. Click on Tasks and then on Restore > Database.
- A new dialogue box Restore Database will appear.
- Select From device under Source for restore section. Then click on browse (…) to select your backup file.
- Set Backup media as File in the Specify Backup window.
- Click on Add and select your backup file. Click OK.
- Click on Options under Select a page panel in the Restore Database window.
- Set the Restore options and Recovery state as per your requirement and click on OK.
Your backup will be restored shortly.
Method 2: Move SQL Database on Another Server by Copy Wizard
To transfer a database from one server to another follow the steps below-
- Launch SSMS and go to object explorer.
- Right-click on a database and then click Task>Copy Database.
- Put in the name of Source Server. Also, enter the username and password of your server and hit Next.
- Enter the name of Destination Server and click on Use SQL Server Authentication.
- Select Use SQL Management Object Method and click on Next.
- Check the copy box, Click Next.
- Check MDF and LDF files path for the destination server.
- Click on Run Immediately to copy the database right away.
- Click on Finish.
- The database will be copied shortly.
- Refresh the destination server to see the newly copied database.
Drawbacks of Manual Methods
As good as these methods are they still have the following drawbacks-
- They eat up a lot of your time. If you are short on time these methods are not recommended.
- If you are not a very technical person it can be a hassle to go through each and every step one by one.
- There are cases where your complete data might not get moved. This will result in an error and a lot of lost time.
Method 3: Transfer SQL Database Using Enterprise Software
To avoid all the difficulties and time requirements required by the above methods you can use professional enterprise software to transfer your database from one server to another.
Apart from helping you transfer your database, it also helps you to:
- Repair corrupt database files
- Recover multiple databases at once
- Decrypt encrypted SQL scripts
- Analyze log database files