<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sheham Hassan</title>
    <description>The latest articles on Forem by Sheham Hassan (@shehamhassan).</description>
    <link>https://forem.com/shehamhassan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1868545%2F709f2438-88e8-484f-bc02-5e1bba3a0abc.jpg</url>
      <title>Forem: Sheham Hassan</title>
      <link>https://forem.com/shehamhassan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shehamhassan"/>
    <language>en</language>
    <item>
      <title>Migrate Your VMs from VMware to AWS: A Step-by-Step Guide</title>
      <dc:creator>Sheham Hassan</dc:creator>
      <pubDate>Sat, 11 Jan 2025 01:30:07 +0000</pubDate>
      <link>https://forem.com/sudoconsultants/migrate-your-vms-from-vmware-to-aws-a-step-by-step-guide-19ai</link>
      <guid>https://forem.com/sudoconsultants/migrate-your-vms-from-vmware-to-aws-a-step-by-step-guide-19ai</guid>
      <description>&lt;p&gt;The cloud has become the cornerstone of modern IT infrastructure, offering unparalleled scalability, flexibility, and cost-effectiveness. However, migrating existing workloads from on-premises environments to cloud platforms can be a daunting task. This guide provides a comprehensive, step-by-step blueprint for migrating your virtual machines (VMs) from VMware to Amazon Web Services (AWS). By following this detailed tutorial, you’ll gain the confidence and expertise to successfully transition your applications to the cloud, unlocking the full potential of AWS.&lt;/p&gt;

&lt;p&gt;Imagine a company, let’s call it “Sudo 2.0” which has been relying on VMware to manage its IT infrastructure. Over time, they realized the need for a more scalable solution to handle their growing needs and decided to migrate to AWS. However, the team was concerned about the complexities of such a migration—how to ensure a smooth transition without disrupting their ongoing operations? This is where our guide comes in, designed to equip you with the confidence and expertise needed to successfully transition your applications to the cloud, unlocking the full potential of AWS. &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A VMware vSphere environment with at least one cluster&lt;/li&gt;
&lt;li&gt;An ESXi host capable of running at least two virtual machines&lt;/li&gt;
&lt;li&gt;An AWS Account with the Application Migration Service initialized&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here, we’ll be working with a VMware environment containing one Ubuntu 22.04 and one Windows Server 2019 virtual machine. Our goal is to migrate Windows Virtual Machine to our AWS Account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzqxsp3viev5ikmobcvpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzqxsp3viev5ikmobcvpq.png" alt="Image description" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create an IAM User
&lt;/h2&gt;

&lt;p&gt;To interact with the AWS Application Migration Service, we’ll need an IAM user with specific permissions. Follow these steps to create a new user:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the AWS Management Console, navigate to IAM.&lt;/li&gt;
&lt;li&gt;Click on user in the left pane, then click “Create User” button.&lt;/li&gt;
&lt;li&gt;Give user a name, then on “Set Permissions” page, select “attach policies directly”.&lt;/li&gt;
&lt;li&gt;Attach “AWSApplicationMigrationAgentInstallationPolicy” and “AWSApplicationMigrationVCenterClientPolicy” to the user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15tci6a9h0zgj70xy21v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15tci6a9h0zgj70xy21v.png" alt="Image description" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the user is created, generate the access keys. These keys will be used later in the tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Installing AWS MGN vCenter client
&lt;/h2&gt;

&lt;p&gt;The AWS MGN vCenter Client is a software component that acts as a bridge between your vCenter environment and the AWS Application Migration Service (MGN). It facilitates agentless replication of your virtual machines to AWS. Here’s how to install it:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Prepare the environment
&lt;/h3&gt;

&lt;p&gt;Set up a dedicated Ubuntu 22.04 VM in your vCenter environment. Ensure Python is installed on this VM.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Download Required Files
&lt;/h3&gt;

