I always enjoy it when I get a chance to give a little back to this community (I can't afford the shirt so this will have to do):
I have just finished importing all of my DNN 3.1.1 users and roles into DNN 4.0.2. The process I used follows, but let me say upfront that I'm sharing this information with no warranties or guarantees whatsoever. If this makes sense to you and you are confident about checking it over for potential problems with respect to your particular situation give it a go and be sure to test it in a development environment thoroughly (otherwise, don't).
* First, do everything you would normally do to setup a new website with DNN 4.0.2 from the install package. Please note that I used SQL 2005 Express and SQL Server Management Studio for the database storage and manipulation.
*When you come to editing the web.config file...
- Change web.config SQL connection keys to suit your circumstances
- Change validation and decryption keys in Web.config to the keys from your previous installation
- Add the following to the appSettings section so that the installation does not replace your keys: <add key="InstallationDate" value="12/31/2005" />
* Proceed with the DNN installation by browsing to the site. When you try to browse to the newly installed site you may see an error page, copy SiteURLs.config from the Config folder to the root folder to correct it (we used the upgrade process to do a full install).
* Manipulate the database tables (in this order):
- Backup DB (as always)
- Delete all rows from aspnet_Membership
- Delete all rows from aspnet_Profile
- Delete all rows from aspnet_UsersInRoles
- Delete all rows from aspnet_Roles
- Delete all rows from aspnet_Users
- Delete all rows from aspnet_Applications
- Delete all rows from aspnet_SchemaVersions
- Delete all rows from UserPortals (NOTE: if you have multiple portals you may need to consider the Portals table).
- Delete all rows from UserRoles
- Delete all rows from Roles
- Delete all rows from Users
- Import aspnet_SchemaVersions from old DB
- Import aspnet_Applications from old DB
- Import aspnet_Users from old DB
- Import aspnet_Roles from old DB
- Import aspnet_UsersInRoles from old DB
- Import aspnet_Profile from old DB
- Import aspnet_Membership from old DB
- Import Users from old DB (Use "Enable identity insert")
- Import Roles from old DB (Use "Enable identity insert")
- Import UserRoles from old DB (Use "Enable identity insert")
- Import UserPortals from old DB (Use "Enable identity insert")
Good luck.