Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Move a Microsoft SQL Server Database

This guide shows how to copy a database from one Microsoft SQL Server (MSSQL) to another using a backup file.

Web Hosting2 min read18 steps9 screenshots

What is an MSSQL database?

A database is an organized store for information, like a very big spreadsheet. Microsoft SQL Server is a program that runs such databases. Websites built with ASP.NET often use it. Moving a database means making a copy on the old server and loading it into the new one.

Ask Hostvento support whether MSSQL is on your plan and how to connect to it.

Warning: Restoring over an existing database replaces its data. Make a backup of both servers first.

What you need

  • Login details for the old and new SQL Server.
  • SQL Server Management Studio, called SSMS. It is a free Microsoft program with windows and buttons for managing databases.
  • A way to move a file between the servers, such as FTP or a file manager.

Step 1: Back up the old database

  1. Open SSMS and connect to the old server.
  2. Expand Databases.
  3. Right-click your database. Choose Tasks, then Back Up.
    Start Export Data Wizard
  4. Set the type to Full.
    SQL Server Import and Export Wizard
  5. Under Destination, click Add and choose a file path ending in .bak.
  6. Click OK and wait for the success message.
    Configure the Data Source

Step 2: Move the file

  1. Copy the .bak file to your computer.
  2. Upload it to a place the new server can read. Your hosting details or Hostvento support will tell you where.

Step 3: Restore on the new server

  1. Connect SSMS to the new server.
  2. Right-click Databases and choose Restore Database.
    Configure the Destination Server
  3. Pick Device, click the three dots and then Add.
  4. Select your .bak file and click OK.
  5. Type the target database name.
    Microsoft OLE DB
  6. Click OK to start.

Some shared hosts do not allow a restore from SSMS. Then you can send the file to support or use their import tool.

Step 4: Finish up

  1. Check that tables and rows are there.
    Specify Table Copy or Query
    Select Source Tables and Views
  2. Re-create database users and passwords. These sometimes do not move across.
  3. Update the connection string in your site. A connection string is the line of text that tells your site where the database is. It lives in a file such as web.config.
    Complete the Migration Process
  4. Test your site.

Quick recap

  • Back up the old database to a .bak file.
  • Move the file to the new server.
    click Finish
  • Restore it with SSMS.
  • Fix users and the connection string.
  • Test everything before you switch live traffic.