{"id":2320,"date":"2016-09-09T11:00:25","date_gmt":"2016-09-09T08:00:25","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/reinstalling-server-keeping-ip-addresses\/"},"modified":"2016-09-09T11:00:25","modified_gmt":"2016-09-09T08:00:25","slug":"reinstalling-server-keeping-ip-addresses","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/reinstalling-server-keeping-ip-addresses\/","title":{"rendered":"Reinstalling your server while keeping the IP addresses"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you ever need to get a fresh install of your cloud server, but would also want to retain the IP addresses from your old host, then this guide is for you. The storage devices containing the operating system for your servers are easy to configure, move and remove using the features at your UpCloud control panel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In essence, to reinstall the OS for your server, you will need to deploy a temporary new host with the OS of your choice, replace the old server storage with the freshly installed disk, and you are done. Follow up&nbsp;below with the exact steps on how this is done.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/signup.upcloud.com\/\">Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Deploy a new identical server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To start with, log into your <a href=\"https:\/\/hub.upcloud.com\/deploy\" target=\"_blank\" rel=\"noopener\">UpCloud control panel<\/a>&nbsp;and deploy a new cloud server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the deployment page, make the following configurations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select the same location and plan as your current server<\/li>\n\n\n\n<li>Name the storage device such that you\u2019ll recognise it later<br><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5711\" src=\"https:\/\/upcloud.com\/media\/fresh-ubuntu.png\" alt=\"Name the storage device\" width=\"886\" height=\"396\" \/><\/li>\n\n\n\n<li>Pick the operating system you want<\/li>\n\n\n\n<li>Include any SSH keys<\/li>\n\n\n\n<li>Add the following initialization script to automatically shut down the server after deployment\n<pre>shutdown -h 1<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13927 size-full\" src=\"https:\/\/upcloud.com\/media\/shutdown-init-script.png\" alt=\"Script to shutdown after deployment\" width=\"884\" height=\"468\" \/><\/figure><p><\/p>\n<\/li>\n\n\n\n<li>In the last step, set the hostname and description the same as your current server<br><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"286\" class=\"alignnone size-full wp-image-5713\" src=\"https:\/\/upcloud.com\/media\/name-server.png\" alt=\"Name the new server\" \/><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once you are done configuring the new host, click the <em>Deploy<\/em> button at the bottom of the page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Moving the fresh install<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While waiting for the new server to finish deploying, shut&nbsp;down&nbsp;the current&nbsp;host either at&nbsp;the <a href=\"https:\/\/hub.upcloud.com\/\" target=\"_blank\" rel=\"noopener\">server list<\/a>&nbsp;or in your server settings.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/shutdown-current-server.png\" alt=\"Shuting down the current server\" class=\"wp-image-5715\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you included the shutdown script&nbsp;at deployment, the&nbsp;new server should&nbsp;also&nbsp;be&nbsp;powered down. Otherwise, shut it down manually.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, open the settings of the <strong>newly deployed&nbsp;server<\/strong> and go to the <em>Storage<\/em> tab. Click&nbsp;the&nbsp;eject icon to detach the&nbsp;storage device.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/attach-existing-storage-1.webp\" alt=\"Attaching existing storage\" class=\"wp-image-22625\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then, open the server settings of your <strong>current server<\/strong>. With the server powered down, go to the&nbsp;<em>Storage<\/em> tab to continue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Detach the first device as you did above if you wish to keep it as a backup, or optionally you can delete it right away by clicking the bin icon if it\u2019s no longer needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, add the new device by clicking the <em>Attach existing storage<\/em> button. Then find the new disk by its name on the list of available storage devices, your free storage devices are at the top of the list.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the right device selected, click the Add a storage device button to confirm.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/attach-existing-storage-device.webp\" alt=\"Attaching existing storage device\" class=\"wp-image-22624\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the storage is attached, you can go ahead and boot up the server again with the clean installed OS. Log into the host using the new root password or any SSH keys you may have assigned at deployment and confirm the server is working properly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cleaning up<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Afterwards, you can delete the temporary server from the server settings.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/delete-temporary-server.png\" alt=\"Delete temporary server\" class=\"wp-image-5719\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The old storage device can also be deleted from your <a rel=\"noopener\" href=\"https:\/\/hub.upcloud.com\/storage\" target=\"_blank\">Storage list<\/a> if you no longer need it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/delete-storage-device.png\" alt=\"Delete the old storage device\" class=\"wp-image-5720\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If the server is having connectivity problems after the system device swap, you can use VNC or the web console to log in. For servers running CentOS 6.7 or older and Ubuntu 12.04 or older, you may need to remove the old MAC address reference file and restart the server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo rm \/etc\/udev\/rules.d\/70-persistent-net.rules\nsudo reboot<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then test the network connectivity again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You should now have a clean installation of the OS of your choosing up and running with all the previously configured resources. To get started again you may wish to take a look at our guide for <a href=\"https:\/\/upcloud.com\/global\/community\/tutorials\/ \/secure-linux-cloud-server\/\" target=\"_blank\" rel=\"noopener\">how to secure your Linux cloud server<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you know you may need to reinstall the system again in the future, it may be more convenient to take a backup of the fresh install which can then be easily restored in moments. You can find out more about the feature in the guide for <a href=\"https:\/\/upcloud.com\/global\/community\/tutorials\/ \/taking-backups\/\" target=\"_blank\" rel=\"noopener\">taking backups<\/a>.<\/p>\n","protected":false},"author":3,"featured_media":27264,"comment_status":"open","ping_status":"closed","template":"","community-category":[247],"class_list":["post-2320","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=2320"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2320\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=2320"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=2320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}