SQL Server – Database Migration – Move Database from One server to another Server


  • Analyze the disk space in the target server.
  • Confirm the data and log file location in the target server.
  • Collect the information about database properties
  • Collect the information about the application dependencies
  • Collect information about the logins and & users
  • Check the database for Orphan users
  • Check the SQL Server for dependent objects (SQL jobs , Linked Servers)
  • Check the Maintenance Plan for the database

Database Migration Checklist:

  • Stop the application services
  • Change the database to read-only mode (Optional)
  • Take the latest backup of all the databases involved in migration
  • Restore the databases on the target server on the appropriate drives
  • Cross check the database properties as per the database property script output, change the database properties as per the pre migration- checklist
  • Execute the output of Login transfer script on the target server, to create logins on the target server
  • Check for Orphan Users and Fix Orphan Users
  • Execute DBCC UPDATEUSAGE on the restored database.
  • Rebuild Indexes (Optional) as per the requirement and time window you can execute this option.
  • Update Index statistics
  • Re-compile Procedures
  • Start the application services, check the application functionality and check the Windows event logs.
  •  Check the SQL Server Error Log for login failures and other errors

SQL SERVER- Enabling Lock Pages in Memory (LPIM)

This Windows policy determines which accounts can use a process to keep data in physical memory, preventing the system from paging the data to virtual memory on disk.


To enable the lock pages in memory option

  1. On the Start menu, click Run. In the Open box, type gpedit.msc.
  2. On the Local Group Policy Editor console, expand Computer Configuration, and then expand Windows Settings.
  3. Expand Security Settings, and then expand Local Policies.
  4. Select the User Rights Assignment folder.

    The policies will be displayed in the details pane.

  5. In the pane, double-click Lock pages in memory.
  6. In the Local Security Setting – Lock pages in memory dialog box, click Add User or Group.
  7. In the Select Users, Service Accounts, or Groups dialog box, add an account with privileges to run sqlservr.exe.
  8. Log out and then log back in for this change to take effect.


image005 image007

Reference: https://msdn.microsoft.com/en-us/library/ms190730.aspx