&lt;p&gt;Once server is configured, Download the Virtual Disk Development Kit (VDDK) from Broadcom’s developer portal developer.broadcom.com/sdks/vmware-virtual-disk-development-kit-vddk/7.0 and transfer it to the Linux server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next step is to download AWS MGN vCenter client on the Linux server. This can be done using the following command:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwycqspff5fsspa785m1n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwycqspff5fsspa785m1n.png" alt="Image description" width="800" height="401"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Replace region with your desired region
wget https://aws-application-migration-service-ap-south-1.s3.ap-south-1.amazonaws.com/latest/vcenter-client/linux/aws-vcenter-client-installer-init.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Run the Installer
&lt;/h3&gt;

&lt;p&gt;Once both installers have been downloaded, run the following command to install the client&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo python3 aws-vcenter-client-installer-init.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During the installation, you will need to provide the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS Access Key ID&lt;/li&gt;
&lt;li&gt;AWS Secret Access Key&lt;/li&gt;
&lt;li&gt;AWS Region Name&lt;/li&gt;
&lt;li&gt;vCenter IP or hostname&lt;/li&gt;
&lt;li&gt;vCenter port&lt;/li&gt;
&lt;li&gt;vCenter user name&lt;/li&gt;
&lt;li&gt;vCenter password&lt;/li&gt;
&lt;li&gt;vCenter root CA Cert path&lt;/li&gt;
&lt;li&gt;VDDK path&lt;/li&gt;
&lt;li&gt;Resource Tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once done, our next step is to replicate servers from vCenter to AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Replicating Servers from vCenter to AWS
&lt;/h2&gt;

&lt;p&gt;With the setup complete, it’s time to initiate the migration process. The AWS Application Migration Service (AWS MGN) will facilitate the replication of your VMs from VMware to AWS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to Application Migration Service:&lt;/strong&gt; On the AWS Management Console, go to the Application Migration Service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Select Source Servers:&lt;/strong&gt; Click on the “Source Servers” tab in the left pane.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose Discovered Servers:&lt;/strong&gt; From the “Active Source Servers” dropdown, select “Agentless discovered servers.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhy2zq37wrdjfflzh7yq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhy2zq37wrdjfflzh7yq0.png" alt="Image description" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start Replication:&lt;/strong&gt; Here we can see the same discovered servers that were in our VMware environment. Select the VM you want to replicate, click on the replication dropdown, and select “Start Replication.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7nuze20ya73od6fp89n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7nuze20ya73od6fp89n.png" alt="Image description" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Monitor Replication:&lt;/strong&gt; To view the replication status, click on the “Application discovered servers” dropdown and choose “Active source servers.” The replication process might take a few minutes depending on the size of the VM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzeawjea37cdky6vf3h62.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzeawjea37cdky6vf3h62.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the state of migration lifecycle is changed to “Ready for testing” and data replication status becomes “Healthy”, click on “Test and cutover” dropdown and select “Launch test instance”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcv1jrgu4aho4098iua61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcv1jrgu4aho4098iua61.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This will launch test instance with the same configuration as it was in the VMware. We can navigate to EC2, connect to this instance and test if everything is working as expected.&lt;/li&gt;
&lt;li&gt;Once the testing is completed, select the instance again, click on the “Test and cutover” dropdown. Then click “Mark as Ready for Cutover”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubx08zlj2icc557rul4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubx08zlj2icc557rul4u.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once done, our next step is to launch cutover instance. To do so, repeat the same steps, that is to select the instance &amp;gt;&amp;gt; Click Test and cutover dropdown &amp;gt;&amp;gt; Click launch cutover instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbio37ri5pds8gjq5y9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbio37ri5pds8gjq5y9y.png" alt="Image description" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Finalize Cutover:&lt;/strong&gt; After successful testing, repeat the same steps to launch the cutover instance. Finally, select “Finalize Cutover” from the Test and Cutover dropdown.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13a7yfmwqbqh85skzhxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13a7yfmwqbqh85skzhxy.png" alt="Image description" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Additionally, we can archive this instance once the cutover has been finalized. By clicking “mark as archive” from the Test and Cutover dropdown.&lt;/li&gt;
&lt;li&gt;To verify the changes, navigate to the EC2 dashboard and view the migrated instance. To fully utilize your migrated instance, consider allocating an Elastic IP, configuring network security groups (inbound/outbound rules), and optimizing performance settings based on your application requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffo5z4b4etlhutslqpfye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffo5z4b4etlhutslqpfye.png" alt="Image description" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Configurations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;After migration, organization should secure their AWS instances by configuring network security groups, restricting inbound and outbound traffic to only what is necessary. Allocating an Elastic IP and fine-tuning performance settings can help ensure smooth operations.&lt;/li&gt;
&lt;li&gt;Following the principle of least privilege is crucial when assigning IAM policies. Regularly review and update permissions to minimize potential security risks, ensuring that only essential access is granted.&lt;/li&gt;
&lt;li&gt;Implement strong encryption with AWS Key Management Service (KMS) for data both at rest and in transit. Additionally, set up monitoring with AWS CloudTrail and CloudWatch, and enable Multi-Factor Authentication (MFA) to enhance security and maintain a robust audit trail.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsye4ym5bez94entpw1cm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsye4ym5bez94entpw1cm.png" alt="Image description" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Congratulations! You’ve successfully migrated your virtual machine to AWS, tapping into the powerful benefits of cloud computing such as scalability, flexibility, and cost-efficiency. With careful planning and the right tools, the daunting task of cloud migration becomes a structured, manageable process.&lt;/p&gt;

