I want to move my .mdf and .ldf into my dropbox folder.
I ran this script command:
ALTER DATABASE MyDatabase1 MODIFY FILE
(
Name = matrix,
Filename = 'C:\Users\mycomputer\Dropbox\MyDatabase1.mdf'
);
But I get this error:
The path specified by ‘C:\Users\mycomputer\Dropbox\MyDatabase1.mdf’ is
not in a valid directory.
I’m pretty sure it’s just a permissions issue where the sql service running my script doesn’t have the correct permissions. But I have no clue which object to grant all permissions to my DropBox. I tried mycomputer\users but that didn’t work. Can someone help please?
As far as I know,
Dropboxdoes not make snapshots of the files it copies.This means the files could (and most probably would) be written to during the copy and they’ll arrive in inconsistent state, rendering them unusable.
I believe you would want to use
Log Shippinginstead. This is a feature ofSQL Serverwhich allows transaction logs to be incrementally backed up and sent to another server (possibly by means ofDropbox), where they can be restored. This would allow you to have a snapshot of the database on another server.