Skip to content

Case study on Migration of GitLab PostgreSQL database and repository storage to a different location

Engagement Overview

Adex, an AWS Consulting Partner and ISO/IEC Certified IT Resourcing & Cloud Consulting Company assisted a Japanese payment-based wallet application in moving from a data centre to AWS.

About the Customer

The client is a wallet-based application that accepts payments and facilitates transactions for various services. It’s a comprehensive solution to help customers with wallet-based operations that must comply with national directives and requirements issued by local authority standards.

Know Migrate Gitlab PostgreSQL Database to Custom Location Using Ansible.

Business Challenge

The client uses a GitLab self-managed server due to compliance requirements prohibiting storing data outside their data centre. In addition to better control and flexibility, a self-managed GitLab server is not limited by the number of users, storage, or runners.

Gitlab PostgreSQL Database Migration Case Study
Gitlab PostgreSQL Database Migration Case Study

It is typically more cost-effective than using the SaaS version of GitLab. Using their SSL certificates for secure connections is another advantage of self-managed GitLab servers, which is particularly important for compliance and security-conscious organizations.

Learn more about: How To Use Amazon S3 For Personal Backup?

However, the customer encountered an issue with their on-premise data centre as their self-managed GitLab server had reached its storage capacity, preventing them from adding more users and data in the future.

Read also: 7 Types of Security in Cloud Computing?

They wanted to be ready to handle more data and users as their Company was increasing and may soon be unable to use GitLab, their primary collaboration tool. And hosting two different GitLab servers was not an option.

Solution Delivered

After thoroughly assessing the client’s needs, challenges, and systems, we proposed a solution of mounting new volume to their existing on-premise server and moving new repository data and existing database to the new custom location. We were able to automate the whole process to ensure a minimum amount of downtime.

Know more about Amazon FSx for Lustre, Windows, and NetApp ONTAP

The migration was thoroughly planned, and the visual representation of the process was designed to make the process look clear.

The migration now allows the customer to handle more users and data, and the solution can be used in the future if the customer needs to take more data.

Read about: AWS Well-Architected Framework Security Pillar

Architecture and Tech Stack

The requirement was to handle more users and data for the on-premise GitLab server so that as the organization grows, the GitLab should be able to meet the needs.

We designed an architecture representing the process, making it easier to visualize the solution.


To achieve the desired output, the solution was to make changes to the configuration file of the GitLab server and reconfigure the GitLab service.

For Disaster recovery, the existing configuration file was backed up, and the current database data was synced, not moved to the new location before implementing the recent changes.

Explore: Microsoft Azure vs AWS vs Google Cloud – Comparison

The whole process would have taken longer if done manually, so we automated the entire process using the Ansible playbook, resulting in lower downtime and reduced chance of error.

Furthermore, we added a shell script in the server that will run twice daily, which checks the storage per cent and sends an email notification to the client if the storage has reached 80% of the capacity.

Find more about: How to Host Static Websites on AWS S3?

If more storage locations were to be added, we could make configuration changes and reconfigure the service.


Migration of the existing database to a new location and adding recent alternative storage locations for the repository data solved the problem of addressing new users and data for the GitLab server.

The following results were achieved:

  • Increased scalability as the organization grows.
  • custom location improved disaster recovery by ensuring data resilience
  • more control over data storage
  • better collaboration among the team member

Read more about: Know Migrate Gitlab PostgreSQL Database to Custom Location Using Ansible.

Explore More Resources: