CMS PHARMACY BILLING PRO — EASY RESTORE + DATED EMAIL BACKUP

RESTORE WITHOUT A CODE
1. Open Billing Pro > Settings > Backup.
2. Select Import JSON Backup and choose the dated cms-pharmacy-backup-YYYY-MM-DD.json attachment/file.
3. Confirm the displayed backup date. The app saves a local safety snapshot first, validates the data structure, then restores.
4. After restore, verify item, sale, purchase and firm counts.

BACKUP DATE
Every downloaded/email JSON backup includes format=CMS-PHARMACY-BACKUP-V2, backup_date (ISO timestamp), backup_date_local (India timezone by default), and the actual data under data. The filename also includes the date. Older plain JSON backups remain importable.

OPTIONAL DAILY EMAIL BACKUP
1. Set BACKUP_EMAIL_ENABLED=1 in db_config.php.
2. Set BACKUP_EMAIL_FROM to a valid sender address on your domain.
3. Configure Hostinger mail delivery.
4. Schedule cron_email_backup.php once daily using BACKUP_CRON_TOKEN. Keep the cron token private.
5. Test using a non-sensitive account and inspect the response for email_sent/email_failed.

IMPORTANT PRIVACY TRADE-OFF
To allow restore without a decryption key/code, email attachments are ordinary dated JSON and are NOT encrypted. They may contain sensitive business and customer information. Enable only if you accept this risk, secure the email account with a strong password and 2FA, and restrict mailbox access. If encryption is required, a key/passphrase is inherently needed to decrypt.

OFFLINE BACKUP
Browser-local snapshots remain device-specific. Download a JSON backup and copy it to USB or another offline storage device. Email is an online copy, not an offline backup.
