After I rename this Windows 2019 VM, will I need to do anything for the named instance?
Yes - you need to drop the old server and add the new server in SQL:
• For a renamed computer that hosts a named instance of SQL Server, run the following procedures:
EXEC sp_dropserver '<old_name\instancename>';
EXEC sp_addserver '<new_name\instancename>', local;
Why is local necessary, what does it do? This is a named instance.
@jeffw8713 do you know if it matters whether the server/VM is renamed before or after I run the
sp_dropserver and sp_addserver statements?
Another team will rename the VM so I need to recommend the correct sequence.
I wouldn't change it in SQL Server until after the server has been renamed.
Thanks but doesn't the server rename require a reboot? After the reboot the SQL instance would not start (because I haven't yet ran drop server, add server). Am I wrong? I just need clarification as we plan to do this tonight.
Would this sequence work?
- rename the VM
- drop and add server name
- reboot server
It can be done after, SQL Server will startup after renaming the VM, but your steps should also work, either way.
@jeffw8713 This is the sequence we used:
- renamed the VM/Server
- ran sp_dropserver and sp_addserver statements
- bounced SQL engine service
- tested connectivity to the newly renamed server
That worked perfectly. Thanks for your advice!