How to Move All SharePoint Databases to a New SQL Server?

Requirement: Move SharePoint databases to a new SQL Server! You’ll have to move SharePoint databases, including all content databases, configuration databases, and service application databases to another SQL Server at least in a couple of circumstances:

  • Upgrading SQL Server to a new version. E.g. Upgrading SQL  Server 2012 to SQL Server 2016. 
  • Upgrading Servers to new hardware, moving servers from data centers, etc.
  • Moving from single standalone server instances to highly available cluster servers – AlwaysOn


In a nutshell, Moving the SharePoint database from one server to another can be achieved with the following steps:

  • Step 1: Stop All SharePoint Services:
  • Step 2: Backup & Restore All SharePoint Databases to the new SQL Server
  • Step 3: Change the SQL Alias to Point to the new SQL Server
  • Step 4: Start All SharePoint Services

Step 1: Stop All SharePoint Services:

To start with moving SharePoint databases to a new server, stop all SharePoint-related services on all SharePoint servers of the farm So that no connections are made to the SQL server during the migration. Use this PowerShell script to stop all SharePoint
2013 services: How to Stop all SharePoint 2013 Services using PowerShell

Step 2: Backup & Restore All SharePoint Databases to the new SQL Server

Use the PowerShell cmdlet “Get-SPDatabase” to get all SharePoint databases and make a note of them. Proceed with backup each database.

Backup SharePoint Databases in SQL Server: 

  • Go to SQL Server Management Studio >> Right click on the relevant SharePoint database >> Tasks > Back Up.
  • Provide necessary inputs to the backup dialog window and complete backup for all SharePoint databases.

Restore SharePoint Database backups to the New database server: 
You have to make sure your Farm access account & service accounts have access to the target SQL Server! So, before restoring, transfer all Logins from the old server to a new server: This is important as the user access mappings are within the backup we made and should be restored.

  • I’m assuming SQL Server is installed on your new SQL Server, log in to your new SQL Server Database Server, transfer all Backup files from Old SQL Server to your new SQL Server.
  • Go to SQL Server management studio >> Right-click on Databases node > Restore Database >> Pick the database backup. Repeat this step for all database backups.

Besides backup-restore, You can also use the copy database wizard to copy databases from one SQL server to another. Right-click the source database from SSMS >> Tasks >> Copy Database >> Run through the Wizard to copy a database between SQL Servers. Alternatively, you can detach and attach to move SQL Databases between servers.

It’s a best practice to use SQL Alias to connect SharePoint to SQL Server!

Step 3: Create/Change the SQL Alias to Point to the new SQL Server 

Once SharePoint databases are restored into the target SQL server, the next step is to create or change SQL Server Alias on All SharePoint Servers of the Farm. Basically, we will redirect from the original SQL server to the new SQL server.

  • Open the cliconfg.exe tool >> Under Alias tab, add a new alias or change existing alias for your SharePoint farm (If your SharePoint farm uses SQL Alias already).  
  • In my case: My old SQL Server is ‘AzSvrV18’ and I want to move all Databases to ‘SP16-SQL’. After restoring all SharePoint Databases on SP16-SQL, I created an alias on all SharePoint servers to make ‘AzSvrV18’ point to ‘SP16-SQL’.
    Move SharePoint database from one server to another

Here, we have created an alias for the new SQL instance and gave this alias the same name as the current instance of SQL Server that the SharePoint databases are hosted. Please note, an alias can only be configured after the original SQL instance is stopped or Turned OFF to avoid any conflicts. Refer to this article to configure SQL alias for SharePoint: How to Create SQL Server Alias for SharePoint?

Step 4: Start All SharePoint Services 

Start all the services that we stopped. Use the article at Step-1 to start all SharePoint services.

That’s it! We have moved the SharePoint database to a new server. Pretty straightforward, huh! Next time you want to change your Database server, Just update the Server name in SQL Alias! There is no need to run SharePoint configuration wizard and disconnect from the farm, and so on! You can use this approach for other requirements, such as moving the SharePoint database from express to SQL server, moving the SharePoint database from express to standard. Technet article on moving SharePoint 2013 databases:

Related post on moving SharePoint content databases to another drive: Move SharePoint 2013 database to another drive

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

6 thoughts on “How to Move All SharePoint Databases to a New SQL Server?

  • How about moving Nintex 2010 Workflow Database running with SharePoint 2010 to new SQL Server?
    What steps need to be followed. Any upgrade for version required? Will it impact workflows?
    We have SP 2010 with Nintex 2010 on 2006 SQL. Now we are migrating only SQL Server. I see that SharePoint 2010 supports up to SQL 2012 R2. How do we go about moving Nintex DBs to new SQL server and how to tackle Workflow dependencies, Workflow DB mapping post SQL aliasing etc.

    Also while migrating SharePoint 2010 Content DB to new SQL 2012 R2 server, once we stop all services on Sharepoint server, do we need also need to dismount Content DB from Sharepoint end or put it in read only mode from SQL end before we take backup

  • Hi there!

    Thank you for the helpful article!

    In addition to the steps followed you mentioned, I had to change my DNS of the old server name to point to the new server IP in order for it to work. Adding the old server name in the host file of the SharePoint front end servers with the new server IP address also did the trick.

    Did it work for you without following this steps?

    Kind Regards

  • Any way to change the Alias name. So you can do for example change AzSvrV18 to AzSvrV19

    • Hi, for your case. you can try the following link to change to use Alias name.
      In case your environment has Workflow Manager farm, use following links to modify connections string to use Alias name

  • I just tried these steps on my QA environment. My issue is, due to the Alias change, the SQL Server name stays the same. is it possible to do this without the Alias change?

    • Yes! You can dismount the database and mount it again with new SQL Server!!
      Mount-SPContentDatabase -Name $DatabaseName -DatabaseServer $NewSQLServer -WebApplication $WebApplication


Leave a Reply

Your email address will not be published. Required fields are marked *