The Configuring a Website that Uses Application Services page does cover Copying User Accounts from Development to Production but doesn't go into all that much detail. It really skips over the topic and starts talking about the ApplicationId and applicationName problem that a lot of people have had trouble with. This problem has also been covered by Scott Gu back in 2006. The part it skips over is that you can actually migrate your users and applications if you use the Database Publishing Wizard. But it doesn't tell you what to do if you don't want to use the Database Publishing Wizard. Here's what I did:
- In SQL Server Managment Studio right-click on your database and select "Tasks -> Generate Scripts...". The SQL Server Scripts Wizard dialog will appear.
- Click "Next", select the database with the Application Services, ASP.NET Membership tables installed and click "Next" again
- In the "Choose Script Options" dialog change the "Script Create" option to False and change "Script Data" to True. The click "Next".
- In the "Choose Object Types" dialog select just "Tables" and click "Next".
- In the "Choose Tables" dialog select all the tables with a "aspnet_" prefix. In my dialog this went from "aspnet_Applications" to "aspnet_WebEvent_Events". Click "Next".
- You can then generate the script which you will then run on the destination database to a variety of destinations including a new query window in SQL Server Management Studio or a .sql text file by clicking "Finish" (potentially twice).