HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

Error with restoring from a split .bak file with password

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
errorfilewithrestoringpasswordsplitbakfrom

Problem

I am trying to restore a backup from a split .bak file[.bak_1/.bak_2/.bak_3]. The backup is password protected. So far this is what I have and I cannot seem to format in a way that does not throw me an error.

USE master
GO
RESTORE DATABASE client_a_database1
  FROM DISK = 'G:\database1\***.bak_1',
       DISK = 'G:\database1\***.bak_2',
       DISK = 'G:\database1\***.bak_3'
  WITH MOVE 'database1_data' TO 'G:\database1\***.mdf'
       MOVE 'database1_log' TO 'G:\database1\***.ldf', REPLACE,
  Password 'password'
  GO


With this format I am getting an error on the Password that I have added.

Solution

Below will work, as you had syntax error :

USE master
GO
RESTORE DATABASE client_a_database1
  FROM DISK = 'G:\database1\***.bak_1',
       DISK = 'G:\database1\***.bak_2',
       DISK = 'G:\database1\***.bak_3'
  WITH MOVE 'database1_data' TO 'G:\database1\***.mdf'
       MOVE 'database1_log' TO 'G:\database1\***.ldf', REPLACE,
  Password = 'password'
  GO


Also, a RESTORE HEADERONLY output will help understand why you are getting -


restore was taken from a different MS SQL version.

Code Snippets

USE master
GO
RESTORE DATABASE client_a_database1
  FROM DISK = 'G:\database1\***.bak_1',
       DISK = 'G:\database1\***.bak_2',
       DISK = 'G:\database1\***.bak_3'
  WITH MOVE 'database1_data' TO 'G:\database1\***.mdf'
       MOVE 'database1_log' TO 'G:\database1\***.ldf', REPLACE,
  Password = 'password'
  GO

Context

StackExchange Database Administrators Q#55130, answer score: 2

Revisions (0)

No revisions yet.