Home Forums SQL Server 7,2000 Backups How to automate a backup on prod and a restore on test? RE: How to automate a backup on prod and a restore on test?

  • Hi,

    I've done this in my prod. and reporting. Not so difficult, just follow these steps (modify as per your needs)

    we take diff backup every night on our prod. so that we can prepare the reporting.

    1. Disable the log backup on prod.

    2. Take the Backup of the DB with a preset name in to a folder lets say : latest_backup

    3. initiate the process of copying the backup to destination server after intigrity checks (you'll face no problem because you've taken the backup with a pre-defined name which will remain the same.)

    4. After copy finish rename the backup file on prod. and move it to another folder so that every time you'll have only one backup in Latest_backup folder (You can also skip to move file to another folder I do this for some specific requirement)

    5. remove all user sessions on destination DB (this can be easily achived by a constomized sp by which i use to kill all user sessions on my reporting server except some specific accounts)

    6. REstore the DB using a predefined query since the name of the backup file is still pre-defined

    7. rename the backup file at the destination server and again you've the option to move it to another folder.

    Regards,
    Sarabpreet Singh 😎
    Sarabpreet.com
    SQLChamp.com
    Twitter: @Sarab_SQLGeek