How to copy a Sql server 1 to Sql server 2

  • How to Copy A Sql server 1 from one comuper

    to a Sql server 2 to another computer

    Complete and all contents

    with one command

    thnks

    ilan

  • There are multiple ways to do this but none actually take one command in most cases (especially when you count the copy). The way I generally use if I can take server 1 offline is to stop server one. Copy the .mdf, .ndf. and .ldf files associated with the DB to be moved to server 2 in it's new location (you can restart Server 1 when done if needs be). Then using sp_attach_db (see BOL) I attach the db files to server 2. Then using sp_change_users_login (see BOL) I sync the user account to their new server 2 counterpart (this keeps all rights in place) or drop them from the db using sp_dropuser (see BOL) in the DB to remove them properly.

    Or if you cannot copy directly between servers do a backup to tape/disk and restore to server 2 and follow same user handling.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply