Migrating to new server

Hi there Im migrating according to this documentation:


When I use this command:
virtualmin backup-domain --dest /root/backups/ --all-domains --all-features --newformat --all-virtualmin

Most of my virtual servers are backed up but a few of them arent backed…

Later I use this command on new server:
virtualmin restore-domain --source /root/backups/virtualmin.tar.gz --all-virtualmin
But virtualmin.tar.gz doesnt exist, I guess it is a place holder and one should write every server name one by one to restore backup.

I have a server which has subdomains and they are backed as main.com.tar.gz, sub1.main.com.tar.gz, sub2.com.tar.gz, sub3.com.tar.gz. How can I back up all of these?
virtualmin restore-domain --source /root/backups/main.tar.gz --all-virtualmin
does not work
virtualmin restore-domain --source /root/backups/sub1.main.com.tar.gz --all-virtualmin
doesnt work and asks for main.com

What should be the next steps? Because some servers could be successfully restored, but I havent seen them on virtualmin GUI when I logged in.

I havent used command virtualmin restore-domain --source /root/backups/ --all-domains --all-features yet because I couldnt restore all my domains.

Also one server is very big and scp -r /root/backups root@new_server.com:/root/ will require many hours, I cant leave my home computer open that long, could you suggest me a way so that copying from server1 to server2 would work without me logged in to servers after applying the command?



Are you seeing any errors during the backup process? The above command should definitely backup all Virtual Servers in Virtualmin, and generate the virtualmin.tar.gz. But if there is an error during the backup process, that could explain what you’re describing.


I didnt notice an error message but now I wanted to try again the backup so I deleted the previous backups but it got stuck at Craeting TAR file of home directory and does not do anything anymore… but after waiting a file I received no space left on device… the total of servers are 20GB but there is 100 GB free space I dont understand…

I freed 300GB space the same error.

Backing up AWstats configuration file ..
.. done

Creating TAR file of home directory ..
.. TAR failed! cat: write error: No space left on device

gzip: stdout: Broken pipe
/bin/tar: -: Wrote only 6144 of 10240 bytes
/bin/tar: Error is not recoverable: exiting now

    Saving Virtualmin configuration ..
    .. done

    Saving templates and plans ..

Failed to open /tmp/.webmin/799694_5888_31_backup-domain.pl/0 for writing : No such file or directory at …/web-lib-funcs.pl line 1427.

I found the problem, root directory had a limited space which I didnt know, so I backed up all the servers in /home directory and then I used this command:

virtualmin restore-domain --source /home/backups/virtualmin.tar.gz --all-virtualmin

All was restored successfully later I used this command

virtualmin restore-domain --source /home/backups/ --all-domains --all-features

But I got these errors:

Starting restore…
Extracting backup archive files …
… extraction of /home/backups//myserver.com.tar.gz failed : /bin/tar: ./.backup/myserver.com_mysql_bekup.gz: Wrote only 4608 of 10240 bytes
/bin/tar: ./.backup/myserver.com_mysql_myserver_roundcube.gz: Cannot write: No space left on device
/bin/tar: ./.backup/myserver.com_mysql_myservers_blabla.gz: Cannot write: No space left on device

/bin/tar: ./.backup/myserver.com_webmin: Cannot write: No space left on device
/bin/tar: Exiting with failure status due to previous errors

Backup does not contain virtual server information for missing domain anotherserver.org.

Restore failed!

I have 400 GB free space…

Hi guys… just chatted with the anarchy7 on irc and issue was resolved.

Thanks to unborn, with his hints I figured out a lot and was able to migrate.

Now when I ping www.mywebsite.com it still gives me the old server IP address. The old server is still online of course. but it will soon be offline, today is the last day actually. So what is your advice?

PS: I have custom name servers ns1.mywebsite.com, ns2.mywebsite.com

if the migration of all old files and database are done onto the new server with the new IP. you would have to update the nameserver to the new IP or point the A records to the new IP… before that you might want to reduce the TTL time… i have used http://www.intodns.com/

All the best

Hi masterg0g0, thanks for the assit, I went to old serer changed the A record to new IP but Virtualmin complained that the virtual server’s IP is different, so I went to webmin added an interface for the new IP, then I wanted to change to new IP but VIrtualmin gave again error said the IP is being used… In the new server, VIrtualmin already has the new ip and new A records.

You could possibly, Till your new CNAME, propagates, You could 302 Forward from your Last site…

The “A” name should hit in 15 minutes or less, Depending on your Registrar… As Long as The “A” Name Is propagated you can forward.

Another issue occurred sorry for posting too often… After backup all was good when I visited server IP the default website was being displayed but virtualmin had like 18 updates, so I installed them, then webmin stopped, I restarted it, it said postfix mail server is pointing to old server IP address, I corrected it and restarted a mail service then all was good again but now when I go to server IP it displays the default apache “It works” page… weird, how can I make it show the default website again?

Sounds like you “index” was written over… Not sure, I just did the 17 Updates (for me) today without issue. I’m sure virtualmin is confused somewhere, You might want to try and tar up your site (Manually), disassociate your DB(s). delete it (The New Site) and re-install… Should get Vmins Settings right…

I’ve had to do it a couple times, But don’t restore the Webmin/Virtualmin settings, You’ll have to redo all that :sunglasses:

It’s an Idea, Pretty sure it’ll get you back up and running, but some variant might work…