BAKUP databast form one sys to another

  • Hi Good Moring EVERY BODY,

    Q; What is process to restore the database from the backup which is on the other mission.

    Situ:

    A database in x system every night 12:00 tacke complete backup

    I can restore that backup file as a B database in system plz help me

    explain what are the steps we have follow.

    explain every step plz

    Thank U

    all

  • If the server can reach a shared location there is no problem.

    put your backup file(s) at the shared location and restore it from the shared location.

    e.g. put an xcopy-cmd at the last step of your db-backup sqlagent job like

     xcopy d:\mssql\backup\*.bak \\mysharedserver\myshare\myserverfolder /c /k /h /v /y

    at your server B you can then schedule a restore that starts after the copy-step (just schedule a certain time, depending on the size of your backupfile)

    restore yourdb_restore

    from disk=N'\\mysharedserver\myshare\myserverfolder\mydbbak.bak'

    with -- move datafiles if needed

     replace -- only needed if you restore over an existing db

    , recovery

    - keep in mind it's your sqlserver service accout or your sqlserver agent service account that needs the authority to read/write to the shared location.

    - you'll also need to handle the logins and sqlusers defined for the db.

      you can copy them from the original server or create them yourself and map them again after a successful restore.

    e.g.

    sp_change_users_login @Action = 'Update_One',@UserNamePattern = 'mysqllogin1', @LoginName = 'mysqllogin1'

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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