Migrate Linked server from one server to another server with same password

Nirvesh Kumar 1 Reputation point
2021-07-12T23:24:37.853+00:00

Is there a way to migrate the linked server from one server to another including the same password?

I don't have an old password.

Thanks!
Nirvesh

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 22,406 Reputation points Microsoft External Staff
    2021-07-13T02:36:07.043+00:00

    Hi @Nirvesh Kumar ,

    You can using Copy-DbaLinkedServer. Copy-DbaLinkedServer migrates Linked Servers from one SQL Server to another. Linked Server logins and passwords are migrated as well.

    Refer to the blog Scripting Out Linked Servers with Actual Passwords.

    We can also script out Linked Server on old server, then run the scripts in new server. But you need to manually key-in the passwords as when you script out linked servers, passwords are not scripted out - they are grabbled - ########. If the local login is not in your new server, you also need to add the login in your new server manually.

    113949-screenshot-2021-07-13-102853.jpg

    114043-screenshot-2021-07-13-102911.jpg


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.