server_UUID<\/span><\/pre>\n\n\n\n{\n \"server\" : {\n \"simple_backup\": \"0430,dailies\"\n }\n}<\/pre>\n\n\n\nDisabling the Simple Backup plan can likewise be done with a single API query by setting the simple_backup<\/tt> as no<\/tt>.<\/p>\n\n\n\nPUT \/1.3\/server\/server_UUID<\/span><\/pre>\n\n\n\n{\n \"server\" : {\n \"simple_backup\": \"no\"\n }\n}<\/pre>\n\n\n\nThat\u2019s it, quick and easy.<\/p>\n\n\n\n
Setting up automated Flexible backups<\/h2>\n\n\n\n
Configuring an automated backup schedule works by modifying a storage device to add a backup_rules<\/tt> segment with a PUT request. These rules define how often a backup is taken, at what time of the day should the backup be stored, and how long each backup is kept before automated deletion. The following parameters are accepted in the backup rules.<\/p>\n\n\n\n\"interval\": \"daily \/ mon \/ tue \/ wed \/ thu \/ fri \/ sat \/ sun\"\n\"time\": \"0000-2359\"\n\"retention\": \"1-1095\"<\/pre>\n\n\n\nThe example backup rule below will set up a weekly backup taken every Saturday morning at 4:30 and retained for 8 days.<\/p>\n\n\n\n
PUT \/1.3\/storage\/storage_UUID<\/span>\n{\n \"storage\": {\n \"backup_rule\": {\n \"interval\": \"sat\",\n \"time\": \"0430\",\n \"retention\": \"8\"\n }\n }\n<\/pre>\n\n\n\nThe currently active backup rules will show up in the storage details.<\/p>\n\n\n\n
GET \/1.3\/storage\/storage_UUID<\/span><\/pre>\n\n\n\nCreating on-demand backup<\/h2>\n\n\n\n
Taking an on-demand backup is fast and simple. The following POST request allows you to create a new backup disk of a specific storage device identified by the storage UUID. Include a title in the body of the request, as shown in the example below, to give a name or description of the backup device.<\/p>\n\n\n\n
POST \/1.3\/storage\/storage_UUID<\/span>\/backup\n{\n \"storage\": {\n \"title\": \"Manually created backup\"\n }\n}<\/pre>\n\n\n\nIn response to a successful operation, you will get the details of the new backup storage.<\/p>\n\n\n\n
Restoring a backup<\/h2>\n\n\n\n
The main method of restoring backups is, in essence, reverting the storage disk back to the same state it was when the backup was taken.<\/p>\n\n\n\n
You can get a list of all of your backup storage with the GET request below.<\/p>\n\n\n\n
GET \/1.3\/storage\/backup<\/pre>\n\n\n\nWhen restoring a backup, the server that the origin storage is attached to must first be shut down and in the stopped<\/tt> state. To find out the correct server UUID, use the following GET request with the storage UUID, as indicated by the origin in the backup, to fetch the full details of the disk you wish to restore.<\/p>\n\n\n\nGET \/1.3\/storage\/storage_UUID<\/span><\/pre>\n\n\n\n{\n \"storage\": {\n ...\n \"servers\": {\n \"server\": [\n \"00e46b2e-0909-4e77-8acb-4b21e75cb5b9\"\n ]\n },\n ...\n }\n}<\/pre>\n\n\n\nThen stop the server in preparation for the restore.<\/p>\n\n\n\n
POST \/1.3\/server\/server_UUID<\/span>\/stop<\/pre>\n\n\n\nOnce the server has been powered down, use the following POST request while replacing the backup_UUID<\/tt><\/span> with the UUID of the backup you wish to restore.<\/p>\n\n\n\nPOST \/1.3\/storage\/backup_UUID<\/span>\/restore<\/pre>\n\n\n\nRestoring a backup will only take a moment depending on the size of the storage device. Once completed, you can restart the server again with the storage disk reverted to the backup state. Although the initial restore is fast, the new storage state must finish a background synchronisation before further actions, for example taking a new backup, can be made.<\/p>\n\n\n\n
Cloning a new disk from a backup<\/h2>\n\n\n\n
Sometimes you might not want or be able to shut down the server the origin storage is attached to, yet you would need to get access to the files stored in a backup. This can be done by cloning the backup disk to create an entirely new storage device.<\/p>\n\n\n\n
Backup disks are treated much the same as any other storage device. You can clone any backup storage using the following POST request.<\/p>\n\n\n\n
Take care when choosing the target zone for cloning a storage disk. While cloning within one zone is quick, operations between different zones can be time-consuming.<\/p>\n\n\n\n
POST \/1.3\/storage\/backup_UUID<\/span>\/clone\n{\n \"storage\" : {\n \"zone\" : \"fi-hel1\",\n \"tier\" : \"maxiops\",\n \"title\" : \"Clone of a backup disk\"\n }\n}<\/pre>\n\n\n\nThe response will return the details of the new cloned storage device, such as its UUID. Then to access the backup files, attach the new disk to an existing server or deploy a new host using the storage disk instead of a public template.<\/p>\n\n\n\n
Summary<\/h2>\n\n\n\n
Managing your backups using the UpCloud API is really quite simple and easy to implement in any programming language with support for HTTP libraries. Check out the full API Documentation<\/a> to learn more about the features the UpCloud API offers.<\/p>\n","protected":false},"featured_media":27275,"comment_status":"open","ping_status":"closed","template":"","community-category":[109,120,122],"class_list":["post-24430","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-upcloud-services","community-category-backups","community-category-api"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24430"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/27275"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24430"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}