Error when trying to migrate to new server

I follow this guide

https://www.virtualmin.com/migrate/

But when trying

virtualmin restore-domain --source /root/migback/ --all-domains --all-features

It throws this error

Failed to read backup file : /root/migback//swedmr.se.tar.bz2 : Not a valid tar or tar.gz file

Please advise

//Johan

You’re using bz2 compression. That’s why your file ends in bz2 and the restore script doesn’t recognize it.

When I do backups I select the tar.gz compression and I never have a problem. It’s in the destination and format section of the backup dialogue.

Then the guide is wrong… As I followed that one I will try again

//Johan

To be fair, that guide does not tell you to use bz2 compression. In fact, it clearly states in the command line to restore tar.gz which is why you’re getting the error.

Then again, I use the GUI of Virtualmin for things like that because it’s easier and more clear cut.

I did cut and paste from the guide so then it´s something strange going on… I am now it the process with redoing the with the compression parameter set to gzip instead

1 Like

Same problem but refering to

root@ns ~ # virtualmin restore-domain --source /root/migback2/ --all-domains --all-features
Failed to read backup file : /root/migback2//swedmr.se.tar.gz : Not a valid tar or tar.gz file

The tar.gz file…

So I am really confused

//Johan

And there is no problem what so ever to unpack the file manually regardless of bz2 or tar.gz format

//Johan

ive been doing battle with migration for a while now, but havent seen that one in my struggles. what do your backup commands look like? what os?

Backup is according to the linked migration guide (Official virutalmin) and it´s from Ubuntu to Debian

//Johan

well then source for your restore command doesnt match dest for your backup command.

I use other source so that is not the issue… My backups is in /root/migback2

without a copy and paste from your terminal i guess ill just have to take your word for it… :-/

Using --compression zip when making the backup it finally worked…

For my own curiosity I would just like to see one of you stop with all the terminal commands and just use the GUI for a couple mouse clicks to see if it works.

Now it works to some degree but lots of errors when restoring and all domains are not restored

root@ns ~/migback2 # virtualmin restore-domain --source /root/migback2 --all-domains --all-features
Checking for missing features …
… WARNING - The following features were enabled for one or more
domains in the backup, but do not exist on this system. Some
functions of the restored domains may not work : DAV Login, Plugin virtualmin-mailman, Plugin virtualmin-google-analytics

Checking for errors in backup …
… no errors found

Starting restore…
Extracting backup archive files …
… done

Re-creating virtual server netwinder.nu …
Creating administration group netwinder …
… done

Creating administration user netwinder ..
.. done

Creating aliases for administration user ..
.. done

Adding administration user to groups ..
.. done

Creating home directory ..
.. done

Creating mailbox for administration user ..
.. done

Adding new DNS zone ..
.. done

Adding to email domains list ..
.. done

Adding default mail aliases ..
.. done

Adding new virtual website ..
.. done

Adding webserver user www-data to server's group ..
.. done

Performing other Apache configuration ..
.. done

Setting up log file rotation ..
.. done

Creating MariaDB login ..
.. done

Creating MariaDB database netwinder ..
.. done

Setting up spam filtering ..
.. done

Setting up virus filtering ..
.. done

Setting up AWstats reporting ..
.. done

Setting up password protection for AWstats ..
.. done

Creating Webmin user ..
.. done

Saving server details ..
.. done

Re-starting DNS server ..
.. done

Applying web server configuration ..
.. done

Re-loading Webmin ..
.. done

Restoring backup for virtual server netwinder.nu …
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode FCGId OK for this system

Updating home directory in PHP configuration ..
.. done

Restoring Apache log files ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Re-loading MariaDB database netwinder ..
.. done

Re-loading MariaDB database netwinder_roundcube ..
    Creating MariaDB database netwinder_roundcube ..
    .. done

.. done

Re-loading MariaDB database roundcubemail ..
    Creating MariaDB database roundcubemail ..
    .. done

.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Restoring AWstats configuration file ..
.. done

Re-creating mail and FTP users ..
.. done

Re-creating mail aliases ..
.. done

Moving additional mail folders ..
.. done

Restoring mail and FTP user Cron jobs ..
.. done

Updating Webmin user ..
.. done

Restoring backup for virtual server sa3bpe.se …
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode Apache mod_php cannot be used, switching to FPM.

Restoring Apache log files ..
.. done

Restoring SSL Apache virtual host configuration and certificate ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Restoring AWstats configuration file ..
.. done

Re-creating mail and FTP users ..
.. done

Re-creating mail aliases ..
.. done

Moving additional mail folders ..
.. done

Restoring mail and FTP user Cron jobs ..
.. done

Updating Webmin user ..
.. done

Re-creating virtual server newsuperantenna.com
Creating administration group newsuperantenna …
… done

Creating administration user newsuperantenna ..
.. done

Creating aliases for administration user ..
.. done

Adding administration user to groups ..
.. done

Creating home directory ..
.. done

Creating mailbox for administration user ..
.. done

Adding new DNS zone ..
.. done

Adding to email domains list ..
.. done

Adding default mail aliases ..
.. done

Adding new virtual website ..
.. done

Adding webserver user www-data to server's group ..
.. done

Performing other Apache configuration ..
.. done

Setting up log file rotation ..
.. done

Creating MariaDB login ..
.. done

Creating MariaDB database newsuperantenna ..
.. done

Setting up spam filtering ..
.. done

Setting up virus filtering ..
.. done

Setting up AWstats reporting ..
.. done

Setting up password protection for AWstats ..
.. done

Creating Webmin user ..
.. done

Saving server details ..
.. done

Re-starting DNS server ..
.. done

Applying web server configuration ..
.. done

Re-loading Webmin ..
.. done

