How to migrate a database that lives locally in the App_Data folder

Aug 10, 2012 at 9:28 PM
Edited Aug 10, 2012 at 9:33 PM

I have an ASP.NET MVC 4 application that includes a SQL Express database that lives inside of the MVC application's App_Data folder. In other words, the database does not exist in the list of databases that are shown in SQL Server Management Studio (SSMS).

When I use SQL Azure Migration Wizard and get to the point where it asks me to select a SQL Server and a Database there are two issues that I'm running into:

  1. My MVC application's database does not appear in the list of databases within the SAMW's list of databases
  2. If/when I enter the full path to the App_Data folder where my MVC database lives (in SAMW's "Specify a database" textbox), SAMW returns an error that says,
Cannot open database
C:\Users\...\MvcApplication\App_Data\Database1.mdf requested by the login. The login failed.
Login failed for user '[MyUsernameHere]'

Since I can successfully connect to the Database1.mdf from within Visual Studio 2010 (via Windows Authentication), it appears as though the SAMW isn't allowed to access a stand-alone database file (.mdf).

Is there a way to specify an .mdf file in SAMW and successfully connect to the database?

Aug 17, 2012 at 1:40 AM



Sorry to say, but no, SQLAzureMW does not work directly against an mdf file.