Skip to content

Instantly share code, notes, and snippets.

@amit177
Last active June 18, 2022 19:45
Show Gist options
  • Save amit177/dc5f026069d77bb81394c33bf61ae7cb to your computer and use it in GitHub Desktop.
Save amit177/dc5f026069d77bb81394c33bf61ae7cb to your computer and use it in GitHub Desktop.
Virtualizor KVM - Master Migration
  1. Install the new master using the same VG name as the old master
  2. Turn on maintenance mode in Configuration --> Maintenance
  3. In the old master, go to Backup --> Database Backup --> Immediate Backup --> Start Database Backup
  4. Download the database backup and upload it to the folder /var/virtualizor/dbbackups/ in the new master
  5. Restore the database backup in the new master using the command /usr/local/emps/bin/php /usr/local/virtualizor/scripts/db_restore.php
  6. Copy all of the XML files from /etc/libvirt/qemu/ to the new master
  7. Copy all of the OS templates from /var/virtualizor/kvm/ to the new master
  8. Run lvscan and create each LV in the new master (lvcreate --name vsvXXXXXXXXXXX -L SIZEG VGNAME)
  9. Turn off all of the VMs and then export each LV into a .img file using the command dd if=/dev/VGNAME/vsvXXXXXXXXXXXXXX of=vsvXXXXXX.img bs=8M status=progress Note that this step will require a lot of storage, I recommend attaching an external hard drive and saving the .img files in there
  10. Import the .img file in the new master (dd if=vsvXXXXXX.img of=/dev/VGNAME/vsvXXXXXXXXXXXXXX bs=8M status=progress)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment