So you have incremental backups - what how do you use them? This guide will walk you through the process of restoring your incremental backups.
Looking to create incremental backups? Take a look at our guide!
First, you will need to identify which backup is to be used in the restoration process. You can do this using the following command:
virsh -c qemu:///system snapshot-list YOUR_MACHINE_NAME
Be sure to substitute YOUR_MACHINE_NAME with the name of the machine to be modified.
You should see output similar to this:
Name Creation Time State
------------------------------------------------------------
backup1 2016-05-23 06:47:45 -0400 shutoff
backup2 2016-05-23 06:49:02 -0400 shutoff
backup3 2016-05-23 07:32:37 -0400 shutoff
Note the name of the backup you plan to use and then move on.
With this information you can begin the restoration process. To do this, shut down your virtual machine using the following command:
virsh -c qemu:///system shutdown YOUR_MACHINE_NAME
Next, edit your virtual machines definition using the command below:
virsh -c qemu:///system edit YOUR_MACHINE_NAME
After executing this you will see the XML definition for your virtual machine, look for lines similar to what is shown below:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/home/virtkick/hdd/1_testbackup2_fb7715a2-1607-40c8-bc33-d31b3cd20489.backup3'/> <--- You need to edit this line
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
Edit the line highlighted above, replace the existing path to reference the backup you want to restore from. For example, if you want to use backup2
replace the line above like so:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/home/virtkick/hdd/1_testbackup2_fb7715a2-1607-40c8-bc33-d31b3cd20489.backup2'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
If you are okay with the above information, you can start your virtual machine using the following command:
virsh -c qemu:///system start YOUR_MACHINE_NAME
You may need to restore your incremental backups on a hypervisor other than the one where the backups were created. To do this you need the XML definition for the domain in question. You can obtain this using the virsh
command dumpxml
like so:
virsh -c qemu:///system dumpxml YOUR_MACHINE_NAME > /path/where/you/want/the/xml/file.xml
Move this file to the hypervisor where the restoration is to happen. Edit the XML file just like we did in step two, update the source file=
line to reflect the path to the backup you want to use. Afterwords, you will need to define the machine in addition to starting it.
You can define the machine using the following command:
virsh -c qemu:///system define /path/to/your/xml/file.xml
Finally you can start the machine:
virsh -c qemu:///system start YOUR_MACHINE_NAME
Have any problems? Let us know - we are happy to help!
comments powered by Disqus