Submitted by peloton on Tue, 12/13/2016 - 07:32
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
Submitted by andreychek on Tue, 12/13/2016 - 09:08 Comment #1
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?
Submitted by peloton on Tue, 12/13/2016 - 12:20 Comment #2
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"
Submitted by andreychek on Tue, 12/13/2016 - 13:10 Comment #3
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?
Submitted by JamieCameron on Tue, 12/13/2016 - 16:32 Comment #4
Was the backup taken before the home directory was changed, or afterwards?
Submitted by peloton on Tue, 12/13/2016 - 18:29 Comment #5
The backup was done this week, the location of the home directory was changed almost an year ago.
Submitted by JamieCameron on Tue, 12/13/2016 - 23:40 Comment #6
When you did the restore, was the domain deleted, and thus re-created as part of the restore process?
Submitted by andreychek on Tue, 12/13/2016 - 23:45 Comment #7
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.
Submitted by JamieCameron on Tue, 12/13/2016 - 23:51 Comment #8
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.
Submitted by peloton on Wed, 12/14/2016 - 08:45 Comment #9
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.
Submitted by JamieCameron on Wed, 12/14/2016 - 19:15 Comment #10
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?
Submitted by andreychek on Wed, 12/14/2016 - 21:34 Comment #11
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.
Submitted by JamieCameron on Wed, 12/14/2016 - 23:56 Comment #12
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.
Submitted by peloton on Thu, 12/15/2016 - 10:12 Comment #13
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.
Submitted by JamieCameron on Fri, 12/16/2016 - 00:37 Comment #14
Out of interest, why did you make this move?
Submitted by peloton on Tue, 12/20/2016 - 18:52 Comment #15
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.
Submitted by JamieCameron on Tue, 12/20/2016 - 23:05 Comment #16
Fair enough - I will look into handling this situation better when restoring.
Submitted by JamieCameron on Wed, 12/21/2016 - 16:18 Comment #17
The next Virtualmin release will fix this.
Submitted by JamieCameron on Wed, 12/21/2016 - 16:18 Comment #18