Move virtualserver cause duplicity in postgresql domain user

When you have a domain domainb.com, sub-server of another domain domaina.com and move domainb to create an independent virtualserver the result is this.

If you had postgresql activated in domaina.com, when you try to activate it in domainb with domainb already moved you get this error:

Failed to modify server : A PostgreSQL login named domaina.com is already owned by virtual server domaina.com. You note tha we are activating domainb postgresql, not domaina.

If you deactivate postgresql in domaina previously to activate it in domainb you can see that when you to webmin, postgresql, users you have a new user called domaina.com, but you ote tha we were trying to activate domainb.com.

I have see it after a migration from one to other server, whe recover backup of domainb.

The great big fail is that i cannot assign the users of domainb to admin the postgresql databases of domainb.

Status: 
Active

Comments

In this case, was PostgreSQL enabled for domainb before it was moved?

Hello Jamie,

This morning i had another problem. I think that it is related to the other. One client of mine has call saying that he could not connect to the mail. I have look at /var/lib/dovecot-virtualmin/control and i have seen that client folder was:

drwx------ 7 dapm.micicerone.com cochinillosegoviano.com 4096 Sep 11 2012 jorge.bernabe.cochinillosegoviano.com

The relationship between one issue and the other is that in the new server where i have restored the backups dapm.micicerone.com has the uid 1107, and in the old server in wich i have done the backup restored jorge.bernabe.cochinillosegoviano.com has the uid 1107

In the new server the uid of the domain in which i want to create the postgresql db (domainb in the example) is the same (1142) that the user id in the old server of the name that virtualmin creates when i allow postgresql databases (domaina in the example).

The proccess i have follow was in the old server make a backup of the server, transmit it to the new server, restore server.

Answering to your question, no, it was not enables, i enabled later, when i need it.

That looks like a different problem .. and also one that should be fixed in Virtualmin 3.99.

Are you running the 3.99 release already?

Regarding the original issue - I wasn't able to re-produce this. I did a test in which I created domaina.com and domainb.com, moved domainb.com to become a top-level server and then enabled PostgreSQL, and it worked fine.

The commands I used were :

virtualmin create-domain --domain domaina.com --dir --unix --postgres --pass smeg
virtualmin create-domain --domain domainb.com --parent domaina.com --dir
virtualmin move-domain --domain domainb.com
virtualmin move-domain --domain domainb.com --newuser domainb --newpass smeg
virtualmin enable-feature --domain domainb.com --postgres

Sorry for my delay Jamie.

Well, i did the proccess in the web interface, not command-line. I think that will not be relevant, I supose that the web interface will call the same commands.

I think the way to reproduce it is:

create domaina with postgres create domainb with domaina as parent move domainb as parent backup both domains restore both domains (with the issue of the user the had the uids changed, i was not lucky) Activate postgres in domainb. (it thinks that the domainb user has the uid of the domaina one, so acts trying to create the postgresql that exists yet).

If the users ids won't be crossed, maybe the error was different.

DId you delete the domains before restoring them, or was the restore done while the domains still existed?