Cannot manually extract home dir from Virtualmin backups without error

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.20.2 Pro
Theme version 21.20.7
Apache version 2.4.52
Package updates 119 package updates are available

The background

I like to do a backup and then extract the files from the Virtual server backup. I have been doing this using cpanel for years.

It is an easy work flow to follow.

The issue

  • I can unzip the main backup package with no errors in this case jew.com.tar.gz using WinRAR
  • this exposes the config files and the homedir file jew.com_dir.tar.gz
  • When I now extract the contents from homedir file using WinRAR I get the following errors indicating corruption with the archive

If I extract the homedir file jew.com_dir.tar.gz with 7z I get the following errors and the files and folders are all in folders with different numbers rather than all under public_html (this is obviously caused by 7zip not liking the Gzip format and thus extracting as a straight TAR)

Additional

If I make a manual backup of the public_html folder via file manager I do not have this issue.

Hello,

It seems that the issues you described aren’t related to Virtualmin backup file. Most probably it happens because limited symlink support in Windows—if I remember correctly, it’s disabled by default, and non-administrator users cannot create symlinks unless developer mode is enabled.

Also, I think you could try using the native tar command in PowerShell instead.

The files in the first image are not symlinks. They are real files.

The archive is missing lots of files, see the comparison of the folder home/jewcom/public_html/wp-content/

winrar

File manager

I’m not sure exactly what’s wrong, but I’m pretty confident it’s not a Virtualmin backup issue.

Try using the tar command in PowerShell…

extraction with powershell

I used the the powershell command and the extraction seem to go ok and the folder I mentioned before seems to have the right amount of stuff in it.

Additional

When I open the virtual server archive which is a tar.gz with winrar everything looks fine and it extracts as expected

When I do the same with the home directory file I get the errors on extraction and alwos when I preview the ile I get the following

Question

Is there some compatibility switch that needs adding when the archive is created? A small change in the command that is used?

What is the difference in compression commands between thwe virtual server archive and the homedir archive, there must be a difference.

Todo : stop using windows applications to play with files that are produced via a linux OS it could be said there are issues with, perhaps, windows applications, that are not 100% compatible with a linux based archive, cut your losses ditch windows as your daily driver and use a linux desktop and associated utilities:) - joke

@Ilia can you look (or point me to) the commands that handled the tar.gz compression for

  • The home directory archive
  • The final archive

I currently use the single file backup method, if this makes a difference

Why

  • The final archive expands using WinRar on my PC with no issue but the home directory archive has “file reference” issues.
  • I find it incredibly useful for extraction the home directory from these archives
  • and also it might be a small change in the compression command to remedy this particular issue.

Thanks

@shoulders The domain.tld.tar.gz created inside the main backup file is actually just a tar archive, not gzipped. It seems Windows applications might rely on file extensions rather than the actual file type.

On Linux or macOS, file extensions don’t matter, you could even name it domain.tld.tar.gz.exe and extract it using tar -xf domain.tld.tar.gz.exe, and it would work just fine.

@Jamie, perhaps we should reconsider naming the file domain.tld_dir.tar.gz inside the main archive, as it’s technically inaccurate. file domain.tld.tar.gz clearly shows it’s not a gzipped archive—compressing it twice doesn’t make much sense either (which we don’t).

Renaming it sounds good. I will also see if this fixes the extraction issue.

You could use the Windows Subsystem for Linux (WSL) and work with linux tools like tar then.

Oh that’s clearly a bug if we’re giving it a tar.gz extension when it’s not compressed!

1 Like

I renamed the home directory archive and then opened it with winrar and it looks normal. So the file extension for us windows users is important. @Ilia a good find, thanks.

these images are a simple comparison, most of the archive appears missing if you have the wrong file extension.

.tar.gz

.tar

Agreed! Fixed here: