# Migration to V8 Commerce

1. Back up the database and `config.php`.
2. Replace the old source files with V8.
3. Open the bot or Web Panel once. Commerce tables are created automatically through `config.php`.
4. Confirm `storage/` is writable by PHP. V8 creates `storage/.commerce_master.key` with restrictive permissions.
   After the key is generated, include `storage/.commerce_master.key` in private server backups. Existing encrypted Website Connector secrets cannot be decrypted on a new server without the same key.
5. Open `panel/commerce.php` or Telegram Admin → `iTz Commerce Hub`.
6. If no website is used, stop here. Commerce is optional.
7. To connect a website, create one Connector. Copy the generated API Key and Webhook Secret immediately; they are intentionally shown only once.
8. Put the three required values into the website environment:
   - Commerce API endpoint
   - API Key
   - Webhook Secret
9. Use `commerce-site-kit/` as the integration reference.
10. The website must verify payment through its real payment gateway before calling `payment.success`.

No owner-specific domain, server IP, personal gateway key, Bot Token or other private infrastructure is embedded in the release.
