Reputation: 2089
I am facing problem while copying my ASP.Net Membership tables. Since I just want the schema, so I generated script without copying data.
When I access the new site, it shown
The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
Here is the step by step I had done, which I can't get it works.
However, the error still occur... I had run out of ideas.
Upvotes: 0
Views: 605
Reputation: 3615
You need some data in the aspnet_SchemaVersion table. Have a look at the information in the table of the database you are using and add an insert to the end of your script to add that data to the aspnet_SchemaVersion table. I cant remember of the top of my head what's in there but its fairly simple stuff.
Here you go this should probably do it i dont think the version numbers have changed but you should check your existing db.
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘common’, 1, 1)
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘health monitoring’, 1, 1)
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘membership’, 1, 1)
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘personalization’, 1, 1)
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘profile’, 1, 1)
INSERT INTO aspnet_SchemaVersions (Feature, CompatibleSchemaVersion, IsCurrentVersion)
VALUES(‘role manager’, 1, 1)
Upvotes: 2