# LeadPilot — Upgrade & Maintenance Guide

**Document Version:** 1.0.0 (Phase 25)

---

## 1. Standard Upgrade Procedure

1. **Backup Database & Storage:**
   ```bash
   mysqldump -u root -p leadpilot > backup_leadpilot_$(date +%F).sql
   tar -czf backup_storage_$(date +%F).tar.gz storage/app
   ```
2. **Enable Maintenance Mode:**
   ```bash
   php artisan down --message="LeadPilot is updating. Please check back shortly."
   ```
3. **Pull/Extract Latest Release Files:**
   Replace the application codebase with the new release files.
4. **Run Database Migrations:**
   ```bash
   php artisan migrate --force
   ```
5. **Clear Application Cache & Restart Scheduler:**
   ```bash
   php artisan optimize:clear
   php artisan up
   ```