&lt;p&gt;Remember, the cloud is not just a destination but a journey. As you continue to explore AWS, you’ll discover more ways to optimize and secure your applications, driving innovation and growth for your business.&lt;/p&gt;

</description>
      <category>migration</category>
      <category>aws</category>
    </item>
    <item>
      <title>Build Your Own Git Platform: Gitea Setup and Migration from CodeCommit</title>
      <dc:creator>Sheham Hassan</dc:creator>
      <pubDate>Fri, 16 Aug 2024 22:18:12 +0000</pubDate>
      <link>https://forem.com/sudoconsultants/build-your-own-git-platform-gitea-setup-and-migration-from-codecommit-49b3</link>
      <guid>https://forem.com/sudoconsultants/build-your-own-git-platform-gitea-setup-and-migration-from-codecommit-49b3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Tired of relying on external platforms for your code version control? Welcome to the world of self-hosting! This guide will show you how to install and configure Gitea, a powerful self-hosted Git server, and migrate your existing repositories from AWS CodeCommit. Get ready to take full control of your code and streamline your development workflow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and Configuring Gitea
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Instance Setup
&lt;/h3&gt;

&lt;p&gt;First, we’ll create a test instance on a cloud provider like AWS. Here we have created Ubuntu t2.micro instance in AWS. Make sure to allow port 3000 inbound from security group. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynmb1ag7gp4hxskjafeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynmb1ag7gp4hxskjafeu.png" alt="Image description" width="624" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect to the instance locally using ssh or any other available options&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Installing Dependencies
&lt;/h3&gt;

&lt;p&gt;Once connected, update the system packages using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install wget and git using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mysql-server –y
sudo systemctl start mysql 
sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ll create a dedicated database and user for security purposes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql -u root -p
CREATE DATABASE &amp;lt;dbname&amp;gt; CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
CREATE USER '&amp;lt;username&amp;gt;'@'localhost' IDENTIFIED BY '&amp;lt;password&amp;gt;';
GRANT ALL PRIVILEGES ON &amp;lt;dbname&amp;gt;.* TO ' &amp;lt;username&amp;gt; '@'localhost';
FLUSH PRIVILEGES;
EXIT;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gitea Installation and Configuration&lt;br&gt;
Now, let’s create dedicated system user for Gitea:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we will install Gitea binary, and add relevant permissions to the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget -O gitea https://dl.gitea.io/gitea/1.17.3/gitea-1.17.3-linux-amd64
sudo chmod +x gitea
sudo mv gitea /usr/local/bin/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy795ne87jd12mhvdisvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy795ne87jd12mhvdisvz.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create essential directories in /var/lib and in /etc/ folders for Gitea’s data, logs, and configuration files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /var/lib/gitea/{custom,data,log} 
sudo chown -R git:git /var/lib/gitea/ 
sudo chmod -R 750 /var/lib/gitea/ 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir /etc/gitea 
sudo chown root:git /etc/gitea 
sudo chmod 770 /etc/gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To ensure Gitea runs smoothly as a service, we’ll create a Systemd service file defining how the system manages Gitea. This service file specifies the user, group, working directory, and startup command for Gitea.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tee /etc/systemd/system/gitea.service &amp;gt; /dev/null &amp;lt;&amp;lt;EOL
[Unit]
Description=Gitea
After=syslog.target
After=network.target
#Requires=mariadb.service
#Requires=mysql.service
#Requires=postgresql.service
#Requires=memcached.service
#Requires=redis.service

