Error: "Could not retrieve backup settings for primary" in Log shipping Backup job

This one is simple but interesting…

Log shipping which was running for an year, suddenly stopped working. Log shipping monitor says that there are no backups restored for last 14849 minutes… Why?

We started figuring this out, the copy and restore jobs were running fine but only the backup job was failing.

What was the error generated by the Log shipping backup job?

*** Error: Could not retrieve backup settings for primary ID ‘abfb9a42-207e-451b-968c-3ac29edc16f9’.(Microsoft.SqlServer.Management.LogShipping) ***
*** Error: Failed to connect to server SQLSERVER2001.(Microsoft.SqlServer.ConnectionInfo) ***
*** Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)(.Net SqlClient Data Provider) ***

But the name of the SQL Server name is SQLSERVER2012, so why is it looking for SQLSERVER2001? This is because the server was renamed from SQLSERVER2001 to SQLSERVER2012 recently but the sys.servers was not updated with this change.

As a result, SELECT @@SERVERNAME still points to old name so we ran commands given below to update sys.server entry and then RESTARTED SQL Server:

EXEC sp_dropserver ‘Your_OLD_Computer_Name’


EXEC sp_addserver ‘Your_NEW_Computer_Name’, ‘local’


Now we reconfigured log shipping to make it work. You can either do this or update the Log shipping backup with correct SQL Server instance name or create a SQL Server alias pointing back to new server name to make it work. Still not working? Leave the error message in the comments here….


Rename a Computer that Hosts a Stand-Alone Instance of SQL Server –

Comments (10)

  1. Cool.... says:

    In this case we mostally re asign the logshipping.

  2. Nagarjuna says:

    Hello Chidambaram ,

    My Monitor server Log shipping table are not updated . Could you please let me know why these tables are not updated with backup/restore/alerts information .

    details :

    Primary server -running under local account

    Primary server agent – running under the domain account

    Secondary server -running under local account

    secondary server agent – running under same the primary domain account

    Mirror server -running under local account

    Mirror server agent – running under the different domain account

    Could you please explain about the what kind of security we need to provide the agent accounts .

  3. Damodar says:

    This works. Thanks for a Wonderful article.

  4. Sajeesh says:

    This worked… Thanks a lot!

  5. Jannie says:

    I just changed the name in the OS cmnd on the Job in the Agent… seems to be working fine.

  6. Madhu says:

    Thanks for sharing this. It really helped me.

  7. Lino says:

    Brilliant, this helped me allot, thank you Sakthivel Chidambaram

  8. Olga says:

    That is a great. It helped me a lot. I could no get log shipping running in the fist place.

    Thank a lot!

  9. David says:

    your blog post here was super-useful, thank you.

    in this sentence, did you mean to say "update the log shipping backup JOB" ?

    You can either do this or update the Log shipping backup with correct SQL Server instance name

    Reply from Sakthi:

    Yes, I mean log shipping backup job

  10. VLAD says:

    Hi, I'm having this issue randomly, I'm backing up the TL every 20 minutes and some times I get the error 5-8 times a day.. can somebody help?? thanks