View file File name : QUICK_FIX_GUIDE.md Content :# Quick Fix Guide - Google Drive 401 Error ## ⚡ 30 Second Fix You got the 401 error because **you haven't authorized Google Drive yet**. ### What To Do Right Now: 1. **Open your browser** ``` https://backup.alkashier.com ``` 2. **Find the "Connect Google Drive" button on the Dashboard** - It's a prominent button in the main area 3. **Click the button** - You'll be redirected to Google's login page 4. **Sign in with your Gmail** - Use the Gmail account you want to backup to 5. **Click "Allow" when asked to grant permissions** - The app needs permission to upload files 6. **You'll be redirected back** - Dashboard will show your Gmail email address - Button will change to "Disconnect Google Drive" 7. **Done!** ✓ - Now backups will automatically upload to Google Drive --- ## 📋 Then Proceed With Backups ### Add a Database to Backup: 1. Click **"Databases"** in the navigation menu 2. Click **"+ Add Database"** 3. Enter your database details: - **Name**: Any name (e.g., "Production DB") - **Host**: Your database server (e.g., localhost, 192.168.1.100) - **Port**: Usually 3306 - **Database**: The database name to backup - **Username**: Database user - **Password**: Database password 4. Click **"Save Database"** ### Run Your First Backup: 1. Go back to **Dashboard** 2. Find your database in the list 3. Click **"Backup Now"** 4. Wait a moment for the backup to complete 5. Go to **"Backup History"** to see the result You should see: - Status: ✓ Success - Google Drive: ✓ Uploaded - File size: (size of your backup) --- ## 🔄 Set Up Automated Backups ### Create a Backup Schedule: 1. Click **"Schedules"** in the navigation menu 2. Select your database 3. Choose frequency: - **Hourly**: Every hour - **Daily**: Every day at a specific time - **Weekly**: Every week on a specific day - **Monthly**: Every month on a specific date 4. Click **"Create Schedule"** ### Configure Cron Job (On Your VPS): For automated backups to actually run, you need to set up a cron job. **SSH into your VPS** and run: ```bash crontab -e ``` Add this line: ``` * * * * * cd /path/to/alkashier_backup && php artisan schedule:run >> /dev/null 2>&1 ``` Replace `/path/to/alkashier_backup` with your actual project path. Save and exit (Ctrl+X, then Y, then Enter). Now your scheduled backups will run automatically! --- ## ✅ Verification Checklist After following the above steps, verify everything works: - [ ] Dashboard shows your Gmail email - [ ] "Connect Google Drive" button changed to "Disconnect" - [ ] Added at least one database configuration - [ ] Ran a manual backup successfully - [ ] Saw success in Backup History - [ ] Created a backup schedule - [ ] Set up cron job on VPS --- ## 🆘 If Something Goes Wrong ### Issue: Still seeing 401 error **Solution**: - Make sure you **actually clicked the "Connect Google Drive" button** - Make sure you **signed in with Gmail** - Make sure you **clicked "Allow"** to grant permissions - Check that dashboard now shows your Gmail email ### Issue: Can't find "Connect Google Drive" button **Solution**: - You may already be authorized (check if button says "Disconnect") - Clear browser cache (Ctrl+Shift+Delete, then refresh) - Try a different browser ### Issue: Backup completes but doesn't upload to Google Drive **Solution**: - Verify Google Drive is connected (see email on Dashboard) - Check Backup History to see the actual error - See [TROUBLESHOOT_GOOGLE_DRIVE.md](TROUBLESHOOT_GOOGLE_DRIVE.md) ### Issue: Scheduled backups not running **Solution**: - Verify cron job is set up on your VPS: `crontab -l` - Make sure cron is running: `sudo systemctl status cron` - Test manually: `php artisan backups:run-scheduled` --- ## 📊 What Should Happen ### Backup History Should Show: | Database | Status | Google Drive | Size | Date | |----------|--------|--------------|------|------| | mydb | Success | Uploaded | 2.5 MB | 2024-12-03 15:30:00 | ### Dashboard Should Show: - **Gmail email** (your authorized account) - **Total Databases**: Number of databases configured - **Recent Backups**: List of latest backups - **Google Drive Status**: Connected --- ## 🚀 You're All Set! Once you've completed these steps, your backup system is: - ✓ Automatically backing up your databases - ✓ Automatically uploading to Google Drive - ✓ Running on a schedule you control - ✓ Keeping a history of all backups **Congratulations!** Your database backup system is ready to protect your data. 🎉 --- ## Need More Details? - **Complete setup guide**: [SETUP.md](SETUP.md) - **Google Drive troubleshooting**: [GOOGLE_DRIVE_SETUP.md](GOOGLE_DRIVE_SETUP.md) - **Technical explanation**: [GOOGLE_DRIVE_401_ERROR_EXPLAINED.md](GOOGLE_DRIVE_401_ERROR_EXPLAINED.md) - **Diagnostic commands**: [TROUBLESHOOT_GOOGLE_DRIVE.md](TROUBLESHOOT_GOOGLE_DRIVE.md)