YAFLogo

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
Currently, my site is in DotNetNuke with the YetAnotherForum plugin. What steps are needed to remove DNN so I can use YAF solo?

I made a fresh install of YAF and connected to my DNN-YAF database, which worked great, except I couldn't log in, lol.

Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
Basically, you don't have to make a fresh install, you simply need a YAF code which is in sync with the module version. The problem can be with ASP.NET Memebership, Role and Profile Providers. YAF can use any, you should simply figure out what happens in your case in YAF tables like something_prov_something.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
I went with a fresh install because I figured it would be best to avoid any of the DNN changes and easier to upgrade. I was hoping I could just copy over the membership tables needed, but from what you're saying, it looks like I'm not experienced enough to pull this transition off all that swiftly.

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
I can't help you much as I don't remember how the module works, tha_watcha could be more helpful.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

Currently, my site is in DotNetNuke with the YetAnotherForum plugin. What steps are needed to remove DNN so I can use YAF solo?

I made a fresh install of YAF and connected to my DNN-YAF database, which worked great, except I couldn't log in, lol.

Originally Posted by: Zero2Cool 

You need to change the provider settings then you should be able to login, it worked on my tests

<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>
    <membership defaultProvider="AspNetSqlMembershipProvider"" hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" applicationName="DotNetNuke" connectionStringName="yafnet" enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>
    <profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear/>
       <add name="AspNetSqlProfileProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Profile.SqlProfileProvider"/>
      </providers>
    </profile>
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
I have PackersHome.com with DNN/YAF and a placeholder site NoEqualSolutions.info which has YAF only.

I changed the db.config to point at the PH database, and made the posted changes to the NES web.config and I think I messed something up, because on the NES site, I got this.

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

Server Error wrote:

Is it possible to be able to log into the PH site, using the PH database and log into the NES site, with the PH database?

I'm hoping to have a pure standalone YAF database, and remove all the DNN stuff.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago
You Need to Set the customErrors mode to "Off" in your Web.config in order to See the Full error message.

In theory you can use One Db, but ist Not recommended only when you have a Full Backup of it. So if you mess something up you can easily restore it.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago

You Need to Set the customErrors mode to "Off" in your Web.config in order to See the Full error message.

In theory you can use One Db, but ist Not recommended only when you have a Full Backup of it. So if you mess something up you can easily restore it.

Originally Posted by: tha_watcha 

This is what I have for my customerErrors

<customErrors defaultRedirect="Error.aspx" mode="Off"/>

I do have full backup being done daily, but restoring the PH database to NES on my host takes a long time.

Edit, do I need to copy over a DLL to the NES/bin directory?

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
It seems your Web.config can't be parsed. Check it. But you have all info now to make what you need.
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
Since I have customErrors turned off, if it was a web.config parse error, wouldn't I get a more detailed message?

Contained in the spoiler is what I changed. When I revert back to the original providers, I'm able to view the forum, but not able to log in.

This portion of web.config works to view the forums on NES, but does not allow users to be logged in.

    <membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
      <providers>
        <clear />
        <add name="YafMembershipProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
        <add name="AspNetSqlMembershipProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>

    <roleManager enabled="true" defaultProvider="YafRoleProvider">
      <providers>
        <clear />
        <add name="YafRoleProvider" applicationName="YetAnotherForum"  connectionStringName="yafnet" type="YAF.Providers.Roles.YafRoleProvider"/>
        <add name="AspNetSqlRoleProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>

    <profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear/>
        <add name="YafProfileProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="YAF.Providers.Profile.YafProfileProvider"/>
        <add name="AspNetSqlProfileProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="System.Web.Profile.SqlProfileProvider"/>
      </providers>
    </profile>

When I replace that exact portion with this, I get the Server Error quoted previously.

 <membership defaultProvider="AspNetSqlMembershipProvider"" hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" applicationName="DotNetNuke" connectionStringName="yafnet" enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>
    
    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>

    <profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear/>
       <add name="AspNetSqlProfileProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Profile.SqlProfileProvider"/>
      </providers>
    </profile>
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago
Sorry one " too much

<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>
    <membership defaultProvider="AspNetSqlMembershipProvider" hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" applicationName="DotNetNuke" connectionStringName="yafnet" enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>
    <profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear/>
       <add name="AspNetSqlProfileProvider" applicationName="DotNetNuke" connectionStringName="yafnet" type="System.Web.Profile.SqlProfileProvider"/>
      </providers>
    </profile>
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
I missed that too.

I made the change to the web.config.

The NES site works again, however, the Forum Login button is unresponsive.

Edit, NES site Forum Login wouldn't respond with the NES database either. When I reverted back to the original web.config, I was able to log into the NES database, but still not the PH databse.

I'm gonna keep poking around the web.config

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
While using the NES db and NES web.config with original settings, I logged in

Then switched to the PH db and made the posted changes to the web.config and it says I'm logged in, lol. I'm able to post and everything.

But when I logged out and tried to log back in, the Forum Login button is still unresponsive. It's as if it doesn't have an event to fire off.

Do I need to bring a DLL over to the NES /bin directory?

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
I tried to create a new user, the error in the Spoiler tags is shown.

Server Error in '/' Application.

You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ProviderException: You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.]

System.Web.Security.MembershipProvider.EncryptPassword(Byte[] password, MembershipPasswordCompatibilityMode legacyPasswordCompatibilityMode) +9861

System.Web.Security.SqlMembershipProvider.EncodePassword(String pass, Int32 passwordFormat, String salt) +505

System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +122

System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +302

System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +111

System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +413

System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +121

System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

I suppose there's no way of Frankenstein'ing the aspnet tables to yaf tables huh?

aspnet_Membership --> yaf_prov_Membership

aspnet_Profile --> yaf_prov_Profile

aspnet_Role --> yaf_prov_Role

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

I tried to create a new user, the error in the Spoiler tags is shown.

Server Error in '/' Application.

You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ProviderException: You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.]

System.Web.Security.MembershipProvider.EncryptPassword(Byte[] password, MembershipPasswordCompatibilityMode legacyPasswordCompatibilityMode) +9861

System.Web.Security.SqlMembershipProvider.EncodePassword(String pass, Int32 passwordFormat, String salt) +505

System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +122

System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +302

System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +111

System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +413

System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +121

System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Originally Posted by: Zero2Cool 

You can resolve the error by adding a machinekey to your web.config, you can generate one here:

http://aspnetresources.com/tools/machineKey