AWS PostgreSQL 13 to 16.9 Upgrade
This comprehensive guide covers upgrading your AWS RDS PostgreSQL from version 13 to 16.9 and configuring SSL certificates for ToolJet across different deployment methods: Docker, AMI, ECS, and EKS.
Pre Requisites
- Existing ToolJet deployment with PostgreSQL 13
- AWS RDS PostgreSQL 13 instance
- Administrative access to your deployment environment
- Backup of your existing database
Critical Safety Measures and Testing Strategy
⚠️ MANDATORY: Before upgrading your production database, follow this comprehensive safety and testing approach:
Phase 1: Production Database Snapshot and Clone Testing
-
Create Production Database Snapshot
- Using AWS CLI
- Using AWS Console
# Create a snapshot of your production database
aws rds create-db-snapshot \
--db-instance-identifier your-production-db \
--db-snapshot-identifier production-pg13-snapshot-$(date +%Y%m%d-%H%M)
# Wait for snapshot completion
aws rds wait db-snapshot-completed \
--db-snapshot-identifier production-pg13-snapshot-$(date +%Y%m%d-%H%M)- Navigate to RDS Console → Databases
- Select your production PostgreSQL 13 instance
- Click Actions → Take snapshot
- Enter snapshot identifier:
production-pg13-snapshot-YYYYMMDD-HHMM
- Add description:
Pre-upgrade snapshot for PostgreSQL 16.9 testing
- Click Take snapshot
- Wait for snapshot status to show Available (5-15 minutes)
-
Create Test Database from Snapshot
- Using AWS CLI
- Using AWS Console
# Restore snapshot to a new test database instance
aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier test-db-pg13-clone \
--db-snapshot-identifier production-pg13-snapshot-$(date +%Y%m%d-%H%M) \
--db-instance-class db.t3.medium \
--availability-zone your-az \
--no-publicly-accessible- Go to RDS Console → Snapshots
- Find your snapshot:
production-pg13-snapshot-YYYYMMDD-HHMM
- Select the snapshot and click Actions → Restore snapshot
- Configure the restored database:
- DB instance identifier:
test-db-pg13-clone
- DB instance class:
db.t3.medium
(or same as production) - Storage: Keep default settings from snapshot
- Availability Zone: Same as production
- VPC security groups: Same as production (for testing)
- Public accessibility: No (for security)
- DB instance identifier:
- Click Restore DB instance
- Wait for status to show Available (10-20 minutes)
-
Upgrade Test Database to PostgreSQL 16.9
- Using AWS CLI
- Using AWS Console
# Upgrade the cloned test database
aws rds modify-db-instance \
--db-instance-identifier test-db-pg13-clone \
--engine-version 16.9 \
--apply-immediately
# Monitor upgrade progress
aws rds describe-db-instances \
--db-instance-identifier test-db-pg13-clone \
--query 'DBInstances[0].DBInstanceStatus'- Go to RDS Console → Databases
- Select your test database:
test-db-pg13-clone
- Click Modify
- In Engine options:
- Engine version: Select
16.9
- Engine version: Select
- In Scheduling of modifications:
- Select Apply immediately
- Click Continue
- Review changes and click Modify DB instance
- Wait for modification to complete (15-30 minutes)
- Verify Engine version shows
16.9
in database details
Phase 2: Staging Environment Testing
-
Deploy Staging ToolJet Instance
- Set up staging environment using your preferred deployment method:
- Docker: Follow Docker deployment section below
- AMI: Follow AMI deployment section below
- ECS: Follow ECS deployment section below
- EKS: Follow EKS deployment section below
- Configure staging to use the upgraded test database:
- Update your configuration files (.env, task definitions, etc.)
- Use the test database endpoint:
test-db-pg13-clone.xxxxxxxxxx.your-region.rds.amazonaws.com
- Configure SSL certificates as detailed in your deployment method section
- Set up staging environment using your preferred deployment method:
-
Comprehensive Staging Testing
🔍 Test all critical functionality:- Application Startup:
# Verify ToolJet starts successfully (adjust command based on deployment method)
# Docker: docker-compose logs tooljet | grep "TOOLJET APPLICATION STARTED SUCCESSFULLY"
# AMI: sudo journalctl -u tooljet | grep "TOOLJET APPLICATION STARTED SUCCESSFULLY"
# ECS: aws logs filter-log-events --log-group-name /ecs/tooljet --filter-pattern "TOOLJET APPLICATION STARTED SUCCESSFULLY"
# EKS: kubectl logs deployment/tooljet -n tooljet | grep "TOOLJET APPLICATION STARTED SUCCESSFULLY" - Database Connectivity Testing:
# Test connection to upgraded database (adjust based on deployment)
psql "postgresql://username:password@test-db-endpoint:5432/database?sslmode=require" -c "SELECT version();"
# Should show: PostgreSQL 16.9 - Feature Testing Checklist:
- User login and authentication
- Workspace creation and access
- Application building and editing
- Data source connections
- Query execution and data display
- User management and permissions
- Application deployment and sharing
- API functionality
- File uploads and downloads
- Email notifications (if configured)
- Performance Testing:
- Monitor response times for common operations
- Check query performance improvements
- Verify memory usage is stable
- SSL Certificate Validation:
- Verify no SSL connection errors in logs
- Test secure connections work properly
- Application Startup:
Phase 3: Production Upgrade Planning
-
Document Findings and Plan Production Upgrade
- Create test results document:
PostgreSQL 16.9 Upgrade Test Results
===================================
Test Environment:
- Database: test-db-pg13-clone (cloned from production)
- ToolJet Version: [version]
- Deployment Method: [Docker/AMI/ECS/EKS]
- Test Date: [date]
Functionality Test Results:
- User Authentication: ✅ Working
- Workspace Access: ✅ Working
- Application Building: ✅ Working
- Data Sources: ✅ Working
- [Add all test results...]
Performance Observations:
- Query Response Time: [improvement/same/degradation]
- Application Load Time: [timing]
- Memory Usage: [stable/issues]
Issues Found: [None / List any issues]
Recommended Production Upgrade: ✅ Proceed / ❌ Needs fixes - Plan production maintenance window:
# Based on staging test results, plan for:
# - Database upgrade time: ~15-30 minutes
# - Application configuration updates: ~5-10 minutes
# - SSL certificate setup: ~5 minutes
# - Testing and verification: ~10-15 minutes
# Total estimated downtime: 35-60 minutes
- Create test results document:
Phase 4: Production Upgrade Execution
-
Communicate and Execute Production Upgrade
- User Communication Requirements:
- Inform all users about the planned downtime in advance
- Execute production upgrade following the exact same steps as tested in staging
- User Communication Requirements:
Additional Safety Measures
Rollback Strategy
If issues are discovered during production upgrade:
- Point back to original database (Fastest)
- Update ToolJet configuration to use original PostgreSQL 13 database
- Keep original database running until upgrade is fully verified
- Restore from snapshot
Using AWS Console:- Go to RDS Console → Snapshots
- Find:
production-pg13-snapshot-YYYYMMDD-HHMM
- Click Actions → Restore snapshot
- Use original database identifier
- Restore with same configuration as original
Post-Upgrade Monitoring
- AWS Console Monitoring:
- Go to RDS Console → Databases → Your database
- Click on Monitoring tab
- Watch these metrics:
- Database connections
- CPU utilization
- Read/Write IOPS
- Database connection failures
- Application Monitoring (adjust commands based on deployment method):
# Check application logs
# Docker: docker-compose logs tooljet | tail -50
# AMI: sudo journalctl -u tooljet | tail -50
# ECS: aws logs tail /ecs/tooljet
# EKS: kubectl logs deployment/tooljet -n tooljet --tail=50
# Verify database version
psql "postgresql://user:pass@endpoint:5432/db?sslmode=require" -c "SELECT version();"
Cleanup After Successful Upgrade
After 1-2 weeks of stable operation:
- Using AWS Console:
- Delete test database: Go to RDS Console → Select
test-db-pg13-clone
→ Actions → Delete - Keep production snapshot: Retain for disaster recovery (can be automated to delete after 30 days)
- Delete test database: Go to RDS Console → Select