To Migrate SharePoint DBs from SQL Server to another either same version or to a new version (2008 to 2008 or 2008 to 2012) you can follow the following steps:

  1. Stop all SharePoint and IIS Related Services.
  2. Stop IIS.
  3. Detach all related SQL Server databases.
    • Configuration database
    • Central Administration content database
    • Content databases
    • Service application databases
  4. Move all database files (.mdf, .ldf, and .ndf) to the new server.
  5. Set up same user permissions on the new SQL server.
  6. Attach your databases to the new SQL Server.
  7. Verify ports in your new SQL server.
  8. Go to your SharePoint server and create your SQL Server Alias.
  9. Start all your SharePoint services.