Skip to main content

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

  1. Create Production Database Snapshot

    # 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)
  2. Create Test Database from Snapshot

    # 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
  3. Upgrade Test Database to PostgreSQL 16.9

    # 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'

Phase 2: Staging Environment Testing

  1. Deploy Staging ToolJet Instance

    1. 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
    2. 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
  2. Comprehensive Staging Testing
    🔍 Test all critical functionality:

    1. 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"
    2. 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
    3. 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)
    4. Performance Testing:
      • Monitor response times for common operations
      • Check query performance improvements
      • Verify memory usage is stable
    5. SSL Certificate Validation:
      • Verify no SSL connection errors in logs
      • Test secure connections work properly

Phase 3: Production Upgrade Planning

  1. Document Findings and Plan Production Upgrade

    1. 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
    2. 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

Phase 4: Production Upgrade Execution

  1. Communicate and Execute Production Upgrade

    1. User Communication Requirements:
      • Inform all users about the planned downtime in advance
    2. Execute production upgrade following the exact same steps as tested in staging

Additional Safety Measures

Rollback Strategy

If issues are discovered during production upgrade:

  1. Point back to original database (Fastest)
    • Update ToolJet configuration to use original PostgreSQL 13 database
    • Keep original database running until upgrade is fully verified
  2. Restore from snapshot
    Using AWS Console:
    1. Go to RDS ConsoleSnapshots
    2. Find: production-pg13-snapshot-YYYYMMDD-HHMM
    3. Click ActionsRestore snapshot
    4. Use original database identifier
    5. Restore with same configuration as original

Post-Upgrade Monitoring

  1. AWS Console Monitoring:
    1. Go to RDS ConsoleDatabases → Your database
    2. Click on Monitoring tab
    3. Watch these metrics:
      • Database connections
      • CPU utilization
      • Read/Write IOPS
      • Database connection failures
  2. 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:
    1. Delete test database: Go to RDS Console → Select test-db-pg13-cloneActionsDelete
    2. Keep production snapshot: Retain for disaster recovery (can be automated to delete after 30 days)