MPWA Node Backend - Migration Package
======================================

What's inside (from your original app.zip, node_modules removed):
- server.js              - main entry point
- server/                - all controllers, routes, database, lib code
- package.json / package-lock.json
- .env                   - your existing config (DB, ports, WA_URL_SERVER, license, mail)
- credentials/           - your LIVE WhatsApp session data for already-connected
                            numbers (8801329646688, 8801728430880) - keeping this
                            means those numbers won't need to re-scan QR after the move.

NOT included (on purpose):
- node_modules/  -> run "npm install" fresh on the new server instead
                     (copying node_modules across servers/OS versions can break
                     native packages)
- Laravel files (app/, routes/, vendor/, artisan, etc.) -> not needed, WHMCS
  addon replaces that layer entirely

Before you upload to the new host, check/update in .env:
1. PORT_NODE            - port the new host's Node.js Selector assigns you
2. DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORD
   -> if using Option A (remote MySQL to old DB), keep host as-is but make
      sure the new server's IP is whitelisted in old cPanel's Remote MySQL
   -> if using Option B (fresh DB on new host), update all of these
3. WA_URL_SERVER         - update if this domain itself changes

Steps on the new host:
1. Upload this zip via cPanel > Setup Node.js App > your app's File Manager,
   or via File Manager directly into the app's root folder, then extract.
2. Edit .env as above.
3. In cPanel > Setup Node.js App > your app > click "Run NPM Install".
4. Start/Restart the app.
5. Test the polling endpoint directly in browser:
   https://your-new-domain/socket.io/?EIO=4&transport=polling
   You should see something like: 0{"sid":"...","upgrades":["websocket"],...}
6. Update the "Node Backend URL" in WHMCS > Addon Modules > MPWA Gateway >
   Configure to the new domain.
7. Try connecting a device from the WHMCS client area again.

Security reminder: .env contains plaintext DB/mail passwords and your license
key. Don't share this zip publicly or commit it anywhere.