[Service]
LimitMEMLOCK=infinity
LimitNOFILE=262144
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea

[Install]
WantedBy=multi-user.target
EOL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, start and enable Gitea service for it to run continuously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl daemon-reload
sudo systemctl enable gitea
sudo systemctl start gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Configuring and Accessing Gitea
&lt;/h3&gt;

&lt;p&gt;Now open a new tab in your favorite browser and search http://:3000 (replacing ). This will take you to the Gitea installation wizard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbae4jqedol1qjka17ioa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbae4jqedol1qjka17ioa.png" alt="Image description" width="624" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the database user credentials and keep your general settings as default for now. Scroll down and click “install gitea” to complete the setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7328w84vh223idisz3nr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7328w84vh223idisz3nr.png" alt="Image description" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installed, it will redirect to the Gitea main page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gsoy84fbx1doz6bmwbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gsoy84fbx1doz6bmwbc.png" alt="Image description" width="624" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To register user in Gitea, navigate to the “Register” on the top right corner of page, then enter registration details:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvohnmykvmf919v96gqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvohnmykvmf919v96gqr.png" alt="Image description" width="624" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once done, it will navigate to the main page of Gitea and we can access it seamlessly now.&lt;/p&gt;

&lt;p&gt;Congratulations! You’ve successfully installed Gitea on your local EC2 instance and have full access to the Gitea Web Interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating repository from AWS CodeCommit to Gitea
&lt;/h2&gt;

&lt;p&gt;Now comes the exciting part – migrating your existing repository from AWS CodeCommit to your self-hosted Gitea instance!&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial Setup
&lt;/h3&gt;

&lt;p&gt;To migrate repository from AWS CodeCommit to Gitea, we have created “repository A” in AWS CodeCommit and an empty “repository B” in Gitea. Our goal is to migrate the contents repository A to repository B&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS CodeCommit:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdr7b2mu95wnrlww8eza.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdr7b2mu95wnrlww8eza.png" alt="Image description" width="624" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitea:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feq74hlfeqdgvscbnf7c7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feq74hlfeqdgvscbnf7c7.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, clone the CodeCommit repository to the local CLI.&lt;/p&gt;

&lt;p&gt;Make sure to have AWS Cli configured and necessary Git credentials generated for CodeCommit access.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repository Migration
&lt;/h3&gt;

&lt;p&gt;Copy the https Clone url from CodeCommit repository and paste the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone &amp;lt;CodeCommit clone url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter AWS CodeCommit credentials we have generated earlier.&lt;br&gt;
Navigate to the repository using cd command&lt;br&gt;
Now navigate to the Gitea tab and copy the clone url&lt;br&gt;
Next step is to add remote path to the Gitea repository in the terminal and push the code using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add gitea http://&amp;lt;your-ec2-public-ip&amp;gt;:3000/&amp;lt;username&amp;gt;/&amp;lt;repo-name&amp;gt;.git
git push -u gitea –all
git push -u gitea --tags
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcghrjmbkurhsl37si7uk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcghrjmbkurhsl37si7uk.png" alt="Image description" width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, head back to repository B in the Gitea interface and refresh the page, we can see all the contents of repository A have been migrated with same commit messages in repository B.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6pg7n322gka561puh8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6pg7n322gka561puh8i.png" alt="Image description" width="624" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You’ve successfully installed and configured Gitea, migrated your repository from AWS CodeCommit, and are now in full control of your code. With Gitea, you have a powerful and flexible self-hosted Git server that caters to your specific needs. Embrace the benefits of self-hosting and enjoy a streamlined development experience!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
