How to update a running instance on ec2 without losing data?

when i try to connect ubuntu on ec2 I get the following message

New release 'natty' available.
Run 'do-release-upgrade' to upgrade to it.

But when i try to run this command I get this message:

This session appears to be running under ssh. It is not recommended 
to perform a upgrade over ssh currently because in case of failure it 
is harder to recover. 

If you continue, an additional ssh daemon will be started at port 
'1022'. 
Do you want to continue? 

It says that "It is not recommended to perform a upgrade over ssh". If i can't run this over ssh, Whats the other alternative to update my Ubuntu. Also, I really don't want to loose my data on ec2.


Create an amazon image (AMI) of the server and then perform the upgrade. If it fails, replace the server from the image and come back here and ask again. If it works, be happy.


When connecting over ssh launch "byobu". This is a tool that keeps your processes alive (by detaching them from your current session) after possible network disconnects. When you reconnect to the server you are automatically reattached to your previous session..no harm done.

More info can be found on https://launchpad.net/byobu

Note that the tool comes standard with Ubuntu repositories, so it should be a fuzz to install.