Migration guide for Ubuntu 16.04

Prerequisites:

Create an Exoscale SOS S3 bucket and add an IAM key

Log in to your EXOSCALE portal and click on “Object Storage”.

Create a new bucket and select a storage location.

0.65

Click on the left side on “IAM” and create a “restricted” key for your bucket

0.65

Now save key and secret.

Note

Please do not share them with others

0.65

Preparation of the existing server

Collect network information from your system (IP address + subnet mask and default gateway):

Note

  1. ip a -> shows the current network configuration
  2. IP is shown in format aaa.bbb.ccc.ddd/24, you can calculate the subnet e.g. here: https://www.heise.de/netze/tools/netzwerkrechner/ eg: IP address/28 = subnet mask 255.255.255.0 -> this info will be needed later on
  3. ip route show -> show the current gateway in the line starting with “default

Clean up your memory if necessary to have at least 300 MB free space (remove old kernel + intramfs files)

Then 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

First select the language:

0.65

0.65

0.65

0.65

0.65

0.65

0.65

0.65

Configuring the network settings

0.65

Select the option “static” here.

0.65

Now enter the network information collected during step 2:

0.65

0.65

0.65

0.65

Configure the S3 bucket you have set up in advance on EXOSCALE

0.65

Please enter the following commands - as shown in the screenshot - with the data of your S3 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

Please verify your input with the command: 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 (please write it down, because it will be needed later)

0.65

Please 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

Please select “Reboot” and click “Enter” when prompted.

0.65

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

0.65

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

0.65

Register Ubuntu template on Exoscale

  • Now please log in to portal.exoscale.com
  • Go to Compute -> Templates -> AT-VIE-1 -> Register
  • Fill in the fields as follows:
Description: Ubuntu 16.04 Cloud
Download URL: https://coe-template-bucket.sos-at-vie-1.exo.io/ubuntu_16.04/ubuntu_16.04.qcow2
MD5 Checksum: 188eb956ca5879a15feedebd186200f4
User: ubuntu

0.65

Setting up SSH keys and the firewall on Exoscale is outside the scope of this document. You can find more information in the community section of EXOSCALE: https://community.exoscale.com/documentation/compute/ssh-keypairs/ https://community.exoscale.com/documentation/compute/security-groups/

0.65

Setting up the firewall

In the EXOSCALE portal, go to the Compute -> Firewalling menu.

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 this template

  • Go to Compute -> Instances -> Add
  • Select the rightmost tab for Template
  • 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

0.65

Starting your new EXOSCALE server

  • Open the console in Exoscale and click on “Send CtrlAltDel” to restart the instance
  • Select “Clonezilla live” in the Grub menu

0.65

Select here, as before, the language

0.65

0.65

0.65

0.65

0.65

0.65

Select the mode: “Start Clonezilla” !

0.65

Now select “device-Imag” here

0.65

As before, go here to the “s3_server” item

0.65

Select “dhcp” only

0.65

Configure the S3 bucket

0.65

Please enter the following commands - as shown in the screenshot - with the data of your S3 bucket. - Please enter your created key instead of key and the corresponding secret instead of secret.

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

chmod 600 /root/.passwd-s3fs

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

Please check your input with the command: df -h

0.65

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

Now select “Beginner

0.65

In the following menu, please select “restoredisk

0.65

Enter here the name for your backup, which you have chosen in step 3.4

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

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

0.65

Logging into the web console again

  • Log in to the Exoscale web console as root (with the password of your old server)
  • Modify the /etc/network/interfaces file with a text editor (e.g. nano or vim) as shown in the following screenshot:

0.65

  • After that, perform a reboot of the system
  • You can login again with SSH (you need to set up the “security group” correctly including port 22)

Remove Clonezilla and Grub to free up disk space

  • Run the following tasks/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