Move virtualserver cause duplicity in postgresql domain user

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

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

Failed to modify server : A PostgreSQL login named is already owned by virtual server 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, but you ote tha we were trying to activate

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.



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 4096 Sep 11 2012

The relationship between one issue and the other is that in the new server where i have restored the backups has the uid 1107, and in the old server in wich i have done the backup restored 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 and, moved to become a top-level server and then enabled PostgreSQL, and it worked fine.

The commands I used were :

virtualmin create-domain --domain --dir --unix --postgres --pass smeg
virtualmin create-domain --domain --parent --dir
virtualmin move-domain --domain
virtualmin move-domain --domain --newuser domainb --newpass smeg
virtualmin enable-feature --domain --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?