Rebuild ./. Resync

Discussion in 'Customization & add-ons' started by draj, Feb 15, 2007.

  1. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hallo Alex!

    1.
    I have copied rebuild.php to resync.php and have given respective link in the /admin/menu.inc.php to activate it.

    2.
    I copied the function function plugin_subscription_rebuild() entirely and renamed to function plugin_subscription_resync().

    I have renamed all instance of the term "rebuild" to "resync" in the files: plugins.inc.php, resync.php and myplugin.inc.php, especially in the function plugin_subscription_resync().

    (Ha, i did not forget to delete the command: ignore_user_abort)

    3.
    Executing the resync function plugin_subscription_resync(), some hooks/codes of amember is running the subroutine of rebuild.

    My intention is to develop a system of resyncronisation and importing users from the myplugin database live. Hence by clicking on resync.php, it will execute functions that i code.

    Here, i intend to code in the function plugin_subscription_resync() several data transfers from one table to anathor, like exporting from aMember to the integration database and viseversa.

    So i would use the plugin architecture and sidetrack the rebuild.

    My question:

    A:
    Is there something more that i need to de-activate elsewhere to stop it rebuilding and execute only my custom code?

    B:
    The resync.php is taking a longtime to execute. It is perhaphs executing the

    while (list($m, $d, $s) = mysql_fetch_row($q))

    I however do not need to update the data field, do i?

    Is there something here that i can change or deactivate or perhaphs deactivate/delete the "while" completely?
  2. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hallo Alex!

    Also the insertion and update of subscription is deactivated during the rebuild process is going on.

    Is this correct? Is this to avoid conflicts?
  3. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Yes, it is correct. You have to click "Rebuild Db" after upgrade, else it takes too much time.
  4. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hi Alex!

    Does this mean that after each import of users in the account_members table, one _HAS_ to run the rebuild.

    Having 40.000 users and importing 40 users makes the concept of rebuilding all 40.000 users _NOT_WORKABLE_ in every case.

    However, if the rebuild would handle only 40 newly imported users to the first subscription as registered users, things would be ofcourse different.

    Is there a different solution for this?
  5. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    No.
    Rebuilding 40000 users should be workable, but may require some attention.
  6. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hi!

    Thanks for the answer.

    Rebuild takes 6 hours. I have seen that there is no other way and make it faster.

    Also during the rebuilds the script cannot use anyx plugin and all the plugins are deactivated. Hence no addition of new members, etc..
  7. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
  8. XUnleash

    XUnleash Member

    Joined:
    Aug 29, 2006
    Messages:
    34
    Try rebuilding our database of 600,000 users!

    Its impossible the script will just not run.
  9. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hi,
    Yes. It is foolish indeed to use amember. I tried to use it during the time when I did not know about amember very much.

    After having a look into many things, I did realise that it was one of the most foolish things I ever did!

    Just simply make some SQL Quries and have your database going. It took me less then five min. to achieve my targets as compared to the stupid headaches working with amember scripts.

    So I strongly advise NOT TO USE the rebuild scripts unless you erally need it to have the data field tuned and recalculated.

    From experience, I do remember that I did not follow some instructions by Alex regarding the data-status field and that helped me a lot. I have till not understood why he is in love with binary fields in a table.
  10. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    Rebuild in chunks .. try my util :)
  11. microlinx

    microlinx aMember Pro Customer

    Joined:
    Oct 26, 2004
    Messages:
    268
    Hey Draj, you seem to know a lot about the technical side of aMember, maybe you can help on this...you too jenolan....

    I installed the coppermine plugin, (coppermine is on the same server in a subdomain of the main site), the db settings seem ok, since no errors reported. But when I return to the main page, the MySQL staus now shows three errors as follows:

    WARNING: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in line 54 of file SmartyNoWrite.class.php(216) : eval()'d code

    WARNING: mysql_query() [function.mysql-query]: A link to the server could not be established in line 54 of file SmartyNoWrite.class.php(216) : eval()'d code

    WARNING: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in line 54 of file SmartyNoWrite.class.php(216) : eval()'d code

    Then, when I try to do a rebuild, I get the following error (I originally had php.ini set at 16Mb and it ate that up quickly, so I reset to 64Mb)...

    Please wait. Rebuild in process ....
    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2048 bytes) in /home/barplans/public_html/member/rconfig-zend.inc.php-bin on line 163


    I opened a ticket but they simply deleted the status display in admin/blank.html
    so now nothing shows in the MySQL status area... nice fix, eh? Rebuild error still exists.
    Should I again increase the php.ini setting? Well that affect anything else? It is a dedicated server with 1Gb RAM.

    BTW, when I checked the user area in Coppermine, I show a BUNCH of new members with todays date, so it seems to be working, partially...but dying in the process.

    Any ideas are welcome.
  12. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    Dunno that sounds like more than one error (or something weirdo) http://www.jlogica.com/apps/hd/ is my help desk I would need admin access to amember (etc) and probably ftp can't say I will be free (ie $0) as I have other work coming out of my ears ;)
  13. microlinx

    microlinx aMember Pro Customer

    Joined:
    Oct 26, 2004
    Messages:
    268
    jenolan:

    It's no big deal really, by the time it gets worked out a new version may be released...(wishful thinking). I would have expected those who sold it to me in the first place to fix it in one shot, but since that didn't work, I figured I'd pass it through the forum to see if anyone had a quick fix.
  14. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    To fix this you can change memory_limit in php.ini or if you unable to do this contact us in helpdesk and I will modify rebuild to work in portions. I will need access to your server.

Share This Page