c# - Local MDF to SQL Server Application Migration -


i in process of designing database application multi-user application. ease of development purposes planning on using built in local .mdf file visual studio now.

once ready move multi-user environment matter of moving .mdf server , attaching it, changing connection string? or going project in of , better off using sql server beginning?

edit: considerably easier me development .mdf because lot of work home , mean need use vpn (very slow).

another option considering use sql server express on local machine , migrate production server when ready.

as said erik, using sql server.

just know, i'm using .mdf file development , once changes done, publish them production.

to this, need keep following points in mind.

  • you shouldn't use method replace/copy data although possible.
  • use method copy/update schema easily.
  • the production database should accessible development machine.
  • you'll need visual studio publishing changes

what follow below (all steps in visual studio 2015 update 3):

  • make whatever changes need in mdf file.
  • open "sql server object explorer" in visual studio (view->"sql server object explorer")
  • expand sql server node containing attached database.
  • right click name of database , choose "schema compare..."
  • in window opens, select option "select target..." top bar of window.
  • choose connection production if connected drop-down or click "select connection..." button connect production server.
  • click "compare" on toolbar in window.

all schema differences listed in area below toolbar.

  • now, can select changes need publish production via check-boxes.
  • once done, click "update" button on window toolbar , confirm update.

the selected changes mdf file copied production database. in case of error, errors displayed in results.


Comments