Yuriy
Yuriy

Reputation: 457

Restore db in Microsoft SQL Server

I created a backup (.bak) file and transfer it to another computer when I'm trying to make backup I get an error:

BACKUP LOG cannot be performed because there is no current database backup.

How can I resolve this issue?

Upvotes: 0

Views: 411

Answers (2)

Donal
Donal

Reputation: 32713

Take full backup first and then take log back up. The error is stating that you never took a full backup before taking a log backup.

BACKUP DATABASE [DBName]
TO DISK = N'C:\DBName.bak'
GO
BACKUP LOG [DBName]
TO DISK = N'C:\DBName.bak'
GO

Upvotes: 1

Alex
Alex

Reputation: 21766

This error is raised when you have never taken full backup of your database and try to attempt to take backup of the log only. You need to take a full backup. If you can't find the correct options in SSMS, you can use the following script

BACKUP DATABASE [MyDB] TO DISK = N'C:\MyDB.bak'
GO
BACKUP LOG [MyDB] TO DISK = N'C:\MyDB.bak'
GO

Upvotes: 1

Related Questions