I have a test.bak file in my local machine. I need to restore this file to remote machine’s database. How do I do that?
When I try this, the remote database throws an error that it is not able to find test.bak on the local filesystem.
Query
RESTORE DATABASE TESTPROJECT
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ICON3\MSSQL\Backup\test.bak'
Error
Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ICON3\MSSQL\Backup\test.bak'. Operating system error 2(The system cannot find the file specified.).
How can I achieve this? I am using Microsoft SQL Server 2008.
In the context of this answer –
remoterefers to your machine,localis the database server.Restore from
localfilesystemCopy the backup file to the
localfilesystem, and restore directly from this copy.Prerequisites
test.baktoC:\test.bakon the serverSyntax
Restore from
remotefilesystemAlternatively you can restore from the
remotebackup file using UNC syntax. I typically don’t use this option, but it is useful if there won’t be enough disk space onlocalfilesystem for both the backup file and the restored database.The success of this option depends on some variables – permissions on the
remotefilesystem assigned to the database service account, network health, and others.Prerequisites
Remotemachine name isremotemachineremoteat'C:\test.bak'remoteadministrator shareC$Syntax