Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 845403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:26:44+00:00 2026-05-15T06:26:44+00:00

I want to migrate users and posts from an existing forum I am using

  • 0

I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:26:45+00:00Added an answer on May 15, 2026 at 6:26 am

    You could create a UserProfile table that you can use to join from the User table to your Post table. This will insulate you from the ASP.NET Membership Provider’s internals and can be an extension point for additional user information.

    Here’s a stored procedure and associated functions that I use to create new users and their profiles:

    CREATE PROCEDURE [dbo].[CreateUser] 
      @UserName nvarchar(256)
    , @ClearTextPassword nvarchar(128)
    , @Email nvarchar(256)
    , @PostingID uniqueidentifier
    
    AS
    
    BEGIN
    
    DECLARE @ApplicationName nvarchar(256)
    DECLARE @PasswordFormat int
    DECLARE @UnencodedSalt uniqueidentifier
    DECLARE @Password nvarchar(128)
    DECLARE @PasswordSalt nvarchar(128)
    DECLARE @Now DATETIME
    DECLARE @UniqueEmail int
    
    SET @ApplicationName = 'YOUR_APPLICATION_NAME'
    SET @PasswordFormat = 1 
    SET @UnencodedSalt = NEWID()
    SET @PasswordSalt = dbo.base64_encode(@UnencodedSalt)
    SET @Password = dbo.base64_encode(HASHBYTES('SHA1', 
       CAST(@UnencodedSalt as varbinary(MAX)) 
       + CAST(@ClearTextPassword AS varbinary(MAX)) )) 
    SET @Now = getutcdate()
    SET @UniqueEmail = 1
    
    
    BEGIN TRANSACTION
    
    DECLARE @UserId uniqueidentifier
    
    EXECUTE [dbo].[aspnet_Membership_CreateUser] 
       @ApplicationName
      ,@UserName
      ,@Password
      ,@PasswordSalt
      ,@Email
      ,NULL
      ,NULL
      ,1
      ,@Now
      ,@Now
      ,@UniqueEmail
      ,@PasswordFormat
      ,@UserId OUTPUT
    
    INSERT INTO [dbo].[UserProfile]
    (
     [UserID]
    ,[PostingID]
    )
    VALUES
    (
     @UserId
    ,@PostingID
    )
    
    COMMIT  
    
    CREATE FUNCTION [dbo].[base64_decode] 
    (@base64_text VARCHAR(max)) 
    RETURNS VARBINARY(max)
    
    WITH SCHEMABINDING, RETURNS NULL ON NULL INPUT
    
    BEGIN
    
    DECLARE @x XML; SET @x = @base64_text 
    RETURN @x.value('(/)[1]', 'VARBINARY(max)')
    
    END
    
    CREATE FUNCTION [dbo].[base64_encode] 
    (@data VARBINARY(max)) 
    RETURNS VARCHAR(max)
    
    WITH SCHEMABINDING, RETURNS NULL ON NULL INPUT
    
    BEGIN
    
    RETURN (
    
    SELECT [text()] = @data 
    FOR XML PATH('')
    
    ) 
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to migrate my existing desktop Windows .NET 3.5 app. that uses MySQL
We have an existing Web application and we want to migrate from a custom
I want to migrate sourcecode from SVN to TFS2010 using the TFS Integration Platform.
I want to migrate schema from Oracle to MySQl, so are there any free
i want to migrate my whole DB from MySQL to MS-Sql server. though i
Basically, I just want to know if its possible to use Nhibernate to migrate
An existing web application I want to migrate to the Windows Azure Cloud authenticates
I have a need to migrate game score table from (don't laugh please...) *.ini
I've created this ASP.Net application and need to record what the users have done
The problem is: I have 3 mongo tables, and I want to migrate data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.