Home>
Unable to restore the database in the docker container using the script:
RESTORE DATABASE [DBName]
FROM
DISK= N '/var /opt /mssql /data /DBName.bak'
When trying to restore it, it gives the following errors:
- Directory lookup for the file "C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName.mdf" failed with the operating system error 2 (The system cannot find the file specified.).
- File 'DBName' cannot be restored to 'C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName.mdf'. Use WITH MOVE to identify a valid location for the file.
- Directory lookup for the file "C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName_log.ldf" failed with the operating system error 2 (The system cannot find the file specified.).
- File 'DBName_log' cannot be restored to 'C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName.ldf'. Use WITH MOVE to identify a valid location for the file.
- Problems were identified while planning for the RESTORE statement. Previous messages provide details.
- RESTORE DATABASE is terminating abnormally.
It is not possible to restore the database through the interface, the problem is similar, I also tried to get the LogicalName PhysicalName:
RESTORE FILELISTONLY
FROM DISK= N '/var /opt /mssql /data /DBName.bak'
and restore the trace as follows:
RESTORE DATABASE [DBName]
FROM
DISK= N '/var /opt /mssql /data /DBName.bak'
WITH FILE= 1,
MOVE N'DBName 'TO N'C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName.mdf',
MOVE N'DBName_log 'TO N'C: \ DATA \ MSSQL15 \ MSSQL \ DATA \ DBName.ldf',
NOUNLOAD, REPLACE, NOUNLOAD, STATS= 5
Nevertheless, it does not work, advise how to restore the database through a script?
I was wrong, there is a similar problem through the interface. Although it used to work, now even through the interface it is impossible to restore the backup. Errors are similar
Russo2022-01-12 17:09:13Related questions
- Backup procedures/functions when changing them in MSSQL
- Granting rights to the account folder in docker-compose (Ubuntu)
- sql : Organization of testing with a large database
- sql : Partial search by id
- sql : Why is the database stuck in the "Restoring ..." state when only the backup command was run?
- sql : ORDER By CASE slows down the request
- MS SQL Database Process Name
- MSSQL flip rows in columns
- Unloading Blobov from MS SQL
There is a button to get a script through the interface. Take it as a basis.
PashaPash2022-01-13 15:36:15