Update Lead System - Dashboard Installer

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000109085

The Install New Updates module on the admin dashboard lists one-time platform installers that still have pending steps on the site. Clicking the green Check For Updates button refreshes the list — an installer only appears when the site actually has something left to install, and it disappears from the list once its steps are complete.

What Update Lead System Does

This installer brings the Lead System (the feature that captures visitor inquiries, stores them as leads, and matches them to the site's members) up to the current platform format. It creates the database tables the Lead System needs, seeds a default flow and default action, adds the newer columns that lead records now use, moves older lead data into place, and turns the system on. It updates database structure and relocates existing lead data into the current format. It does not delete the leads.

The installer runs fifteen separate steps. The database changes it makes are:

  • Creates three tables if they are missing. The data_flows table (which stores the lead flows), the data_flow_actions table (which stores the settings for each flow, EG which email templates and auto-match options a flow uses), and the form_inquiries table (which stores contact-form inquiries). Each table is created only if it does not already exist.
  • Seeds a default flow and default action. If no flow named default_flow exists, it inserts one into data_flows. If no main action exists (a row in data_flow_actions marked main_flow_action = 1), it inserts a "Main Action" record with the standard template and auto-match defaults.
  • Cleans up the leads table. It removes a set of unused legacy columns from the leads table (EG lead_address, lead_city, lead_state, lead_zip, lead_source, and others). Each column is dropped only if it holds no data, so populated columns are left untouched.
  • Adds the newer lead columns. It adds any missing columns that the current Lead System uses to the leads table, including lead_message, top_id, sub_id, the location fields lat, lng, swlat, swlng, nelat, nelng, location_type, lead_location, country_sn, and adm_lvl_1_sn, plus flow_source, formname, lead_notes, and origin_ip. Only columns that are not already present are added.
  • Migrates older lead data. For leads whose details are still stored in the users_meta table, it copies those values into the matching columns on the leads table (in batches of 2,000) and then removes the migrated rows from users_meta.
  • Adds a form column. It adds the form_action_type column to the forms table if that column is missing.
  • Fixes lead match statuses. It adds the lead_status_was_update column to the lead_matches table if missing, then remaps older lead_status values to their current equivalents for leads that use the new format, marking each row it updates so it is not touched again.
  • Updates the search engine reference. On any flow still set to the old value "Get Matched Search Engine", it updates the search_engine field in data_flows to the current value "Search - Member - Search Query".
  • Turns the Lead System on. It sets the enable_data_flows setting in website_settings to 1 (the Basic Package), creating the setting if it does not exist, and sets the enable_member_search_and_lead_matching_system setting to 1 so the current member-search and lead-matching widgets are active.
  • Standardizes the contact form email field. If the site uses a customized contact_form whose email field is named email, it renames that field to inquiry_email in form_fields so inquiries are captured correctly. Sites using the master contact form are left as-is.
  • Offers a cache refresh as the final step.

Why It Appears

Each step runs its own check against the database, and the installer appears whenever at least one of those checks finds the site still on the older format. In plain terms, it shows up when one of the Lead System tables is missing, when the default flow or action has not been created, when the leads table still has legacy columns or is missing the newer ones, when older lead data still lives in users_meta, when the form_action_type or lead_status_was_update columns are missing, when a flow still references the old search engine value, or when the Lead System settings are not yet enabled.

These are legacy conditions. Sites set up more recently already have the Lead System in the current format, while older databases created before these updates became standard will see this installer offered. Seeing it does not mean anything is broken. It means the database predates one or more of these Lead System updates.

Why It Matters

Running the installer puts the Lead System on the current structure the platform expects: the tables, columns, default flow, and settings that inquiry capture and lead matching rely on. It also moves older lead details into the current lead columns so that data displays and behaves consistently. Skipping it will not delete anything, but the Lead System features may not work as intended on the older structure, and older lead data may stay in a place newer screens do not read from.

How to Run It

  1. From the admin dashboard, find the Install New Updates module and click Check For Updates.
  2. If the site has pending steps, Update Lead System appears in the list. Click Install.
  3. After it completes, click Check For Updates again. The entry disappears once all steps are done.

If Update Lead System does not appear in the list, the website is already up to date. The module only shows installers with pending steps, so there is nothing to do.

After Running

Nothing changes visibly on the website. The updates are internal: the leads, inquiries, and forms keep their existing data, older lead details are moved into the current lead columns rather than discarded, and the Lead System settings are switched on. There is nothing to reconfigure afterward, though the final step offers a refresh of the site cache.

Each step re-checks the database before making changes and only applies what is still missing. Tables are created only when absent, columns are added only when not present, legacy columns are dropped only when empty, and the status fix marks every row it updates so it is not changed twice. That makes the installer safe to run again even if part of the update was already applied earlier.