Alex George
Alex George

Reputation: 13

Is there a way to clone a server in AWS?

I have 4 sites in total, 2 production and 2 test instances. I have to move them to 2 separate servers on AWS, one for production and one for testing. Is there a way to first upload two sites and then clone the very same sites to the test server? The sites are built with the DNN framework. Once moved, do I still need to spend a considerable amount of time on connection strings?

Upvotes: 1

Views: 2777

Answers (2)

John Rotenstein
John Rotenstein

Reputation: 269500

An Amazon EC2 instance basically consists of two things:

  • The virtual hardware that is provisioned while the instance is running, and
  • The contents of the disks

(Okay, there's also other things like network settings.)

When you say you want to "clone" a server, it's really a matter of having another copy of the disk contents. The simplest way to achieve this is:

  • Create an image of an existing Amazon EC2 instance, which produces an Amazon Machine Image (AMI), then
  • Launch a new instance from the AMI

The result is a new Amazon EC2 instance that has exactly the same disks. You can then reconfigure the new machine (eg give it a different name, or make it Test instead of Production, or point to a different database). The new instance will have a different IP address and a different Instance ID. When launching the new instance, you can change network settings (eg to put it into a different subnet).

If you are cloning a Production instance to a Test instance, make sure the Test instance doesn't "think" that it is Production and do something wrong. You might want to launch it into a different network that has limited Internet access, just to avoid any problems (eg sending out emails to users).

Upvotes: 2

Tomek Klas
Tomek Klas

Reputation: 788

You can create Amazon Machine Image (AMI) from existing EC2 instance and use that as a base in your other environments.

Upvotes: 0

Related Questions