Location Research Breakthrough Possible @S-Logix pro@slogix.in

Cloud Migration and Disaster Recovery Modernization of a Legacy Order Processing Application

Description

This project is about moving a legacy Order Processing Application from an on-premises physical server to Cloud infrastructure while modernizing its disaster recovery capabilities. The existing application manages customer orders, order validation, inventory availability, payment processing, order fulfilment, shipment details, and order status tracking. The project will migrate the application and its data to Cloud, implement backup and disaster recovery mechanisms, configure the required Cloud infrastructure, and validate the application before production cutover with minimal interruption.

Aim

To safely migrate the existing Order Processing Application from an on-premises server to Cloud infrastructure and modernize its disaster recovery capabilities while maintaining application availability, data integrity, security, and reliable recovery during failures.

Objectives

01 Assess the existing application, server, database, storage, network, and dependencies.
02 Create the required Cloud infrastructure using Infrastructure as Code.
03 Migrate the application and order data to Cloud with minimal disruption.
04 Implement backup and disaster recovery for critical order and transaction data.
05 Validate application functionality, security, monitoring, backup, and recovery before production cutover.

Application Workflow

01

Customer Order Creation

Process

Customers or authorized users create orders by selecting products, entering required order details, and submitting the order for processing.

Tools
Nginx PostgreSQL 14
Implementation

Users access the application through the web interface. Nginx receives incoming requests and forwards them to the Order Processing Application. Customer and order details are validated and stored in PostgreSQL 14.

02

Order Validation and Inventory Check

Process

The application validates the order information and checks product availability before the order is confirmed.

Tools
PostgreSQL 14 REST APIs
Implementation

The application retrieves product and inventory information from PostgreSQL 14 and validates the requested quantities. External inventory or product services can exchange information through REST APIs.

03

Payment Processing and Order Confirmation

Process

After successful order validation, payment information is processed and the order is confirmed.

Tools
PostgreSQL 14 REST APIs
Implementation

The application sends payment-related requests through REST APIs, receives the transaction status, updates the order and payment records in PostgreSQL 14, and confirms successful orders.

04

Order Fulfillment and Shipment

Process

Confirmed orders are prepared for fulfilment, shipment details are created, and the order is transferred for delivery.

Tools
PostgreSQL 14 REST APIs
Implementation

The application retrieves confirmed order information from PostgreSQL 14, records fulfilment and shipment details, and exchanges required information with external logistics or delivery services through REST APIs.

05

Order Tracking and Reporting

Process

Order status is updated throughout fulfilment and delivery, while users and administrators can view order information and operational reports.

Tools
Nginx PostgreSQL 14
Implementation

Order status and transaction information are stored in PostgreSQL 14. The application retrieves this information and displays order tracking, completed orders, pending orders, and operational reports through the web interface.

Current Infrastructure

Existing on-premises infrastructure and technologies used before migration.

Existing On-Premises Environment

Database Server PostgreSQL 14

Runs the company's main database and stores business transactions, company information, and application data on the on-premises server.

Operating System Ubuntu Server 24.04 LTS

The application and PostgreSQL database run directly on one physical server in the office.

Process Management Systemd

Starts and manages the Python application, PostgreSQL, and other background services automatically.

Web Server Nginx

Receives incoming HTTP/HTTPS requests and forwards them to the Order Processing Application. It acts as the web-facing entry point for users and integrated services.

Storage Linux ext4 File System

Stores the application files, PostgreSQL data, and log files on the local server. There is no separate off-site backup.

Security and Access Linux PAM

Manages users, SSH access, and permissions on the server.

System Logging Journald

Collects system, application, and database logs for troubleshooting.

Network and Firewall TCP/IP + UFW

Handles network communication and controls which connections are allowed to reach the server.

Deployment Location On-Premises Linux Server

The complete application and database run on one physical server in the office. There is no separate recovery environment or automated disaster recovery system.

Logging Nginx Logs + Application Logs + PostgreSQL Logs

Records web requests, application events, database activities, and errors for troubleshooting.

Monitoring Prometheus + Node Exporter + Grafana

Monitors server resources and application infrastructure, including CPU, memory, disk usage, network activity, and service availability.

Backup pgBackRest

Performs PostgreSQL database backup and recovery to protect order and transaction data.

External Integration REST APIs

Enables the application to exchange order, product, payment, inventory, and shipment information with external services.

Target Infrastructure

Cloud-hosted infrastructure and technologies used after migration and modernization.

Cloud-Hosted Modernized Environment

Database Engine PostgreSQL 14

Continues to run the company's database on Cloud. The existing database structure and application logic remain largely the same.

Cloud Networking Cloud VPC

Provides a private and secure network for the Cloud servers.

Cloud Compute Cloud EC2

Provides the virtual server where Ubuntu, the Order Processing Application, PostgreSQL, and supporting services run.

Operating System Ubuntu Server 24.04 LTS

The same Linux operating system continues to run on the Cloud EC2 servers.

Process Management Systemd

Starts and manages the Python application, PostgreSQL, and background services automatically.

Web Server Nginx

