- Newest
- Most votes
- Most comments
The error you're encountering indicates that there's a conflict with the file locations specified in your restore operation. The file D:\rdsdbdata\DATA\samplestaging is being claimed by both the data and log files of the database, which is causing the restore to fail.
To resolve this, use the WITH MOVE clause in your RESTORE DATABASE command to specify different locations for the data and log files. This allows you to relocate the files to a directory where there is no conflict. Here’s a general example of how you might modify your command:
RESTORE DATABASE samplestaging
FROM DISK = 'arn:aws:s3:::sample-db-backup/samplestagingbackup/samplestaging_Full_Backup20240915.bak'
WITH MOVE 'samplestaging' TO 'D:\rdsdbdata\DATA\samplestaging_data.mdf',
MOVE 'samplestaging_log' TO 'D:\rdsdbdata\DATA\samplestaging_log.ldf';
In this command, replace 'D:\rdsdbdata\DATA\samplestaging_data.mdf' and 'D:\rdsdbdata\DATA\samplestaging_log.ldf' with appropriate file paths where you want to store the data and log files.
Relevant content
asked 4 years ago

hello,
thank you for your answer but the suggested script is producing another issue.
tsql: RESTORE DATABASE samplestaging FROM DISK ='arn:aws:s3:::sample-db-backup/samplestagingbackup/samplestaging_Full_Backup20240915.bak' WITH MOVE 'samplestaging' TO 'D:\rdsdbdata\DATA\samplestaging_data.mdf', MOVE 'samplestaging_log' TO 'D:\rdsdbdata\LOG\samplestaging_log.ldf'; error: Cannot open backup device 'D:\rdsdbdata\BACKUP\arn:aws:s3:::zantrik-db-backup\zantrikstagingbackup\zantrikstaging_Full_Backup20240915.bak'. Operating system error 123(The filename, directory name, or volume label syntax is incorrect.).