Google Cloud: How to Migrate VM Instances from One Project to Another
- 17/09/2018
- Server Administration
No Comments
If you’re just getting started with GCP, chances are you will have different VM instances running under a default project. Then somewhere down the track, if you decided to set up different billing accounts for different VM instances, you will have to come across this issue. So let’s get it started with a step by step guide.
- I assume at this point, you already have a basic understanding of how to use and navigate GCP, such as VM instance, Disks, Snapshots and Images and how to create them.
- Let say you have a VM instance client-b currently sitting in project-a, but you want to move it to project-b, you need to create an image from the disk which client-b is running on.
- Download and install Google Cloud SDK and login to your GCP account, it’s straightforward so no instructions needed here. Once you logged in it will prompt you to choose which project to work on, make sure you choose project-b, which is the destination of the new VM Instance you’re about to create. If you want to switch to a different project, use this command:
gcloud config set project <my-project-id>
- Then use this command to create the new VM instance:
gcloud compute instances create <new-instance-name> --image <image-name-you-just-created> --image-project <project-a-id>
- Make sure you enable http and https in the firewall, and once the new instance is a successful replica, you can go ahead turn the old VM off.
- It should only take less than 10 min to create a new instance from a 60G image, if you’re running a web server on your VM, you will need to restart Apache and MySQL.
To many, a business is a lifetime commitment. It's easy to start one yet difficult to make it successful. Attitude, skills, experiences and dedication help hone the craft along the way, but it's often the great vision and resilience to remain focused wins the game. Read more about me here
This article covers: How to add website switcher in a multi-website environmentHow…
This article covers: How to change default product image sizes in Magento…
This article covers: How to generate CSR (certificate signing request), which is…
SEO is an area where too many eCommerce startups cannot help to…
Testing remains a critical stage for eCommerce developing, and it should be…
At the very beginning when we first start eCommerce developing, we came…
Ever since we started eCommerce developing, we often found it's hard to…
Your design must be suitable for your audiences The most cutting-edge design…