Deleting only expired records

Discussion in 'Troubleshooting' started by underscoretom, Jan 2, 2007.

  1. underscoretom

    underscoretom Guest

    Joined:
    Aug 3, 2006
    Messages:
    22
    I know I can delete expired users...those users that only have expired memberships.

    But for users that have both active and expired memberships, I'm looking for a way to purge their expired memberships, w/o affecting the user record itself. It doesn't appear there's a way to do that through aMember

    Is it a safe assumption that deleting those expired memberships directly from the database is enough? Or are there other child tables I'd have to clear as well?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    yes, it is quite enough to delete from database
    DELETE FROM amember_payments WHERE expire_date < '2006-01-01';
    then run aMember CP -> Rebuild Db

    Please note - members without other subscriptions will become Pending instead of Expired after that.
  3. underscoretom

    underscoretom Guest

    Joined:
    Aug 3, 2006
    Messages:
    22
    THanks, that'll do it.
  4. cooltrader

    cooltrader New Member

    Joined:
    Apr 17, 2006
    Messages:
    9
    Unverified registrations

    Our sale are mainly yearly subscriptions and it is good to keep expired things as a record of our customers history. But - We get many registrations that are not completed via the verification email. It would be good to be able to clear these entries but keep the expired details in the database.
    Mick
  5. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    No need to delete expired subscriptions, keep it for history.

Share This Page