Articles in this section

Migrating Bold Reports from EC2 Docker to ECS Fargate

Published:
Updated:

Objective

To migrate the Bold Reports application from a single-container Docker deployment in an EC2 instance to a scalable ECS Fargate-based architecture, ensuring data consistency and minimal downtime.

Step 1: Backup PostgreSQL Database

  • Access the PostgreSQL container
  • Take a database backup using:
docker exec postgres pg_dump -U postgres bold_services > bold_services_backup.sql 
  • Copy the backup file to a safe location

Step 2: Backup app_data Folder

  • Locate the app_data directory inside the container or mounted volume
  • Compress and back up:
tar -czvf app_data_backup.tar.gz app_data/ 

Migration to ECS Fargate:

Deploy Bold Reports application in ECS fargate using the documentation below:

Document : Deploy Bold reports on ECS Fargate

Step 3: Create Application Load Balancer

  • Create an Application Load Balancer
  • Configure:
    • Listener (HTTP/HTTPS)
    • Security groups
    • Subnets
      image.png

Step 4: Create Target Group

  • Create target group for ECS service
  • Configure:
    • Target type: IP
    • Port: Application port (e.g., 80)
    • Health check path

step 5: Create Task Definition:

  • Use Bold Reports Docker image
  • Configure CPU & memory
  • Add environment variables
  • Configure port mappings

Example task definition:

{
   "taskDefinitionArn": "<task-definition-ARN>",    //provide the task definition ARN here
   "containerDefinitions": [
       {
           "name": "boldreports",
           "image": "syncfusion/boldreports",
           "cpu": 0,
           "portMappings": [
               {
                   "name": "port",
                   "containerPort": 80,
                   "hostPort": 80,
                   "protocol": "tcp",
                   "appProtocol": "http"
               }
           ],
           "essential": true,
           "environment": [],
           "mountPoints": [
               {
                   "sourceVolume": "boldreports-EFS",
                   "containerPath": "/application/app_data",
                   "readOnly": false
               },
               {
                   "sourceVolume": "boldreports-nginx",
                   "containerPath": "/etc/nginx/sites-available",
                   "readOnly": false
               }
           ],
           "volumesFrom": [],
           "logConfiguration": {
               "logDriver": "awslogs",
               "options": {
                   "awslogs-group": "/ecs/boldreports",
                   "awslogs-region": "us-east-1",
                   "awslogs-stream-prefix": "ecs"
               }
           },
           "systemControls": []
       }
   ],
   "family": "boldreports",
   "taskRoleArn": "<Taks-role-ARN>",     //provide task role arn here
   "executionRoleArn": "<task execusion role ARN>",  //Provide task execution role ARN
   "networkMode": "awsvpc",
   "revision": 73,
   "volumes": [
       {
           "name": "boldreports-EFS",
           "efsVolumeConfiguration": {
               "fileSystemId": "<file-system-id>",    //provide file system id here
               "rootDirectory": "/"
           }
       },
       {
           "name": "boldreports-nginx",
           "efsVolumeConfiguration": {
               "fileSystemId": "<file-system-id>",    //provide file system id here
               "rootDirectory": "/nginx"
           }
       }
   ],
   "status": "ACTIVE",
   "requiresAttributes": [
       {
           "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
       },
       {
           "name": "ecs.capability.execution-role-awslogs"
       },
       {
           "name": "ecs.capability.efsAuth"
       },
       {
           "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
       },
       {
           "name": "ecs.capability.efs"
       },
       {
           "name": "com.amazonaws.ecs.capability.task-iam-role"
       },
       {
           "name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
       },
       {
           "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
       },
       {
           "name": "ecs.capability.task-eni"
       }
   ],
   "placementConstraints": [],
   "compatibilities": [
       "EC2",
       "MANAGED_INSTANCES",
       "FARGATE"
   ],
   "requiresCompatibilities": [
       "FARGATE"
   ],
   "cpu": "4096",
   "memory": "8192",
   "runtimePlatform": {
       "cpuArchitecture": "X86_64",
       "operatingSystemFamily": "LINUX"
   },
   "registeredAt": "2026-03-17T18:06:35.679Z",
   "registeredBy": "<ARN -id>",
   "tags": []
} 

Create ECS Service:

  • Set desired task
    image.png
  • Choose the launch type as Fargate
    image.png
  • Enable turn-on ECS Exec option for bash the task later
    image.png
  • Attach the load balancer
  • Attach target group
    image.png
  • Then click create

Step 6: Mount app_data and nginx folder using EFS

Note: Mount the app_data and nginx folder in the separate VM using below Documentation:

Documentation: How to Mount a Persistent Volume for App Data in Amazon AWS ECS Service

Step 7: Restore Data

  • Once ECS service went to running and completed state please do below steps for restore the app_data and db data

7.1 Replace app_data

  • Copy backed-up app_data into EFS mount location

7.2 Nginx changes

  • please mount your Nginx file path. Once it is mounted, open the boldreports-nginx-config file and make the changes below for all the services (id-web, id-api, id-ums, reporting-web, reporting-api, reporting-jobs, reporting-viewer, reporting-designer, reporting-etl).

From: proxy_set_header X-Forwarded-Proto $scheme;

image.png

To: proxy_set_header X-Forwarded-Proto https;

image.png

7.3 Restore Database to RDS

  • Create new DB in Amazon RDS
  • Restore DB:
psql -h <rds-endpoint> -U <username> -d <database_name> -f boldreports_backup.sql 

Step 8: Execute Commands Inside ECS Task

  • Access running ECS container (via exec/bash):
aws ecs execute-command \
 --cluster <cluster-name> \
 --task <task-id> \
 --container <container-name> \
 --interactive \
 --command "/bin/bash" 

Note: For bash the task you should allow the AmazonSSMManagedInstanceCore in your task role

Step 9: Run Bold Reports DB Utility to change the connection string in db

  • Inside the container, run required Bold Reports DB migration/upgrade utility for update the new db details in new migrated site
  • Documentation : Reset application database

Step 10: Restart ECS Service

  • Restart ECS tasks/service to apply all configurations:
    image.png

Step 11: Access Application

• Map domain to ALB
• Access Bold Reports using domain URL

Note : If you have faced any issue while access the Bold Reports site after migration Please navigate to the application-url/ums/sites. Change the database details in the site listing page by editing the site manually.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied