Migration Guide for Ubuntu 16.04

Prerequisites:

Create an Exoscale SOS Bucket and Add an IAM Key

Log in to the Exoscale Portal and click on STORAGE in the main navigation on the left. Click on the ADD button in the top right of the header to create a new bucket and select a zone.

0.65

Next, click on IAM in the main navigation and create a RESTRICTED key for your bucket.

0.65

Save key and secret. Please do not share your IAM key or secret with any third parties.

0.65

Preparation of the Existing Server

Collect network information from your system, such as the IP address and subnet mask, and default gateway:

To get your system information: 1. The command ip a shows the current network configuration. 2. The IP address is shown in format aaa.bbb.ccc.ddd/24. You can calculate the subnet at heise.de (in German) or use another subnet calculator. For example, IP address/28 = subnet mask 255.255.255.0. This info will be needed later. 3. The command ip route show shows the current gateway in the line starting with default.

If necessary, make sure to clean up your memory for at least 300 MB free space. We suggest you remove old kernel + intramfs files.

Perform a reboot

Load the file clonezilla.iso into the folder /boot.

sudo curl https://coe-template-bucket.sos-at-vie-1.exo.io/clonezilla/clonezilla.iso -o /boot/clonezilla.iso

Add it to GRUB2 bootloader.

mkdir -p /root/backup
cp /etc/grub.d/40_custom /root/backup
cp /etc/default/grub /root/backup
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/grub -o /etc/default/grub
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/40_custom -o /etc/grub.d/40_custom
update-grub2

Clonezilla on your Existing Server

Log in as root in the console and then reboot your system Select Clonezilla Live in Grub menu.

Start Clonezilla and set up the configuration

Select the language:

0.65

0.65

0.65

0.65

0.65

0.65

0.65

0.65

Configure the network settings

0.65

Select the option static.

0.65

Enter the network information you collected in Step 2:

0.65

0.65

0.65

0.65

Configure the S3 bucket you have set up

0.65

Enter the following commands as shown in the screenshot with the data of your SOS bucket:

echo "key:secret" > /root/.passwd-s3fs

chmod 600 /root/.passwd-s3fs

s3fs bucketname /home/partimag -o url=https://sos-at-vie-1.exo.io

Verify your input with df -h.

0.65

End this session with the command exit to return to the setup.

0.65

Create the image

Select Beginner

0.65

Leave the selection savedisk and click Enter.

0.65

You can choose a name for your backup. Make sure to write it down, because you will need it later.

0.65

Do not change anything here and click Enter.

0.65

You can skip the next steps by clicking Enter.

0.65

0.65

0.65

0.65

Select Reboot and click Enter when the prompt appears.

0.65

To confirm this step, type y and then click Enter.

0.65

Now the backup of your data is running. After backup is complete, the server will reboot.

0.65

Add an Ubuntu template on Exoscale

  • Log into the Exoscale Portal.
  • Go to COMPUTE, then TEMPLATES, and click on the ADD button in the top right of the header.
  • Enter in the form fields as follows:
Zone: AT-VIE-1
Name: Ubuntu 16.04 Cloud
Source URL: https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/ubuntu_16.04.qcow2
Checksum: 188eb956ca5879a15feedebd186200f4

After you click on the toggle to enable SSH, add:

Login Username: ubuntu

0.65

While setup of SSH keys on Exoscale is not in the scope of this guide, you can find more information in our documentation section on SSH Keypairs and Security Groups.

0.65

Setting up the firewall

In the Portal, go to the COMPUTE, and then SECURITY GROUPS.

You can use the default Security Group or create your own. To configure the firewall correctly, make sure to enable access via SSH.

0.65

Create a new instance using your new template

  • Go to COMPUTE, then INSTANCES and click on the ADD button in the top right of the header.
  • Select the Template.
  • Note: Your disk space should be at least the same size on Exoscale as on your old server.
  • Hostname should be the same as on your old server as well.

0.65

Starting your new Exoscale server

  • Open the console in the Portal from the instance detail view. - Click on Send CtrlAltDel to restart the instance.
  • Select Clonezilla live in the Grub menu.

0.65

Select the language:

0.65

0.65

0.65

0.65

0.65

0.65

Select the mode: “Start Clonezilla” !

0.65

Select device-image.

0.65

Go to the s3_server item.

0.65

Select dhcp only.

0.65

Configure the S3 bucket

0.65

Enter the following commands as shown in the screenshot with the data of your SOS bucket:

echo "key:secret" > /root/.passwd-s3fs

chmod 600 /root/.passwd-s3fs

s3fs bucketname /home/partimag -o url=https://sos-at-vie-1.exo.io

Verify your input with df -h.

0.65

End this session with the command exit to return to the setup.

Select Beginner.

0.65

In the following menu, select restoredisk.

0.65

Enter the name for your backup, that you created in step 3.

0.65

You do not need to make any changes here.

0.65

Leave the settings here as well and click Enter.

0.65

Select Restart.

0.65

0.65

Confirm this step by typing “y” and then click “Enter”.

0.65

To confirm this step, type y and then click Enter.

0.65

Log into the web console again

  • Log into the web console for your instance in the Exocale Portal as root (with the password of your old server)
  • Modify the /etc/network/interfaces file with a text editor as shown:

0.65

  • Perform a reboot of the system
  • You can login again with SSH (but make sure to set up the Security Group correctly including port 22)

Remove Clonezilla and Grub to free up disk space

Run the following commands on the new server:

/bin/cp -f /root/backup/40_custom /etc/grub.d/40_custom
rm -f /boot/clonezilla.iso
update-grub2

Add Cloud-Init to the System (Optional)

Run the following commands on the new server:

apt-get update
apt-get upgrade
reboot
apt-get install cloud-init cloud-guest-utils cloud-initramfs-copymods cloud-initramfs-dyn-netconf
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/80_apt.cfg -o /etc/cloud/cloud.cfg.d/80_apt.cfg
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/80_root.cfg -o /etc/cloud/cloud.cfg.d/80_root.cfg
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/90_dpkg.cfg -o /etc/cloud/cloud.cfg.d/90_dpkg.cfg
curl https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/80_ssh.cfg -o /etc/cloud/cloud.cfg.d/80_ssh.cfg
reboot