SQL cmd line

  • I have the need to do the following:

    Do a full set of backups.

    ZIP the backups and move them to one server across the WAN

    unzip and restore

    I am trying to figure out how to best script this out so that it is seemless as possible.

    This is being done for a one time migration but we will be running many iterations before the final cutover.

    I wanted to run the backups in batches so that I can zip them in batches - the smaller zipped files seem to go across the WAN at a better rate than one HUGE zipped file.

    Can anyone suggest a good way to do this? Can I use DOS scripting and run SQLCMD as well as regular DOS CMD line commands in the same .bat file?? I've been playing around with it and am really having a hard time figuring out the best solution.

    any suggestions?

  • Depending on the sizes of your databases, you may want to look into zipping each backup file individually. For larger databases, back them up in smaller chunks as it'll cut down on the backup time (and then you can zip these too in smaller batches). The smaller zip files too will decrease the time you would have to recopy files in the event of a packet loss since you're dealer with smaller files in the first place. 🙂

    You should be able to use sqlcmd and dos commands in the same bat file. I don't think it really makes a difference if you backup-zip-transfer one file at a time or do all the backups then all the zips than all the copying.

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

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