Restarting PHP-FPM server ..
.. done

Applying web server configuration ..
.. done

Restarting mail server ..
.. done

Restoring backup for virtual server newsuperantenna.com
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode FCGId OK for this system

Updating home directory in PHP configuration ..
.. done

Restoring Apache log files ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Re-loading MariaDB database newsuperantenna ..
.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Restoring AWstats configuration file ..
.. done

Re-creating mail and FTP users ..
.. done

Re-creating mail aliases ..
.. done

Moving additional mail folders ..
.. done

Restoring mail and FTP user Cron jobs ..
.. done

Updating Webmin user ..
.. done

Restoring backup for virtual server hamring.com
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode FCGId OK for this system

Updating home directory in PHP configuration ..
.. done

Restoring Apache log files ..
.. done

Restoring SSL Apache virtual host configuration and certificate ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Re-loading MariaDB database hamring ..
.. done

Restoring ProFTPD virtual server configuration ..
.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Restoring AWstats configuration file ..
.. done

Re-creating mail and FTP users ..
.. done

Re-creating mail aliases ..
.. done

Moving additional mail folders ..
.. done

Restoring mail and FTP user Cron jobs ..
.. done

Updating Webmin user ..
.. done

Restoring backup for virtual server sk3ga.se …
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode Apache mod_php cannot be used, switching to FPM.

Restoring Apache log files ..
.. done

Restoring SSL Apache virtual host configuration and certificate ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Re-loading MariaDB database sk3ga_wordpress ..
.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Restoring AWstats configuration file ..
.. done

Re-creating mail and FTP users ..
.. done

Re-creating mail aliases ..
.. done

Moving additional mail folders ..
.. done

Restoring mail and FTP user Cron jobs ..
.. done

Updating Webmin user ..

Use of uninitialized value $salt in pattern match (m//) at /usr/share/webmin/acl/acl-lib.pl line 1664.
Use of uninitialized value $salt in pattern match (m//) at /usr/share/webmin/acl/acl-lib.pl line 1664.
Use of uninitialized value $salt in numeric eq (==) at /usr/share/webmin/acl/acl-lib.pl line 1664.
… done

Restoring backup for virtual server hflink.com
Restoring virtual server password, quota and other details …
… done

Updating administration password and quotas ..
.. done

Restoring Cron jobs ..
.. done

Re-creating records in DNS domain ..
.. done

Restoring Apache virtual host configuration ..
.. done

Checking restored PHP execution mode ..
.. mode CGI wrapper OK for this system

Updating home directory in PHP configuration ..
.. done

Restoring Apache log files ..
.. done

Restoring Logrotate configuration ..
.. done

Restoring allowed MariaDB hosts ..
.. done

Restoring SpamAssassin and Procmail configurations ..
.. done

Restoring Webmin ACL files ..
.. done

Re-creating mail and FTP users ..

Error: SQL set password for ‘hflin964_mychat1’@‘127.0.0.1’ = failed : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘’ at line 1
Error

SQL set password for ‘hflin964_mychat1’@‘127.0.0.1’ = failed : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘’ at line 1

root@ns ~/migback2 #

I really need some virtualmin staff to stepin here…

I’m having the same problem. I generated a backup using the Virtualmin gui and used rsync to copy the files to the new server. I then attempted to reload them via the gui on the new server.
Here are the files in /root/back

oot@ezsched:~/back# ls -l
total 1320336
-rw------- 1 root root 1068971807 Aug 30 10:43 ezsched.us.tar.gz
-rw-r--r-- 1 root root       7110 Aug 30 10:44 ezsched.us.tar.gz.dom
-rw-r--r-- 1 root root        277 Aug 30 10:44 ezsched.us.tar.gz.info
-rw------- 1 root root  283020710 Aug 30 10:44 nextcloud.ezsched.us.tar.gz
-rw-r--r-- 1 root root       6503 Aug 30 10:44 nextcloud.ezsched.us.tar.gz.dom
-rw-r--r-- 1 root root        228 Aug 30 10:44 nextcloud.ezsched.us.tar.gz.info
root@ezsched:~/back# 


That’s the restore attempt that replied with:
Restore failed : Missing or non-existant source file
Return to previous page
So I tried to use the restore-domain.pl script.

root@ezsched:~/back# /usr/share/webmin/virtual-server/restore-domain.pl --source  ./ezsched.us.tar.gz --all-features --reuid --all-domains
Restore file ./ezsched.us.tar.gz does not exist

I detared the file into tmp and it looks fine. No errors and the content looks reasonable. And before you ask I did try it without the ./ prefix. I also pointed the gui restore to the directory but it didn’t find any restoreable files.
Thanks,
Jim.

Howdy,

This most recent post may be unrelated to the original issue.

When passing in the --source parameter on the command line, pass in the full path. That is, rather than ./backup.tar.gz, use /full/path/to/backup.gz.

Without the full path there, it won’t be able to find it unfortunately.
-Eric

Are all the errors you’re receiving related to set_password MariaDB errors? Or are you seeing different errors?

Also, do you see the same errors if you try the restore of those problem domains using the GUI rather than the command line? In theory it should be the same, but it’d be good to rule out any strangeness along those lines.
-Eric

Thanks I’ll try that.

Again, why would you do that?

Granted, I’ve only done 4 migrations but each time I did it the same way and each time it worked flawlessly.

Virtualmin / Backup and Restore / Backup Virtual Servers. I leave all the settings default for the full backup. The only thing I do is select tar.gzip compression and create the backup and save it to my desktop.

On the new server I got to Virtualmin / Backup and Restore / Restore Backup / Select the Upload to Server option at the top, click on my backup file on my desktop and go.

It has never failed.