Migration from Rackspace Server to Google Cloud Platform(GCP)
Tags: cloud, cloudmigratio, gcp, googlecloud
Published: 2023-03-23 06:49:18

Migrating from a `Rackspace` server to the `Google Cloud Platform (GCP)` can be a daunting task, but it can also bring many benefits such as scalability, security, and cost savings. In this blog, we will walk through the process of migrating from a `Rackspace` server to `GCP` and discuss some of the key considerations and best practices to keep in mind.

Before beginning the migration process, it is important to plan and prepare for the move. This includes identifying which resources and data need to be migrated, as well as determining the most efficient and cost-effective way to move them.

## RackSpace Server
- **Server**
 - **Hardwares**
   - 8GB RAM, 100GB SSD
 - **Softwares**
   - Debian 10, Apache 2.4, PHP 7.4
- **Database**
  - MySQL 5.7
- **Resources**
  - Images, PDF’s, Excel, etc
- **DNS**
  - Domain, Subdomain, Other Records like CNAME, A, TXT, MX, etc
- **Additional Dependency’s**
  - Additional Softwares like: RabbitMQ, Elasticsearch, CRONS, etc
  - Check Enabled PORTS like: 80, 443, 21, etc

One of the most important considerations for migration is the data. It is important to take a full backup of all data on the `Rackspace` server, including databases, files, and configurations. This backup should be tested to ensure that it can be restored successfully.

Next, it is important to choose the appropriate `GCP` services for your workloads. GCP offers a wide range of services, including compute, storage, networking, and databases, that can be used to run your applications and store your data. Depending on the specific requirements of your workloads, you may want to use services like Google Compute Engine, Google Kubernetes Engine, Google Cloud Storage, or Cloud SQL.

## Create Replica Of RackSpace Server to Google Cloud Platform(GCP)
- **Server – `Google Compute Engine`**
 - **Hardwares**
   - 8GB RAM, 100GB SSD
 - **Softwares**
   - Debian 10, Apache 2.4, PHP 7.4
- **Database – `Cloud SQL`**
 - MySQL 5.7
- **Resources – `Cloud Storage`**
 - Images, PDF’s, Excel, etc
 - Created/Configured CDN with Loadbalancer to access these resources
- **DNS – `Cloud DNS`**
 - Domain, Subdomain, Other Records like CNAME, A, TXT, MX, etc
- **Additional Dependency’s**
 - Additional Softwares like: RabbitMQ, Elasticsearch, CRONS, etc
 - Enabled PORTS like: 80, 443, 21, etc

Along with server migration we moved all resources to `Google Cloud Bucket` and created `CDN` to access them. We have also updated the code to access file from `CDN`, upload files to Cloud bucket, Download file from Cloud bucket. By following these steps, we have optimise our server resources and improve your website’s overall performance.

To do this you have to make sure you have given right permission to bucket so files can be accessible, also handle the `CORS` issue by making some configuration changes in cloud bucket. Another issue we faced was resizing images as first we have to download it then resize and finally upload it again.

Once you have chosen the appropriate `GCP` services, you can begin migrating your data and resources. There are several different methods for migrating data and resources, including manual migration, using migration tools, or using a hybrid approach. The method you choose will depend on the size and complexity of your workloads, as well as the resources and expertise available to you.

**Google Cloud Platform offers a range of powerful tools like gsutil that can greatly simplify and automate many tasks related to managing and using cloud services.**

`Gsutil` is a command-line tool that allows you to interact with Cloud Storage from the command line. With `gsutil`, you can also automate tasks such as backups, synchronizing data between local and cloud storage, and running batch jobs. This can save you time and effort, and help you to more efficiently manage your cloud resources.

We configured it to `Rackspace` server to transfer all the resources(Images, PDF’s, Excel files, etc), exported mysql databases.

**Another helpful tool we used was SCREEN.**

The `screen` tool is a terminal multiplexer that allows you to create multiple “virtual” terminals within a single terminal window. This can be useful for a variety of tasks, including running multiple commands simultaneously, detaching from a terminal session while leaving the commands running in the background, and transferring larger files in the background.

To transfer larger files in the background using `screen`, you can start a `screen` session and then initiate the file transfer using a command-line tool such as `rsync` or `scp` In our case we used `gsutil`. Once the transfer has started, you can detach from the `screen` session using the key combination `Ctrl+a d`. This will leave the transfer running in the background and allow you to continue using the terminal for other tasks.

To reattach to the `screen` session and check the progress of the transfer, you can use the command `screen -r`. This will restore the `screen` session and allow you to view the output of the running commands.

It’s also important to keep in mind the security and compliance requirements during this migration process. GCP provides various security and compliance features such as encryption, firewalls, and identity and access management to keep your data and resources secure.

Once the migration is complete, it is important to thoroughly test your applications and services to ensure that they are working as expected. This includes monitoring the performance of your workloads, troubleshooting any issues that may arise, and making any necessary adjustments to your GCP configuration.

**Some major issues we faces post migrations are:**
- We experience slowness issue on production server. Root cause was cache was disabled in Apache, innodb buffer size, query cache mode was disabled in MySQL.
- Apache configuration updates were missing like: `http_module`, `rewrite_module`, `headers_module`, `ssl_module`. `Execute this` **apachectl -M** command to get all the list of modules.
- Missed to update MySQL modes like: `NO_ENGINE_SUBSTITUTION`, `innodb_buffer_pool_size`, `query_cache_size`, etc
Directory permissions were missing to create folders, upload files, etc.
- Email with attachments were missing the file as file were on bucket not on server anymore.

In conclusion, migrating from a `Rackspace server` to `GCP` can be a complex process, but it can bring many benefits such as scalability, security, and cost savings. It’s important to plan and prepare for the move, choose the appropriate GCP services, and keep in mind the security and compliance requirements during the migration process. It’s also important to thoroughly test your applications and services after the migration to ensure that they are working as expected.

Thanks for taking the time to read this. If you have any further questions or need more information, please don't hesitate to ask.

## Reach Out
https://dwebworks.in/
dwebworks.in@gmail.com