Restoring a database everynight

  • Hello all,

    I was wondering if you could assit with the following please.

    I am in the process of a data warehouse project and one of our suppliers who hosts our data will be uploading a .BAK file of the database to an SFTP server that we have set up.

    I want to automate the restore of the .BAK file directly from the SFTP (which I'm fine with as the SFTP is hosted internally and I can restore from a unc path).

    The code I will use for this is as below -

    USE master

    RESTORE DATABASE [Oneserve_Stage] FROM DISK = N'\\server\oneserve_DW\ExportFromOneserve\MHS_DataCut_PROD.BAK' WITH FILE = 1, REPLACE, RECOVERY

    What I want to then do once it has restored is move the .BAK file to another location - call it server2 and delete any exsisting .BAK files that may exsist there already.

    Is there a way I can automate this all in SSIS at all as a project that I can then schedule?

    Would that be the best way to do it?

  • I have done similar. We have a weekly restore of production to our internal environments for anything that isn't locked for development. An SSIS package was our approach. You could also do the same with a Powershell script I am sure. Really about what you are more familiar with.

    I do know for us, we wrote a little custom c# code to transfer files, rather than use the standard SSIS package as we wanted to do some additional checks that you get with SSIS.

    Fraggle

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

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