cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to use command line tools to automate SQL DB restores?

MKatzung
Level 3

Hello,

I need to know if it's possible to backup/restore, using the powershell command line tools, a sql database.

The idea here is that we will be spinning up servers in AWS and then destroying them as needed.

Prior to destruction a full backup would be performed.

AWS then spins up the new server, while using PS to do all the initial conf stuff, uses PS to install the BE agent, then uses them to restore the database.

 

I THINK I've found commands on how to backup the server: New-BESqlDatabaseSelection Cmdlet  (or? Set-BEInitialFullBackupTask Cmdlet perhaps?)

I've found the command on how to install the agent: Install-BEWindowsAgentServer Cmdlet

I'm having problems finding commands on restoration of the SQL database, The only thing I've seen on restoration is: Submit-BEFileSystemRestoreJob Cmdlet, but that just appears to be for file servers.

 

Can anyone help?

3 REPLIES 3

pkh
Moderator
Moderator
   VIP    Certified
No. There is no BEMCLI cmdlet to restore a SQL database

Colin_Weaver
Moderator
Moderator
Employee Accredited Certified

Wouldn't you be better off doing all of this outside of Backup Exec - i.e use Poweshell (PS) with SQL extensions  to dump the SQL database to a .BAK file and then PS to recover the .BAK file into the instance afterwards

MKatzung
Level 3

Well as apparently there is no way to do this via BE (according to the post above yours). I'll have to handle it this way.

 

We were thinking of using Backup exec for a number of reasons including storage is off the AWS cloud and already configured, as well as the fact that logs would need to start happening etc. Lots of reasons to use backup exec to do this as the product needs to be installed on the server anyways.

 

Thanks everyone for the info.