Virtualmin moving home folders when restoring

Hello, When importing a virtualmin backup from a server to another (both have centos 6, nginx, latest updates) it changes the structure of the home folder:

original server:

virtual servers: mydoman.com sub1.mydomain.com sub2.mydomain.com

home folders: /home/mydoman.com /home/sub1.mydomain.com /home/sub2.mydomain.com

new server with imported backup:

virtual servers: mydoman.com sub1.mydomain.com sub2.mydomain.com

home folders: /home/username/mydoman.com /home/username/domains/sub1.mydomain.com /home/username/domains/sub2.mydomain.com

Status: 
Closed (fixed)

Comments

Howdy -- Jamie may have a little more input, but I had some questions to help us understand what might have happened there.

The two domains that had moved -- are those actually Sub-Servers, meaning that they are child Virtual Servers of "mydomain.com"?

Or are they sub-domains, but have accounts of their own?

If the former -- do you recall how you were able to place the directories for the subs in /home/sub1.mydomain.com?

Thanks for your reply!

They are sub servers, child of mydomain.com.

From what I recall I went to virtualmin> server configuration > Change Domain Name > Change home directory > new directory "/home/sub1.mydomain.com"

Jamie, if a sub-server is moved outside of the parent's directory tree using Server Configuration -> Change Domain Name -> Change Home Directory, could you see a case where restoring that particular backup might move the directory back into the standard /home/USER/domains/sub-domain.tld?

Is that intentional behavior, or is that a bug of some sort?

Was the backup taken before the home directory was changed, or afterwards?

The backup was done this week, the location of the home directory was changed almost an year ago.

When you did the restore, was the domain deleted, and thus re-created as part of the restore process?

Jamie, it sounds like he was migrating to a new server -- so it would have been a fresh restore, and the domain would have been re-created.

Ok, in this case Virtualmin will reset the home directory to match the new system.

This is intentional, because we can't assume that whatever custom home dir was used originally is valid - for example, the old system may have used /www as the home base, and the new might use /home.

Yes, it is restored to a new server.

I understand, however it should at least have a --force option, to restore everything exactly how it was.

Is there any workaround to this?

Imagine you had a system with 100 virtual servers and had to migrate to a new host, it would take forever to manually adjust for every account.

Maybe we could allow this, if the restored home directory looks viable for the new system.

What were the actual home directories in your case?

Jamie, he has mydomain.com as a top-level Virtual Server, and sub1.mydomain.com and sub2.mydomain.com as Sub-Servers.

He moved the two Sub-Servers to /home/sub1.mydomain.com and /home/sub2.mydomain.com.

I see - I'm actually quite surprised that this worked at all, as normally domain owners can't access anything outside of their home directory.

I also had to move the top level domain, from the default /home/username/mydomain.com to /home/mydomain.com.

Even on the new system the home folder can be moved anywhere from the Virtualmin interface, however I've been always logged in as root.

Out of interest, why did you make this move?

Because with multiple domains and multiple servers it makes it much easier (at least for me) to manage with all the files in /home/domainname.tld than it would be to remember which domain is under which username, and more so, which domain is a sever (residing in /home/username/domainname.tld) and which is listed as subserver (residing in /home/username/domains/domainname.tld). Also, since the path is shorter it is faster to type.

Fair enough - I will look into handling this situation better when restoring.

The next Virtualmin release will fix this.

Assigned: Unassigned »
Status: Active » Fixed