Migrating to a new server - More questions

OS type and version Ubuntu 18.04 & 22.04
Virtualmin version Virtualmin Pro 7.7

I got some answers from an earlier topic, but I have a few more.

I have a brand new VPS with Virtualmin 7.7 installed. I read the description at: Migrating To a New Server – Virtualmin and it leaves some holes:

  • Does this documentation work for current Virtualmin? Could I basically copy/paste these commands into my old server? e.g.

    ~# mkdir /root/backups
    ~# virtualmin backup-domain --dest /root/backups/ --all-domains --all-features --newformat --all-virtualmin
    ~# scp -r /root/backups root@new-server.com:/root/

    and then on the new…

    ~# virtualmin restore-domain --source /root/backups/virtualmin.tar.gz --all-virtualmin
    ~# virtualmin restore-domain --source /root/backups/ --all-domains --all-features
  • Does this copy the entire backup in one go? What if the receiving VPS doesn’t have enough disk space for two copies of the data (the backup and the “live copy”)?

  • Or is there a way to copy site-by-site? (maybe something besides the --all-domains option)?

  • I already created a Wordpress site on the new server. Will the process overwrite the new Wordpress site? Would I be better off deleting it, migrating the whole lot, then re-creating that new server? (It’s not in production, so that’s not a big deal.)

Many thanks.

this works for me for a single site:

virtualmin backup-domain --domain xxxxxxx.org --all-features --newformat --dest /root/zzzzz/ --mkdir

But when doing a single domain, I am not sure if “–all-virtualmin” should be used or not.

Not sure about any of your other questions, sorry.

We just transfer one domain at a time, to much could go wrong with that command, This way we do as much or as little as we have time for.

virualmin > server config > transfer virtual server (disable on this system)

Test and job done …

If you moving to a VPS you should be able to snapshot the server so if something goes wrong just restore the snapshot. So you can test it without worries. I think the wordress maybe destroyed, all depend what your restoring, not 100% sure.

Progress Report: I made some progress in migrating sites to a new server.

  • I backed up one of my virtual hosts with:

    sudo virtualmin backup-domain --domain mydomain.org --all-features --newformat --dest /root/mydomain/ --mkdir
  • I then copied that backup to the new server with this command. Note: see this post for a hint on ssh access

    scp -r /root/mydomain root@new-host.com:/root
  • I then restored the virtual host on new-host.com using:

    virtualmin restore-domain --source /root/mydomain/ --domain mydomain.org --all-features
  • This recreated the /home/mydomain directory, put all the files into that directory, and created the MySQL database tables. But now when I connect to mydomain.org, I see an error message saying “Error establishing a database connection” I suspect that this is because the password for that database isn’t correct.

What’s the best way to fix this? Thanks.

Solved. I did everything in the previous post, but I also needed to set the user password for the randomly-created mySQL password on new-host.com

To do this, go to Webmin → Servers → MySQL Database Server and click User Permissions

Click the proper username, and in the Password item enter the new password in the Set to… box.

Click Save and Presto! A new password, and the database connection is restored and the website works.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.