Migrate OpenBSD to bigger hdd vps using dump | ssh | restore OVH cloud
At the end of 2025 OVH introduce new vps-1 servers with following parameters:
CPU 4 vCore, 8 GB RAM, 75 GB SSD NVMe
So I decided to upgrade and migrate my old vps with openbsd with following procedure.
1. Upgrade current vps server to the latest available OpenBSD version (migration must be done to the same target version).
2. Order new VPS-1 in OVH with Debian distribution. Provider will send You data to access machine by ssh. Login to vps and note down network configuration.
3. Download OpenBSD ramdisk kernel (to same version as on the old server) and prepare grub menu:
cd /tmp;
https://ftp.eu.openbsd.org/pub/OpenBSD/7.8/amd64/bsd.rd
sudo mv bsd.rd /
nano /etc/grub.d/40_custom
menuentry "openbsd" {
set root=(hd0,gpt1)
kopenbsd /openbsd.rd
}Then edit default grub menu options:
nano /etc/default/grub
GRUB_HIDDEN_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10run update-grub command.
4. Reboot server using OVH KVM console and perform a normal BSD installation.
During network configuration you can use dhcp configuration or settings noted above.
When setup is complete reboot server.
5. Migrate configuration from old vps to the new one.
Depending on Your needs, number of system updates performed on the old server and the complexity of the configuration, you need to choose the method of migrating settings and data.
In my case I decided to:
6. install same packages as on old server, using following commands:
use pkg_info -mz > installed_list on the source machine and
pkg_add -l installed_list on the destination machine.
7. migrate configuration data using dump | ssh | restore commands
on new vps create directory for old vps
mkdir /home/user/vpsoldthen on old vps execute following
dump -0auf - /etc | ssh moc.hvo.spvwen@resu "cd /home/user/vpsold/ && restore -rf -"
dump -0auf - /root | ssh moc.hvo.spvwen@resu "cd /home/user/vpsold/ && restore -rf -"
dump -0auf - /var | ssh moc.hvo.spvwen@resu "cd /home/user/vpsold/ && restore -rf -"
dump -0auf - /home | ssh moc.hvo.spvwen@resu "cd /home/user/vpsold/ && restore -rf -"In general (if you have more or less standard installation) you need just to migrate /root, /etc, /var and /home directories.
In last steps, merge or copy configuration files to proper locations in /etc.
Test services using -nv switches e.g httpd -nv
If it works OK, use rcctl to enable and start it.
Based on:
https://raby.sh/installing-openbsd-on-ovhs-vps-2016-kvm-machines.html
https://blog.danmassey.net/using-dump-and-restore-to-migrate-freebsd-to-esx-server/
man dump
man restore