Home > front end >  Create back,up of a SQL Server database and store it on remote machine
Create back,up of a SQL Server database and store it on remote machine

Time:09-22

I have a SQL Server named TheOtherSide. It is in a different domain (OtherDomain).

I have another SQL Server named MySide in my own domain (MyDomain).

There is a VPN connection between the two servers that allows only TCP over port 1433.

I want to take a backup of the database CoolDatabase that exists on TheOtherSide and restore that backup on server MySide.

That process needs to be automated.

Any backup script I see stores the backup in OtherDomain where I cannot retrieve it.

Can I run a PowerShell script to create the backup that will store the backup in MyDomain?

CodePudding user response:

A classic backup (.bak) cannot be streamed out of the SQL Server machine installation.

You can save the backup on a shared disk or another folder and get it with FTP or something like that.

If your objective is only to backup/restore (and NOT a backup plan, like full backup, incremental backup, and log backup) you can backup/restore the database has .bacpac, in this case, you can use scripts like dbatools PowerShell Module

  • Related