How do I move individual user accounts?

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.28 (stable)
How are you able to access your server: The webadmin
SSH

Describe your issue

Hello,

I have two YNH servers and would like to move some domains (not all) with their apps and user accounts from one server to the other. This server (the 2nd) already contains domains, apps and users. I know how to move the apps from one server to the other (backup, scp, restore, change DNS). But how do I move individual users with their email addresses, data and emails from one server to the other? Do you have any tips for me?

Thanks a lot

Share relevant logs or error messages

No errors

@tinder

Users are in ldap database, so this subject is about ldap content.
For what i recall ldap ‘domain’ is hardcored, so perhaps a copy paste of ldif content might be enough since entries have already the same naming scheme.
I didn’t yet dig in this subject enough, might be time to go deeper, take a look how ldap is stored within system backup and how to extract its content.

For mail … same i would have to dig it

Regards

Thanks for your feedback :slightly_smiling_face: As far as the emails are concerned, I have at least found the storage location: /var/mail/<user>/

If I copy the contents, I should get all the emails.

That’s right, we have LDAP here. Well, can I export the data from LDAP? Wasn’t there an LDAP web GUI? Could it export the user’s account data? :thinking:
I’ll have to take a look at that… :zany_face:

@tinder i had ldap in mind for long time because that would be a great thing to have a central ldap for multiple yunohost installations.
But after second though this is not the easiest way to proceed, there is an export in csv for users, so just stripping the one we don’t want and importing them will create users.

This server (the 2nd) already contains domains, apps and users.

@artlog
Ah yes, thank you very much :slightly_smiling_face: It also seems to work via the CLI using yunohost user export. But in both cases, I’m still missing the password. I’ll have to take that with me too. :thinking:
Normally, I would take the encrypted password from /etc/shadow and reinstall it on the target device. Then everything would continue as usual. But since these are LDAP users, I can’t access it – at least, I’m not familiar with LDAP and don’t know how to do it. Maybe there is a way :wink:

@jarod5001
You often have very experienced and helpful suggestions, but in this case, I don’t quite understand your tip … :thinking::slightly_smiling_face:

@tinder i didn’t ever use import, so …
@jarod5001 do you suggest that importing user erase existing one or even reset fully user base ?

@tinder said to already have the users created. You can’t import already created users. Don’t know what you are trying to do with exporting /importing users.
Your main concern is to move data of users from one server to another. You can make a backup of the system part of the first sever then import it on the new one, this will include passwords.
But, some apps include user’s data elsewhere and would be hard to move them without moving all the data. This step depends on the apps.
What would work for you, make a full backup of the first server, copy it to the second one, restore all then delete what you don’t need (users, apps, domains)

1 Like

I clearly didn’t catch the real situation.
For me there was one server with a set of users and another with a different set of users and both were using different set of apps.
Here it seems 2nd will be a subset of first that itself will be reduced to remaining unmoved domains, this is a split of domains.
@tinder so disregards my proposals.

Ah, OK – I see. It seems I didn’t describe the actual situation well enough :slightly_smiling_face: A few nuances seem to have been lost when I had my text translated into English by AI. And I only outlined my scenario very briefly and too generally. That probably led to some confusion.

I’ll try again :slightly_smiling_face:

I have two different YNH servers. Both have their own separate users, domains and apps.

In principle:

YNH1-Server

Domains: my-domain1.com, my-domain2.com, my-domain3.com, my-domain4.com

Users: mike, cindy, wolf, marc, foo, lisa, ted

Apps: nextcloud, matrix, wordpress, myweb_app

YNH2-Server

Domains: my-domain5.com, my-domain6.com

Users: tom, clara, michel, humba, joe, john, liss

Apps: nextcloud, mastodon, sogo, bookstack, cryptpad

For example, I would now like to migrate the users mike, cindy and wolf, the domain my-domain2.com and the associated app wordpress to the YNH2 server.

This is a fictitious example.

I realise that name conflicts may arise if there are two different users named ‘marc’. I will then have to deal with this manually. If there is already an app with the same name – for example, wordpress – then I hope that ynh will automatically turn it into wordpress__2.

So it is not a complete server migration or a new installation, but only the transfer of individual users, domains and apps from one existing productive server to another existing productive server.

I hope this scenario is now a little clearer.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.