LUMIERE FULL IMPORT v1

WHAT IT DOES
- Adds normalized GHL tables without deleting existing data.
- Imports all GHL contacts using pagination.
- Imports all GHL opportunities using pagination.
- Imports pipelines/stages, calendars, users, custom-field definitions and tags.
- Imports Oryx patients from a configurable historical start date (default 2000-01-01).
- Uses UPSERT logic so rerunning updates records instead of duplicating them.
- Records every import in sync_runs.
- Keeps raw JSON for debugging/future fields.

HOW TO RUN
1. Back up files + database.
2. Upload this folder over/copy beside your existing Lumiere project.
3. Open /import/install_schema.php once.
4. Open /import/import_ghl.php and wait for completion.
5. Open /import/import_oryx_patients.php?start=2000-01-01 and wait for completion.
6. In phpMyAdmin inspect sync_runs and table row counts.

IMPORTANT
- Do NOT repeatedly refresh while an import is running.
- GHL and Oryx can rate-limit/timeout large imports. If the host kills a long browser request, run scripts through cPanel Terminal/SSH with PHP CLI.
- This v1 imports resources already proven accessible by the diagnostic. Oryx appointments/payments/procedures are not included because no verified endpoint was present in the inherited project.
- The old get_opportunities.php is preserved for reference; use import/import_ghl.php for the new full import.
