19 Mar 2008
28 Jan 2010
Link to this post
I may may post all the steps somewhere but essentially I managed to get everything fully integrated by switching to YAF's Membership, Role and Profile providers and just keeping the Sitefinity Personalization provider.
Now I'd have much preferred to use Sitefinity's providers, especially Sitefinity's Profile providers but this was just a non-starter sadly.
The basic steps and issues I had are listed below.
Step 1. Copy all of the YAF assemblies, user controls, resources and other bits and pieces into the Sitefinity project.
Step 2. Merge the two web.config files, adding any missing references and properties but also remembering to update <Membership>, <role>, <Profile> and <Security> blocks to use whichever providers you are using. I missed the <Security> reference the first time which of course caused some issues.
Issue 1: YAF has a design flaw in that the User table contains a lot of addtional information that should really be in a separate table. As a result I found it much easier to just use YAF's Membership provider than try to fix this in YAF.
Since in my case I was integrating two sites which were in active use this also allowed me to pick up their forum stats etc which were stored in their user tables. I also switched to YAF's role provider just so I was using a Membership and Role provider in the same database and then went through a cycle of merging any user accounts that were in Sitefinity site A but which were missing from YAF site B.
Issue 2: I then found that profiles didn't work. Telerik pointed me to the fact that some stored procedures cross referenced tables so while my Membership and Role tables were now in another database and happily working for their providers, the Profile provider no longer worked since it was assuming content was still being added to the tables in the Sitefinity database.
Now I didn't want to start duplicating data so rather than try to synch the tables between the two databases I just re-write the stored procedures to look in the new database which was luckily on the same server.
Now this worked except I then started to have strange nolics errors at intervals.
In essence the site would be working fine and then suddenly I'd just get nolics errors. The only way to get things running would be to clear all cookies, create a new temporary user and then everything started to work again.
Now I diffed the databases when working and not working and nothing had changed in the database and since switching client machines had no effect it was down to something in application state on the server but I never pinned down what it was.
So in the end I switched my Profile provider to YAF's which fixed everything. However, YAF's profile provider isn't that great since it uses tables with hardcoded column names so while in Sitefinity I can just add new profile properties in the web.config, in YAF I have to start editing tables and classes.
The final step for me was/is still to add some new profile columns to YAF and copy across a bit of data but other than that it works like a charm.
You can see the results of this merge at www.marsdrive.com , just click on forums to see the YAF forums.