# cPanel Migration Checklist

## Phase 1: Local Preparation ✓ (DONE)

- [x] Update database credentials in all PHP files
- [x] New database name: `mahamusa_db`
- [x] New username: `mahamusa`
- [x] New password: `tCG!c&lpxW8Q`
- [x] Create migration guide documents

## Phase 2: Export Local Database

- [ ] **Step 1:** Open phpMyAdmin at http://localhost/phpmyadmin
- [ ] **Step 2:** Select database `login-table` from left sidebar
- [ ] **Step 3:** Click "Export" tab
- [ ] **Step 4:** Select "Custom" option
- [ ] **Step 5:** Look for "Data creation options" section
  - [ ] Check "CREATE TABLE"
  - [ ] Check "DROP TABLE"  
  - [ ] Check "Add DROP TABLE statement"
- [ ] **Step 6:** Click "Go" button
- [ ] **Step 7:** Save the downloaded SQL file as `database_backup.sql`
- [ ] **Step 8:** Store backup file safely on your computer

## Phase 3: Upload Website Files to cPanel

- [ ] **Step 1:** Compress `c:\xampp\htdocs\ecoms` folder into `ecoms.zip`
  - Right-click folder → "Send to" → "Compressed (zipped) folder"
- [ ] **Step 2:** Login to cPanel (your-domain.com:2083)
- [ ] **Step 3:** Open "File Manager"
- [ ] **Step 4:** Navigate to `public_html` folder
- [ ] **Step 5:** Click "Upload" button
- [ ] **Step 6:** Select your `ecoms.zip` file
- [ ] **Step 7:** Wait for upload to complete
- [ ] **Step 8:** Right-click on `ecoms.zip` and select "Extract"
- [ ] **Step 9:** Delete the `ecoms.zip` file

**OR use FTP if preferred:**
- [ ] Create FTP account in cPanel
- [ ] Connect with FileZilla/WinSCP
- [ ] Upload all files from ecoms to public_html/ecoms

## Phase 4: Create Database in cPanel

- [ ] **Step 1:** In cPanel, find "MySQL Databases"
- [ ] **Step 2:** Click "Create New Database"
- [ ] **Step 3:** Enter name: `mahamusa_db`
- [ ] **Step 4:** Click "Create Database"
- [ ] **Step 5:** Scroll down to "MySQL Users"
- [ ] **Step 6:** Click "Create New User"
- [ ] **Step 7:** Enter:
  - Username: `mahamusa`
  - Password: `tCG!c&lpxW8Q`
- [ ] **Step 8:** Click "Create User"
- [ ] **Step 9:** Scroll to "Add User to Database"
- [ ] **Step 10:** Select user: `mahamusa`
- [ ] **Step 11:** Select database: `mahamusa_db`
- [ ] **Step 12:** Click "Add"
- [ ] **Step 13:** Check ALL privileges when prompted
- [ ] **Step 14:** Click "Make Changes"

**Note the actual names cPanel assigned:**
- Database name: `___________________` (might have account prefix)
- Username: `___________________` (might have account prefix)

## Phase 5: Import Database to cPanel

- [ ] **Step 1:** In cPanel, click "phpMyAdmin"
- [ ] **Step 2:** Login if prompted
- [ ] **Step 3:** Select the database: `mahamusa_db`
- [ ] **Step 4:** Click "Import" tab
- [ ] **Step 5:** Click "Choose File"
- [ ] **Step 6:** Select your `database_backup.sql` file
- [ ] **Step 7:** Click "Import" button
- [ ] **Step 8:** Wait for import to complete (can take a few minutes)
- [ ] **Step 9:** Look for "Import has been successful" message
- [ ] **Step 10:** Verify tables appear in database

## Phase 6: Test Your Website

- [ ] **Step 1:** Open browser and visit `your-domain.com/ecoms`
- [ ] **Step 2:** Check homepage loads properly
- [ ] **Step 3:** Check products/categories display
- [ ] **Step 4:** Test admin login at `your-domain.com/ecoms/admin_login.php`
- [ ] **Step 5:** Check admin dashboard works
- [ ] **Step 6:** Test product add/edit functionality
- [ ] **Step 7:** Verify database queries work
- [ ] **Step 8:** Check all pages load without errors

## Troubleshooting

### If you see "Connection refused" error:
- [ ] Verify database was created in cPanel
- [ ] Verify user was created in cPanel
- [ ] Check user has privileges for the database
- [ ] Contact cPanel support

### If you see "Access denied for user" error:
- [ ] Verify password is: `tCG!c&lpxW8Q`
- [ ] If wrong, reset password in cPanel → MySQL Users
- [ ] Update password in db_config.php if needed

### If you see "Unknown database" error:
- [ ] Check database name in cPanel (it might have prefix)
- [ ] Update database name in db_config.php if needed

### If files return 404 error:
- [ ] Check files are in `public_html/ecoms` folder
- [ ] Verify folder structure matches local setup
- [ ] Check file permissions (should be 644)

## Final Verification

- [ ] Website homepage loads at your domain
- [ ] Products page displays items from database
- [ ] Admin login works
- [ ] Admin can add/edit products
- [ ] All database queries execute successfully
- [ ] No errors in cPanel error logs

## After Migration Complete

- [ ] Remove old local XAMPP installation if not needed
- [ ] Setup SSL certificate (usually free in cPanel)
- [ ] Setup automatic backups in cPanel
- [ ] Configure email accounts if needed
- [ ] Setup domain redirects if needed

---

## Notes & Important Info

**cPanel Account Details:**
- Domain: ___________________
- cPanel URL: ___________________
- cPanel Username: ___________________
- FTP Address: ___________________
- Database Prefix: ___________________

**Database Details (as assigned by cPanel):**
- Actual Database Name: ___________________
- Actual Username: ___________________
- Password: tCG!c&lpxW8Q

**Files to Keep Safe:**
- [ ] Local backup of database_backup.sql
- [ ] Local backup of all PHP files
- [ ] List of cPanel credentials (store securely)

---

**Status: READY FOR DEPLOYMENT** ✅

All PHP files have been updated with the new credentials.
Now follow the steps above to complete the migration.

Good luck! 🚀
