8 years ago
I am testing out YAF and so far it has everything I need.

The last part of my testing, I need to import data from an old Community Server forum. The forum has been active for 9 years, and has about 46,000 posts.

I hope someone can point out the stored procedures or a script someone has already done to get me started to help with the migration. I will need to migrate the users, the forums and then the posts.


8 years ago
On your YAF test, look at the database and the stored procedures. Focus on the ones with _save. That will help you insert your data. Personally, I created my own SQL statements, but I was coming from a php/mySQL forum.

8 years ago
Thanks. Now at least I have a rudder. If I get this to work, I will post back what I create to get it done.
8 years ago
I decided to go the script route and am working on the users, but I have two questions for now. I have only looked at the stored procedures.

First what is the ProviderUserKey?

Second, can you describe how Flags are used? I think I can hard code it, but I am not sure yet.

Attached is the user upsert script I have so far. Let me know if you see anything stupid, (other than the upsert only doing insert, for now). Today is the first day I have had a change to look at either of these DBs.

8 years ago
I think I figured it out. The provider key is form the aspnet table. I copied my machine key over into the web.config and manually added one user.

The flags is used for the calculated field and I can hard code it to 2 (approved).

I will move forward and post an updated script once I have this done.

8 years ago
I have been sidetracked the past couple of days, but I have the user part done and have attached the script.

Note that I had defined a machine key in my old Community Server forum. I copied that and put it in my YAF config.

Also, the attached T-SQL script requires that it be run on SQL Server 2008 or newer. I used MERGE to OUTPUT a mapping table that is used in queries after the first merge, hence the 2008 or greater requirement.

I have run this and moved over a few thousand users and have not seen any problems with the site. If you see that I have missed an table or something, or have any suggestions, please let me know.

I am moving on to migrating the forums now.

  • runboy
  • 77% (Friendly)
  • YAF Lover
7 years ago
Did you migrate all the posts etc. if so do you still have the scripts?
6 years ago
I know this is a really old thread, but I did finish the T_SQL to migrate from our old 2005 Community Server database to YAF.

Disclaimer: I had to get it done quick and it is a one shot deal, and I am not completed testing here, so there might be an error or three.

What I did:

  1. I copied the machine key from the original server and placed it in the web.config for YAF. (This is so encryption is the same).

  2. Went through the YAF install so I had a functional site and a clean DB to start.

  3. Backed up the clean and functionality YAF database just in case I needed to start over (The T-SQL uses MERGE, but only to insert).

  4. Ran the script. If you stop or cancel in the middle, scroll down to the end and rollback the transaction else you will have a transaction that is never committed or rolled back. (Also keeps you from having to restore after an incomplete migration.)

Our database is about 1.3GB. It took about 10 minutes to move the data over.

I am brand new to YAF, so if any of you experts see anything I missed or could do better, please let me know. Thanks!

 CS to YAF Migration.zip You have insufficient rights to see the content.

6 years ago
I am having issue with my script and cannot seem to figure it out. Something is out of sync.

Users that are migrated over cannot log in. I have traced the code into YAF.Core > LoadPageFromDatabase.cs and have found that users that are migrated are not associated with any roles, thus do not have any permissions. If I try to work around this add a role to the user

RoleMembershipHelper.AddUserToRole( YafContext.Current.User.UserName, "Registered" );

they can see a page, but that causes other problems such as not being able to change their password.

What did I miss in the migration SQL?


I figured out the problem. The registered Role id was incorrectly hardcoded at the top of the migration SQL script.. 🤬

6 years ago
I finally completed the migration a couple of weeks ago.

There are 37,467 posts in 9,720 topics in 17 forums.

We are working on cleaning up all of the old posts, but are doing it manually to make sure we don't delete any old gems.

I still have some minor issues to work out and some larger features to add, but YAFNET is so much better than our old community server forums.

Thanks to all of the devs for maintaining this project!