Rebuild DB?

Discussion in 'Troubleshooting' started by seasons1, Aug 9, 2008.

  1. seasons1

    seasons1 aMember Pro Customer

    Joined:
    Apr 25, 2008
    Messages:
    21
    For some reason this option scares me, but I have changed a user name for someone and I'm sure that it will take effect with the plug-in once I rebuild the database. I haven't had to use this yet, but read in the manual that you use it when you import names, so I'm assuming if you make changes to users it's ok to use also? Is it just like a 'refresh' database option?
    Sorry, I hope that is not too dumb of a question! :rolleyes:
    Thank you, Theresa
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    What plugin are you using? (eg wordpress) In some cases, it may make the change when you do it in amember, others do need a rebuild. Can you check the database for the other program?

    David
  3. seasons1

    seasons1 aMember Pro Customer

    Joined:
    Apr 25, 2008
    Messages:
    21
    Hi David, It's the phpbb plugin. Not sure what you mean by search the database for the program? :eek:
    Thanks, Theresa
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I mean check phpbb3 for the user to see if it changed the username already.

    David
  5. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    The rebuild functionality will synchronize members between your aMember database and your plugin database. It is one way though. Only members from aMember database are pushed to your secondary database (in your case phpbb). It doesn't work the other way around where new users in plugin are pushed back into aMember database.

    Its a fairly safe operation (assuming the plugin is programmed correctly and probably more important the right version). Most plugins (not all) were designed to make single sign-on a reality and this is an important part of making single sign-on work is to keep the members synchronized between your databases.

    By the way changing username is a little more tricky. If you changed username in aMember then most plugins implement an update user function so that it can change the corresponding record in plugin secondary database so that a rebuild would not be necessary. It will not hurt to do a rebuild but a rebuild alone will not have the desired effect because the plugin would also have to be passed the old member name in order to update the username in that record. Anyway like a said there is an auxillary function that a plugin is suppose to implement that handles this case.

    Jimmy
  6. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    What does this "one way push" do to existing users in the third party database?

    1. I have an existing VBulletin site with 10,000 users. It is being integrated into an existing Amember site.
    2. The existing VBulletin users DO NOT need to be Amember users
    3. The existing Amember users SHOULD BE VBulletin users
    4. New Amember users SHOULD BE VBulletin users
    5. New VBulletin users DO NOT HAVE TO BE Amember users

    Is this kind of set up possible?
  7. seasons1

    seasons1 aMember Pro Customer

    Joined:
    Apr 25, 2008
    Messages:
    21
    Ok, the member was an amember user, we changed her name in the amember admin. Now she can log in to the forum with her old user name, but in the forum admin it shows as the new user name. She cannot log into the forum with the new user name however still the old.
    ? So just a rebuild is safe? This doesn't change anything else does it? I'm still a little confused but understand mainly what Jimmy said.
    Thanks again, Theresa
  8. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    This is in response to joyhome9. I don't have access to phpbb plugin but if you look at the code does it have the following hook:

    PHP:
    setup_plugin_hook('subscription_updated'xxx);
    If it does the function (where the xxx is above I don't know the name since I don't have the plugin) should have been called by aMember when you hit the "Save" button from the "Edit User" page. This should have caused your plugin for phpbb to update the user info in that database including the username. If it didn't then I think you found a bug in your plugin. I believe this same bug exists in SMF plugin from looking at the code where it does not update the username. I will have to try later to verify. Anyway I don't think rebuild is going to do anything for you (it shouldn't hurt) but I suspect your going to have to go in as admin of phpbb and manually change the username :(

    Jimmy
  9. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    This is for SkippyBosco. I don't have as much experience with vbullentin3 plugin. I actually bought it in anticipation of purchasing vbullentin3 but actually have not made the vbullentin3 purchase yet since I have been playing around with SMF instead. With that said since I have access to the vbullentin3 plugin code and I can say it appears to be one of the few plugins that tries to integrate both ways. In particular I believe that single sign-on works both ways, if you login to aMember then you are logged into vbullentin, if you login into vbullentin then you are logged into aMember. Passwords and login registrations in vBullentin are propogated into aMember. It appears that vBullentin has there own plugin hook mechanisms much like aMember. So Alex can hook into vBullentin at these level without having to modify any core vBullentin code.

    If you only want to push aMember users into the vBullentin database then you probably don't want to follow all of the vBullentin plugin readme instructions of doing the stuff in the vBullentin Admin CP. In particular the import of the file product-amember.xml. I believe this provides the hooks for vBullentin to integrate back into aMember member changes made from vBullentin.

    But in general I don't believe you are going to have any problems based on your requirements.

    Of course things are always trickier when your dealing with an existing installation versus a clean installation.

    Jimmy
  10. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    Okay I verified for the SMF plugin that it indeed has a bug in that it does not correctly update the username if it is changed. You might have the same issue with the phpbb plugin.

    For those using the SMF plugin you need to add the following line to function smf_updated where the new profile is being updated. This line was missing.

    PHP:
    profile[memberName] = $newmember[login];
    Based on your description I would guess you have the same problem in that a similiar line is missing in your plugin. Now that you are in this state I think your only course of action is to manually fix it from the phpbb side of things from an administrator account.

    Definitely enter a support ticket to get this problem fixed. I could probably fix it for you if I had access to the plugin code but I don't want to break any license agreements since I have not purchased the plugin.

    Jimmy
  11. seasons1

    seasons1 aMember Pro Customer

    Joined:
    Apr 25, 2008
    Messages:
    21
    Thanks Jimmy, I will get with support on it. The user name did update in the admin of PHPBB, but it will only let her login with the old username, her posts show as the new user name. Thanks for everyone's time in helping on this!
    :) Theresa
  12. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Thanks Jimmy for the detailed description. Very useful. I am setting this up on my sandbox and will report back.

Share This Page