Had some issues with aspnet membership provider tables

Sep 14, 2010 at 10:27 PM

Worked for all of my tables and SP's, but not the aspnet membership tables.  Here's what I did to get it migrated.

-- Generate a clean script with SqlAzureMW. A few issues pop up from aspnet objects and manually fixing the script won't run in SqlAzure.
-- Manually remove all script statements involving aspnet_ tables/SPs/Views/etc. 
-- Create a clean database in SQL.  Connect to it.
-- Run the aspnet_regsqlazure wizard (bing search for it) with the following command line arguments "/s sqlazuredatabase /u login /p password /a mrpcw /d databasename".  Choose the right "mrpcw" options that you did originally when adding aspnet membership objects to your database.  This will create the aspnet stuff into SqlAzure successfully.
-- Now add your custom objects from SqlAzureMW.  Right click on the database in Management Studio, and say new script.  Paste the edited results of SqlAzureMW to the window.  Run. 


Sep 15, 2010 at 3:14 PM

Hey guys, great tool!  So I had a pretty complex database with the aspnet membership stuff.  As noted in the post above, there's issues with the SqlAzureMW migrating the aspnet generated parts of the DB, however with a little hacking, it works.  What I did ultimately was this:

  • Run the SqlAzureMW tool against the database to generate a script, but don't migrate yet.
  • Hack the script to fix the aspnet parts of the script.  Two steps.  1.  Wrote a parsing tool to remove the BCP commands and write them out to a separate file.  2.  Manually swap out the aspnet parts of the script with the SqlAzure friendly aspnet scripts found here (http://code.msdn.microsoft.com/KB2006191).  Now add the BCP commands in the proper order to the end of the hacked script.  So basically the new script had 3 sections -- the aspnet sqlazure friendly scripts at the top, the business database in the middle (which references the aspnet objects), then the BCP commands at the end in the order generated by the original script.
  • Run SqlAzureMW one more time in migration mode without analysis.  It generates a script.  Swap out the whole script for the hacked script.  Continue on by having SqlAzureMW create the database, then run the script. 
  • Ran perfectly, and there was a lot of complex data in the 100+ tables.  The .NET application work perfectly by just changing the connection string to SqlAzure. 
Sep 15, 2010 at 7:53 PM

This is great feedback and great job!