This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Moving Database to different Drive

Hi,

I'm trying to move my DB to a new drive. My C drive is full so I'm unable to run the databackup.exe file. I've tried the BackupDB.bat route but getting an error when trying to run it. The error is

D:\Program Files (x86)\Sophos\Enterprise Console\DB\Core>sqlcmd -E -S "HANOVER
SOPHOS" -b -Q "BACKUP DATABASE SOPHOS550 TO DISK = 'D:\Sophos DB'"
Msg 3201, Level 16, State 1, Server HANOVER\SOPHOS, Line 1
Cannot open backup device 'D:\Sophos DB'. Operating system error 5(Access is d
ied.).
Msg 3013, Level 16, State 1, Server HANOVER\SOPHOS, Line 1
BACKUP DATABASE is terminating abnormally.

Failed



This thread was automatically locked due to age.
  • Hello Steve Plesha,

    so your database files reside on C:, you want to move them to another drive but DataBackupRestore.exe fails because it attempts tp backup to C:?

    You've apparently specified the backupfilepath as D:\Sophos DB - this would be a file without extension in D:'s root, probably not what you want. Please note that a) you must specify the full path (including the file name, not just a folder) and b) the SQL Server must have write access to this location: SQL Server must be able to read and write to the device; the account under which the SQL Server service runs must have write permissions.

    Christian

  • Hi Christian,

     

    It is my understanding that there are two ways to backup the DB

     

    1 Using DataBackupRestore.exe (which doesn't appear to allow you to set the backup path)

    or 

    2 BackupDB.bat (which allows you to set the path)

     

    Option 1 doesn't work for me because its trying to backup to the C drive which only has 1.5GB on it and Option 2 isn't working because I'm getting an Access Denied. I went in and set the MySql Sophos DB user account full access on the D:\Sophos DB directory but am still getting that error. 

  • Hello Steve Plesha,

    well, the article doesn't tell you how to deal with file system permissions - naturally as you could for example backup to a remote share.
    Your SQL instance probably runs as NETWORK SERVICE, create the desired folder and give this account Full Access permissions. Might or might not work though. You could also give Everyone full access for a limited time. BTW - the backup is for "just in case". There are other ways to move the database (e.g. Management Studio).

    Christian

  • Hi,

    I was able to figure it out. I just wasn't using the command properly. My syntax was wrong. Thanks for helping!