ESXi : Clone SQL Server

ESXi : Clone SQL Server

When cloning an SQL VM guest you’ll find that the server itself is unaware of the change in hostname. This can be verified using the command:

SELECT @@SERVERNAME

If you find that your cloned SQL server displays the wrong @@servername use the following commands to fix it:

sp_dropserver ‘OLDSERVERNAME\INSTANCENAME’
go

sp_addserver ‘NEWSERVERNAME\INSTANCENAME’, local
go

Finally restart the SQL service using services.msc. verify the name has changed using the same command as above, SELECT @@SERVERNAME.