QAT Application Rollback Procedure
Prerequisites
Before starting rollback, ensure you have:
- Previous commit hashes (saved during installation)
- Database backup (taken before installation)
- Access to both API and UI repositories
Rollback Steps
1. Database Rollback
- Connect to your MySQL database server
- Restore the previous database backup:
mysql -u [username] -p fasp < backup_$(date +%Y%m%d_%H%M%S).sql
2. UI Rollback
-
Navigate to the UI directory:
cd /home/ubuntu/GitRepo/fasp-core-ui
-
Stop the UI service:
pm2 stop QAT-React
-
Revert to previous commit:
git checkout $(cat /backup/fasp/ui_last_commit_$(date +%Y%m%d_%H%M%S).txt)
-
Clean and reinstall dependencies:
rm -rf node_modules
npm install -
Start the UI service:
pm2 start QAT-React
-
Verify the UI service status:
pm2 status
3. API Rollback
-
Navigate to the API directory:
cd /home/ubuntu/GitRepo/fasp-api
-
Stop the API service:
pm2 stop fasp-api
-
Revert to previous commit:
git checkout $(cat /backup/fasp/api_last_commit_$(date +%Y%m%d_%H%M%S).txt)
-
Rebuild and redeploy:
run sh buildAndDeploy.sh
-
Check the API logs:
tail -f /home/ubuntu/QAT/logs/qat/faspLogger.log
4. Post-Rollback Verification
-
Check service status:
pm2 status
-
Verify API endpoints are accessible
-
Verify UI is accessible through the browser
-
Test core functionality:
- User login
- Basic navigation
- Core features
-
Monitor logs for any errors:
# UI logs
pm2 log QAT-React
# API logs
tail -f /home/ubuntu/QAT/logs/qat/faspLogger.log
Troubleshooting
-
If services fail to start:
- Check logs for specific error messages
- Verify all dependencies are installed
- Confirm database connectivity
- Check file permissions
-
If database restore fails:
- Verify backup file exists and is not corrupted
- Check MySQL connection
- Ensure sufficient disk space
- Review MySQL error logs
-
If Git checkout fails:
- Verify commit hash exists
- Check for uncommitted changes
- Ensure proper repository access