Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBeaver restore SQL Server .bak file

I am just trying to restore a SQL Server .bak file in my DBeaver UI. But I have no idea how to do this - can someone help please?

I created a database, but when I right click on it, there are no restore options.

enter image description here

like image 346
Paul Kruger Avatar asked Jul 29 '19 16:07

Paul Kruger


People also ask

How restore .BAK file in SQL server?

Right-click the Databases node in Object Explorer and select Restore Database.... Select Device:, and then select the ellipses (...) to locate your backup file. Select Add and navigate to where your . bak file is located.

How do I open a DB BAK file?

Right-click on the database and follow Tasks>Restore>Database. On the Restore Database page, go to the Source for restore section and click on the 3 dots or browse option against the From device option. Select the BAK file from the saved location and click OK.


1 Answers

I do not see that option either in my version of DBeaver (6.1.3 - community). What you could do is initiate a restore with TSQL (by clicking on SQL Editor while you are connected to your database). Then in the Script area, use the below, modified for your own environment/database name.

USE [master] RESTORE DATABASE [DatabaseName] FROM 
DISK = N'C:\FolderName\BackupName.bak' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10

For full Tsql options to restore a database, see this: RESTORE Statements (Transact-SQL)

like image 122
LaraRaraBoBara Avatar answered Sep 22 '22 11:09

LaraRaraBoBara