MDF file sync between computers throw DropBox


because I can't register to the old forum, I'll post my comment here. Hope that someone can link this topic on the old one :

As the original author, I'm using 2 computers depending on my location. I'm the only developer. Turning one a machine 24/24 wasn't a solution too.
Making a backup/restore when switching from 1 computer to the other one is just the best way to overwrite the wrong database (like anybody has already done in the past with floppy or USB drive ^^).

I can succeed the sync using DropBox 12.4.22.
First computer : Win 7 x64 Pro Fr - MS SQL 2014 Express SP2
Second computer : Win 10 x64 Pro Fr - MS SQL 2016 Express

On the first computer (which has generated the MDF), I've changed the Security Attributes in Windows Explorer of both files Database1.MDF and Database1.LDF to allow my current user the full control. So doing this, let Dropbox sync these files without the error 'Access Denied'.
On the second computer, no need to do this, files will inherit of current folder.

Note : When using VisualStudio, some files are locked with the database and DropBox cannot sync them. Nevermind, these files will be detroyed when VisualStudio will exit.

Dunno if helpful, but you should be able to login on the new forum with your old forum UserID

Even if you managed - somehow - to get DropBox to synchronize these files it won't work and most likely would just corrupt your database.

To make matters worse - let's assume you shut down SQL Server on the first computer - synchronize the files and then start up SQL Server on the second computer. If that worked and the second computer mounted the database - SQL Server would then upgrade the files to 2016 format and you could never go back to the 2014 version.

If you make sure you utilize the exact same version of SQL Server on both systems - made sure you stopped SQL Server before synchronizing files - then it might work and you might be able to get something working. However it is prone to a lot of issues and if you corrupt your database without having a good backup - everything you have will be lost.

The better solution is to create a backup file - place that file in DropBox - and use that file to restore on the other machine. It requires that you have the same version of SQL Server on both systems - but can be automated through a script that you run anytime you want to create that backup file.

(As I'm not an SQL Server expert, my interrogation may be stupid)

The goal of using a local MDF file is like to portable unless why not using SQL Server ?

I understand what you are wanting to accomplish - but SQL Server does not work that way. With SQL Server Express - there is an option to attach a database file when you connect. You can use that feature and synchronize a file as long as you make sure you are disconnecting the file and it is no longer attached to SQL Server before you perform the copy/synch.

Another option to consider is a localDB installation of SQL Server Express - please review the Microsoft documentation on this feature to see if it will work for you.

I need to learn a bit more on SQL Server.
I'm trying to use Azure so, it may solve my problem during developement on 2 computers.