Openfire SQL housekeeping

We have been using openfire for a couple of years now and have not had any issues. We use LDAP to query our AD for user logon and VCard.

I have however come across an issue within the DB. When a user leaves our organisation the account is disabled and moved to a “leavers” OU. This is outside of the target base DN for our LDAP query so the user account is removed from Openfire.

The DB however keeps hold of all the old information for that user - VCard, Rosters etc.

Is there a way to clear out all this old information from the DB itself? im not a DBA but am competent enough with SQL to look at a scheduled job potentially but what would I query against there is no “Users” table as its all in AD.

Why no user table? You can make SQL queries to AD from SQL server, using ADSI linked server (google SQL ADSI)

You can select logins from OU Leavers and compare result set with openfire tables, then remove unneeded rows.