🆙 Upgrade Guide (v3.7.0)
Keeping your WhatsApp Bridge Service up to date ensures you have the latest security patches, performance optimizations, and features like the v3.7.0 Analytics Dashboard.
🛠️ Option 1: The Automated Script (Recommended)
Beginning with v3.7.0, we provide a hardened upgrade script that handles backups, dependency refreshes, and environment variable synchronization automatically.
Running the Script:
- Connect to your server via SSH.
- Navigate to the bridge directory.
- Execute:bash
chmod +x scripts/upgrade.sh ./scripts/upgrade.sh
What the script does:
- Safety Backup: Creates a
.tar.gzarchive of your current files (excludingnode_modules). - Git Sync: Pulls the latest code from the
masterbranch. - Env Sync: Automatically detects missing v3.7.0 keys (like
API_KEYandSESSION_SECRET) and appends them to your.envwith secure random values. - Dependency Refresh: Runs
npm installto update core libraries. - Idempotent Restart: Restarts the service via PM2.
🔧 Option 2: The Manual Upgrade
If you prefer full control or are using a custom Git workflow, follow these 4 critical steps:
1. Pull Latest Code
git fetch --all
git reset --hard origin/master2. Refresh Dependencies
New features in v3.7.0 require pino, sqlite3, and multer.
npm install --omit=dev3. Update Environment Variables
Open your .env file and ensure the following keys are present:
API_KEY: Your static security key.SESSION_SECRET: A random string for dashboard sessions.WHATSAPP_AUTH_DIR: Typically set to./auth.MAX_RETRIES: Reconnection limit (e.g., 3).
4. Cleanup Legacy Files
In v3.7.0, the monolithic server.js was moved to src/server.js.
- Action: Rename or delete any
server.jsordatabase.jsfiles remaining in your root directory to avoid naming conflicts with the new modular structure. - Entry Point: Ensure your PM2 or startup script points to
src/index.js.
🖥️ Option 3: Remote Update (Dashboard)
If you have already upgraded to v3.1.0+, you can synchronize your repository directly from the Admin Panel:
- Navigate to the "Security" tab in the Dashboard.
- Click "Sync Repository (Git Pull)".
- Click "Soft Reboot" to apply changes.
CAUTION
Persistence Warning: Always ensure your auth/ directory is untouched during upgrades. This folder contains your active WhatsApp link. If you lose it, you will need to re-scan the QR code.