Receives incoming HTTP/HTTPS requests and forwards them to the Order Processing Application.

Security and Access Linux PAM

Manages users, SSH access, and permissions on the Linux servers.

System Logging Journald

Collects application, database, and system logs for troubleshooting.

Network and Firewall TCP/IP + UFW

The application uses port 8080, PostgreSQL uses port 5432, and UFW controls network access inside the server.

Cloud Firewall Cloud Security Groups + Network ACLs

Provide Cloud-level network security and control which traffic can enter or leave the Cloud resources.

Server Storage Cloud EBS

Provides persistent storage attached to the EC2 servers for the operating system, application files, and PostgreSQL data.

Database Backup and Recovery pgBackRest

Provides open-source backup and recovery for PostgreSQL 14 and protects the application's critical order and transaction data.

Backup Storage Cloud S3

Stores pgBackRest backup repositories separately from the primary EC2/EBS environment, providing durable off-site backup storage.

Disaster Recovery Cloud Elastic Disaster Recovery

Provides server-level disaster recovery by continuously replicating the application environment and enabling recovery when the primary environment becomes unavailable.

Infrastructure Provisioning OpenTofu

Automatically creates Cloud resources such as VPC, EC2, EBS, and security groups using infrastructure code.

Configuration Automation Ansible

Automatically configures the EC2 servers, installs required software, and prepares the recovery environment.

Monitoring Prometheus

Collects server, application, database, and storage performance metrics.

Monitoring Dashboard Grafana

Displays Prometheus metrics in easy-to-understand monitoring dashboards.

Migration Cloud MGN

Continuously replicates the on-premises server to Cloud during migration and supports controlled testing and cutover to the Cloud EC2 environment.

Implementation Process

01
Assess the Existing On-Premises Environment
  • Review the existing PostgreSQL 14, Ubuntu Server 24.04 LTS, Nginx, Systemd, storage, security, and network configuration.
  • Review Journald, Nginx, application, and PostgreSQL logs.
  • Check existing pgBackRest backups and perform a restore test.
  • Use Prometheus + Node Exporter + Grafana to record the existing server performance baseline.
  • Identify application files, database data, configurations, dependencies, and network requirements for migration.
02
Build and Configure the Cloud Environment
  • Use OpenTofu to create the Cloud VPC, Cloud EC2, Cloud EBS, Security Groups, and Network ACLs.
  • Install Ubuntu Server 24.04 LTS on the Cloud EC2 server.
  • Use Ansible to configure the server and required services.
  • Configure Nginx, PostgreSQL 14, Systemd, Linux PAM, UFW, and Journald.
  • Configure Prometheus + Node Exporter + Grafana for monitoring.
03
Migrate the Application and Database
  • Install the Cloud MGN agent on the existing on-premises server.
  • Use Cloud MGN to continuously replicate the server to Cloud.
  • Migrate the Order Processing Application and its configuration files to the Cloud EC2 environment.
  • Migrate the PostgreSQL 14 database and validate tables, records, indexes, and transaction data.
  • Perform migration testing and verify that the application communicates correctly with PostgreSQL 14.
04
Implement Backup and Disaster Recovery
  • Configure pgBackRest to back up PostgreSQL 14.
  • Configure Cloud S3 as the remote backup repository for pgBackRest.
  • Perform database backup and restoration testing.
  • Configure Cloud Elastic Disaster Recovery to replicate the required application environment for disaster recovery.
  • Perform a controlled recovery test to verify that the application and database can be recovered after a major failure.
05
Final Testing, Cutover, and Production Validation
  • Stop new transactions on the old on-premises server during the final migration window.
  • Complete the final Cloud MGN synchronization and start the application on Cloud EC2.
  • Test Nginx, PostgreSQL 14, Systemd, application functions, database transactions, backup, monitoring, and disaster recovery.
  • Update the application endpoint/DNS to direct users and integrated services to Cloud.
  • Monitor the Cloud environment using Prometheus + Node Exporter + Grafana, and after successful validation, decommission the old on-premises environment.

Proposed Solution

The proposed solution moves the legacy Order Processing Application from an on-premises server to a secure Cloud environment with backup and disaster recovery. OpenTofu, Cloud MGN, and Ansible are used for infrastructure provisioning, server migration, and configuration. PostgreSQL 14 remains the database engine, while pgBackRest + Cloud S3 provide database backup and Cloud Elastic Disaster Recovery provides disaster recovery.

Benefits

Reduced hardware dependency – Moves the application from the physical server to Cloud EC2.
Improved disaster recovery – Enables recovery if the primary environment fails.
Better data protection – pgBackRest and Cloud S3 protect database backups.
Automated management – OpenTofu and Ansible reduce manual configuration.
Better monitoring – Prometheus, Node Exporter, and Grafana provide infrastructure visibility.
Scalability – Cloud resources can be increased as workload grows.

Challenges

Migration time – Large amounts of data may require significant transfer time.
Application compatibility – The application must be tested after migration.
Data validation – Migrated order and transaction data must be verified.
DR testing – Recovery procedures must be tested regularly.
Cloud management – Cloud security, resources, and costs require ongoing management.