Moving EBS volumes between Amazon EC2 instances
To move data from one instance to another, you can create a snapshot of an existing Amazon Elastic Block Storage (EBS) volume, create a volume from the snapshot, then attach the new volume to a different Amazon EC2 instance.
You can have multiple EBS volumes on the same instance. Or, if you only need to move an existing volume to a new instance (for example, if you are using a newer version of an AMI), you can drop the existing volume on the target instance and attach the volume you have moved.
If you move your enterprise geodatabase (EGDB) default volume (the pgdata folder) from one instance to another, you must make sure the volume on the source instance is mapped to the same drive letter when it is moved to the target instance. By default, this is the D drive.
Creating a snapshot of the volume that contains the data you want to move
Creating a snapshot basically makes a copy of the content of the existing volume.
If you are making a snapshot of an EGDB volume, you must make a remote desktop connection to the source EGDB instance server and stop the PostgreSQL service before stopping the instance and creating the snapshot.
First, you must stop the instance before you make a snapshot.
- Log in to Amazon EC2 Management Console.
- Click Instances in the Navigation panel.
- Right-click the source instance and click Stop.
- Click Volumes in the Navigation panel.
- Right-click the volume you want to move and click Create Snapshot from Volume.
- Type a description for your snapshot that will help you find it in the snapshot list.
- Click Create.
Now you can make a snapshot of the source volume.
The target instance
If the target instance has not been created yet, create it now.
Once you have a target instance, record the following information about it:
- The instance ID
- The instance zone (for example, us-east-1d)
- If you plan to replace the existing volume on the target instance with the volume you are moving, record the volume ID. You will need this information when you detach the existing volume.
If you plan to keep the existing volume on the target instance, record the block device name of the existing volume.
Block device names must be unique, so when you attach the new volume to the target instance, be sure to give it a different name than the existing one.
By default, the ArcGIS Server and EGDB AMI use the name xvdg; however, you could have other volumes with different names.
Creating a volume from the snapshot
You must create a volume from the snapshot you made of your existing volume so you can attach it to the target instance.
- Click Snapshots in the Navigation panel.
- Right-click the snapshot you created from the source volume and click Create Volume from Snapshot.
- Specify the size of your new volume.
- From the drop-down list, choose the instance zone you recorded for the target instance.
- Click Create.
- Click Volumes in the Navigation panel.
You should see your new EBS volume being created. Record the volume ID for future use.
Note:It may take a few minutes to create the volume.
Attaching the new volume to the target instance
You can use the new volume to replace an existing volume or you can add the new volume as an additional volume. If you are replacing an existing volume, there will likely be data on the old volume you need to transfer to the new volume.
For both scenarios, complete the first two sets of steps to attach the volume and make it accessible.
- Right-click the new EBS volume and click Attach volume.
- From the drop-down list, choose the instance ID of the target instance.
- Type a name for the new block device.
All ArcGIS Server and EGDB instances are on Windows servers; therefore, the device name must use one of the Windows device names: xvdf through xvdp. The name must be unique on that instance.
- Click Attach.
Connect to the target instance to bring the new volume online after you attach it.
- Make a remote desktop connection to the target instance.
- Open the Microsoft Management Console.
- Expand the Storage node and click Disk Management.
- Right-click the disk volume in the Graphical View and click Online.
Now you will either use the newly attached volume as a replacement to your existing volume or you will keep both the existing and the new volume. Read the appropriate section below depending on your situation.
Replacing the existing volume
If you are replacing the existing volume with the new volume, move any data you need from the old to the new volume, then detach the old volume.
- Start Windows Explorer.
- Copy data from the old drive and paste it into the new drive.
- Click Volumes in the Navigation panel.
- Right-click the volume you want to replace and click Detach.
- Click Yes, detach to confirm.
- If you replaced an existing EGDB EBS volume, restart the PostgreSQL service by clicking Start > All Programs > PostgreSQL 8.3 > Start service.
If you no longer need the detached volume, delete it.
You cannot restore the volume once it is deleted.
Keeping both volumes
If you did not detach the existing volume from the target instance, you may need to remap the volume to a different drive letter. For example, if you have applications that rely on the data being mapped to a particular drive letter, you may need to remap the drive to that specific letter.
Both the PostgreSQL database cluster for enterprise geodatabase instances and the GIS Data folder for ArcGIS Server instances are mapped to the D drive.
If necessary, remap the volume to a new drive letter.
- Right-click the disk volume in the Volume List and click Change Drive Letter and Paths.
- Click Change on the Change Drive Letter and Paths dialog box.
- Choose the new drive letter from the drop-down list and click OK.
- Click OK to close the Change Drive Letter and Paths dialog box.
- If you are connecting to an EGDB instance, restart the PostgreSQL service by clicking Start > All Programs > PostgreSQL 8.3 > Start service.
You can now work with your data on the new instance.