So I have this google cloud instance running Centos 7 with a bunch of stuff installed and I am trying to avoid going through the painful process of reinstalling everything again .
For the last 3 days I have been looking for a way to clone my instance into another VPS and am yet to find something that works .
My first approach was to use dd to clone the main partition but even after being able to restore it to another HDD and setting it as boot partition everything broke and never managed to boot from it .
Here are the partitions I have in my google cloud instance :
Code:
[root@instance-7 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
└─sda1 8:1 0 10G 0 part /
sdb 8:16 0 14G 0 disk
└─sdb2 8:18 0 14G 0 part /mnt/sdb2
sdb is just a disk I have created to clone the main partition image, so what I need to restore is /dev/sda
Made a raw image using dd like this :
Code:
dd if=/dev/sda | gzip -c > /mnt/sdb2/backup.img.gz
sda filesystem is xts as I can see per df -Th command :
Code:
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs tmpfs 1.8G 0 1.8G 0% /dev/shm
tmpfs tmpfs 1.8G 193M 1.6G 11% /run
tmpfs tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup
/dev/sda1 xfs 10G 8.0G 2.1G 80% /
tmpfs tmpfs 354M 0 354M 0% /run/user/0
tmpfs tmpfs 354M 0 354M 0% /run/user/1000
/dev/sdb2 ext4 14G 5.6G 7.4G 44% /mnt/sdb2
Tried restoring the image multiple times without success with command :
Code:
gunzip -c /path/to/your-backup.img.gz | dd of=/dev/sdX
I also converted the destination partition filesystem to xfs .
So far unable to boot from both vps's where I tried to clone it .
Any hints to what else I can do to debug this properly ?
Thanks
Please visit our sponsors
Results 1 to 2 of 2
Hybrid View
-
31-10-2024, 11:08 AM #1
Can I Import a google cloud instance to another VPS using DD backup & restore ?
-
Sponsored Links
-
31-10-2024, 11:20 AM #2
- Join Date
- Jul 2015
- Location
- Usa
- Posts
- 255
- Feedback Score
- 0
- Thanks
- 0
- Thanked 0 Times in 0 Posts
When you use dd to clone the partition, sometimes the bootloader settings and other system configurations don’t carry over perfectly, especially when migrating to a different VPS provider. You might want to check if your new VPS uses a different bootloader (like Grub), which could cause the instance not to boot properly. Another option is to use a tool like Clonezilla for cloning, as it might handle the bootloader and partition tables more gracefully.
I’ve had similar issues, and what worked for me was also reconfiguring the fstab file and making sure the UUIDs for the partitions matched. As for hosting costs on Google Cloud, you can get a decent setup like the n1-standard-1 for about $0.0475 per hour. You can check out Google Cloud Pricing for more details, including discounts for sustained usage, which might help if you decide to keep the instance there.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
24 Hour Gold
Advertising
- Over 20.000 UNIQUE Daily!
- Get Maximum Exposure For Your Site!
- Get QUALITY Converting Traffic!
- Advertise Here Today!
Out Of Billions Of Website's Online.
Members Are Online From.
- Get Maximum Exposure For Your Site!
- Get QUALITY Converting Traffic!
- Advertise Here Today!
Out Of Billions Of Website's Online.
Members Are Online From.