MembershipProvider Helper To Transfer Data

If you’re using the MembershipProvider (actually the concrete SqlMembershipProvider), then you may have run into an issue where you develop all the Users and Roles on your local machine, using the asp_net.mdf in the Express version of Sql Server 2005.

All of the sudden, you need to deploy your application and you need a different database to store your information.
You’ll probably find this resource for deploying on a different version of Sql Server
http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

Ok.  You run the aspnet_regsql.exe utility, and you have the correct database, but it is empty.

What do you do now?

I’ve created this helper script to enable you to move all your applications/users/roles to a new database.
This script doesn’t actually INSERT the new data, but creates the TSQL code that you can run on the new database.

I’ve posted the code here (as a text file).

Hopefully, it will make your life a little easier when you need to copy to a new database all the Membership information.

Advertisements
This entry was posted in Software Development. Bookmark the permalink.

One Response to MembershipProvider Helper To Transfer Data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s