Powershell error when restoring a database on test server from production server

  • I have a Powershell script that restores a database from production to test environment.

    It runs fine until this week.
    We did not change any permissions on the server, not sure what happened.
    This error happens when copying backup file from production to the test server.
    Then it tries to open the folder that has the backup files on the test server.
    I run this on the test server in Powershell IDE, which I have admin privilege and I can open the folder and  write to the folder. so do not know why keep getting cannot find the path error.

    The detailed error in the log is below
    remote file path is \\myproductionserver\G$\Backup\\
    Most recent full backup has been located. \\myproductionserver\G$\Backup\\
    File name is 
     G:\SYCPSRestore\SIS*.bak
    no older backup file
    ........... copying backup file to remote server ................
    Restoring file \\snocsasdbp01\G$\Backup\\ as SIS on mytestserver
    Cannot open backup device 'G:\SYCPSRestore\'. Operating system error 3(The system cannot find the path specified.).
    RESTORE FILELIST is terminating abnormally.
    Exception calling "ReadFileList" with "1" argument(s): "An exception occurred while executing a Transact-SQL statement or batch."
    At G:\SYCPSRestore\restoreProdtoTest.ps1:214 char:1
    + $backupFiles = $smoNewDB.ReadFileList($destServerConnection);  #Returns the list ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : ExecutionFailureException

    remote file path is \\snocsasdbp01\G$\Backup\\


    File name is

    G:\SYCPSRestore\SIS*.bak

    no older backup file

    ........... copying backup file to remote server ................

  • I figured out.
    There is a third party tool Veeam that is doing the backup of snapshot.
    We did not setup the Veeam to do the database backup, but not sure why it is doing that anyway.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply