Koozali.org: home of the SME Server

Question on migrating user accounts

Offline edb

  • *
  • 548
  • +0/-0
Question on migrating user accounts
« on: December 10, 2008, 07:10:14 AM »
I have installed SME8beta3 in a VMWare VM to conduct testing.
I have a fully functional SME7.4 server and wanted to transfer all my user and group accounts over to the SME8beta3 server to test.
I copied over the following files from my production SME7.4 server:
/etc/group
/etc/gshadow
/etc/passwd
/etc/samba/secrets.tdb
/etc/samba/smbpasswd
/etc/shadow
/etc/smbpasswd
/etc/sudoers
/home/e-smith/db/accounts

My users and groups show up fine in server manager. If I create a new user or group in server manager they are created fine with the standard "Successful" message, but when I delete them I get an error message in server manager even though the accounts are actually deleted when I look at the /home/e-smith/db/accounts file.
I think it may have something to do with the ldap file but I'm not sure and only say that because my ldap file is empty after I apply any changes to the directory via server manager.
If I do a signal-event post-upgrade then reboot the ldap file is rebuilt again but again when I modify the directory details in server manager the ldap file gets wipped out again.

My question is only if I may have missed copying over any necessary files that would normally have been copied over if I would have copied the full /home/e-smith folder. Otherwise, I think I have copied everything that would normally be done with a restore from backup.

Thanks in advance

edb
......

Offline janet

  • *****
  • 4,812
  • +0/-0
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #2 on: December 10, 2008, 02:33:36 PM »
Thanks Mary ... that was the same document that I used but it doesn't answer my question.

edb
......

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Question on migrating user accounts
« Reply #3 on: December 10, 2008, 05:23:34 PM »
Thanks Mary ... that was the same document that I used but it doesn't answer my question.

edb
Yes it does, that is why you have to run the events before and after, they should take care of the integration of all configuration parameters all over the system.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #4 on: December 10, 2008, 10:28:47 PM »
Hi Cactus

I did run the events just as described in the article starting with a pre-restore, copying the files followed by a signal-event post-upgrade reboot.
However, unless there is something in the /home/e-smith that is required (I didn't copy over the /home/e-smith) then I completed the process just as described and things are not working smoothly.
I can't see it mattering if one server was in Server-Gateway mode and the other was in Server only mode but that happens to be the case here.
I would think that the only files that matter would be the ones I had listed.

Thanks for all replies ...

edb

......

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Question on migrating user accounts
« Reply #5 on: December 11, 2008, 12:30:31 AM »
However, unless there is something in the /home/e-smith that is required (I didn't copy over the /home/e-smith)

do you mean you did not copy /home/e-smith/files/ directory?

what error are you getting? what's in your log (/var/log/messages)?

Ciao
Stefano

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #6 on: December 11, 2008, 01:30:10 AM »
No, I did not copy over the /home/e-smith directory although I did copy over the /home/e-smith/db/accounts file.
When I create a user or group I can do so successfully just like normal but if I delete a user or group I get error:
"Operation status report
An error occurred while removing user group
."
If I look at /etc/group the account is properly removed and /home/e-smith/db/accounts also shows the account as removed.
Message log:
Dec  9 00:33:33 defcon5 /etc/e-smith/web/panels/manager/cgi-bin/groups[3732]: /home/e-smith/db/accounts: OLD mytest=(undefined)
Dec  9 00:33:33 defcon5 /etc/e-smith/web/panels/manager/cgi-bin/groups[3732]: /home/e-smith/db/accounts: NEW mytest=group|Description|test group|Members|edb
Dec  9 00:33:33 defcon5 esmith::event[3733]: Processing event: group-create mytest
Dec  9 00:33:33 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/group-create/S04group-create-unix
Dec  9 00:33:34 defcon5 /etc/e-smith/events/group-create/S04group-create-unix[3734]: /home/e-smith/db/accounts: OLD mytest=group|Description|test group|Members|edb
Dec  9 00:33:34 defcon5 /etc/e-smith/events/group-create/S04group-create-unix[3734]: /home/e-smith/db/accounts: NEW mytest=group|Description|test group|Gid|5025|Members|edb
Dec  9 00:33:34 defcon5 /etc/e-smith/events/group-create/S04group-create-unix[3734]: /home/e-smith/db/accounts: OLD mytest=group|Description|test group|Gid|5025|Members|edb
Dec  9 00:33:34 defcon5 /etc/e-smith/events/group-create/S04group-create-unix[3734]: /home/e-smith/db/accounts: NEW mytest=group|Description|test group|Gid|5025|Members|edb|Uid|5025
Dec  9 00:33:34 defcon5 esmith::event[3733]: useradd: warning: the home directory already exists. 
Dec  9 00:33:34 defcon5 esmith::event[3733]: Not copying any file from skel directory into it. 
Dec  9 00:33:35 defcon5 esmith::event[3733]: S04group-create-unix=action|Event|group-create|Action|S04group-create-unix|Start|1228804413 987351|End|1228804415 374809|Elapsed|1.387458
Dec  9 00:33:35 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Dec  9 00:33:35 defcon5 esmith::event[3733]: expanding /var/service/qpsmtpd/config/goodrcptto 
Dec  9 00:33:35 defcon5 esmith::event[3733]: expanding /var/qmail/control/badrcptto 
Dec  9 00:33:36 defcon5 esmith::event[3733]: generic_template_expand=action|Event|group-create|Action|generic_template_expand|Start|1228804415 378055|End|1228804416 97961|Elapsed|0.719906
Dec  9 00:33:36 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/group-create/S20qmail-update-group
Dec  9 00:33:36 defcon5 esmith::event[3733]: S20qmail-update-group=action|Event|group-create|Action|S20qmail-update-group|Start|1228804416 101018|End|1228804416 525232|Elapsed|0.424214
Dec  9 00:33:36 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/group-create/S25ldap-update
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 fd=9 ACCEPT from IP=127.0.0.1:53732 (IP=0.0.0.0:389)
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=0 BIND dn="cn=root,dc=mydomain,dc=local" method=128
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=0 BIND dn="cn=root,dc=mydomain,dc=local" mech=SIMPLE ssf=0
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=0 RESULT tag=97 err=0 text=
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=1 ADD dn="uid=mytest,dc=mydomain,dc=local"
Dec  9 00:33:37 defcon5 slapd[3470]: Entry (uid=mytest,dc=mydomain,dc=local): object class 'posixGroup' requires attribute 'gidNumber'
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=1 RESULT tag=105 err=65 text=object class 'posixGroup' requires attribute 'gidNumber'
Dec  9 00:33:37 defcon5 esmith::event[3733]: failed to add entry for uid=mytest,dc=mydomain,dc=local: object class 'posixGroup' requires attribute 'gidNumber' at /etc/e-smith/events/group-create/S25ldap-update line 159. 
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 op=2 UNBIND
Dec  9 00:33:37 defcon5 slapd[3470]: conn=0 fd=9 closed
Dec  9 00:33:37 defcon5 slapd[3470]: connection_read(9): no connection!
Dec  9 00:33:37 defcon5 esmith::event[3733]: S25ldap-update=action|Event|group-create|Action|S25ldap-update|Start|1228804416 529520|End|1228804417 223329|Elapsed|0.693809
Dec  9 00:33:37 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/group-create/S56update-domain-group-maps
Dec  9 00:33:38 defcon5 esmith::event[3733]: Can't lookup UNIX group edb 
Dec  9 00:33:38 defcon5 esmith::event[3733]: No rid or sid specified, choosing a RID 
Dec  9 00:33:38 defcon5 esmith::event[3733]: Got RID 11051 
Dec  9 00:33:38 defcon5 esmith::event[3733]: Successfully added group test group to the mapping db as a domain group   
Dec  9 00:33:38 defcon5 esmith::event[3733]: S56update-domain-group-maps=action|Event|group-create|Action|S56update-domain-group-maps|Start|1228804417 227282|End|1228804418 611926|Elapsed|1.384644
Dec  9 00:33:38 defcon5 esmith::event[3733]: Running event handler: /etc/e-smith/events/actions/adjust-services
Dec  9 00:33:39 defcon5 esmith::event[3733]: adjusting supervised smbd (sighup) 
Dec  9 00:33:39 defcon5 esmith::event[3733]: adjusting supervised smbd (up) 
Dec  9 00:33:39 defcon5 esmith::event[3733]: adjust-services=action|Event|group-create|Action|adjust-services|Start|1228804418 614261|End|1228804419 121619|Elapsed|0.507358
Dec  9 00:39:26 defcon5 /etc/e-smith/web/panels/manager/cgi-bin/groups[3785]: /home/e-smith/db/accounts: OLD mytest=group|Description|test group|Gid|5025|Members|edb|Uid|5025
Dec  9 00:39:26 defcon5 /etc/e-smith/web/panels/manager/cgi-bin/groups[3785]: /home/e-smith/db/accounts: NEW mytest=group-deleted|Description|test group|Gid|5025|Members|edb|Uid|5025
Dec  9 00:39:26 defcon5 esmith::event[3786]: Processing event: group-delete mytest
Dec  9 00:39:26 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Dec  9 00:39:26 defcon5 esmith::event[3786]: expanding /var/service/qpsmtpd/config/goodrcptto 
Dec  9 00:39:27 defcon5 esmith::event[3786]: expanding /var/qmail/control/badrcptto 
Dec  9 00:39:27 defcon5 esmith::event[3786]: generic_template_expand=action|Event|group-delete|Action|generic_template_expand|Start|1228804766 602219|End|1228804767 288459|Elapsed|0.68624
Dec  9 00:39:27 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/group-delete/S10group-ibay-modify
Dec  9 00:39:27 defcon5 esmith::event[3786]: S10group-ibay-modify=action|Event|group-delete|Action|S10group-ibay-modify|Start|1228804767 291345|End|1228804767 795651|Elapsed|0.504306
Dec  9 00:39:27 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/group-delete/S14update-domain-group-maps
Dec  9 00:39:28 defcon5 esmith::event[3786]: Sucessfully removed S-1-5-21-1545115165-1448596286-905210654-11051 from the mapping db 
Dec  9 00:39:28 defcon5 esmith::event[3786]: Can't lookup UNIX group edb 
Dec  9 00:39:29 defcon5 esmith::event[3786]: S14update-domain-group-maps=action|Event|group-delete|Action|S14update-domain-group-maps|Start|1228804767 799117|End|1228804769 64966|Elapsed|1.265849
Dec  9 00:39:29 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/group-delete/S15group-delete-unix
Dec  9 00:39:29 defcon5 esmith::event[3786]: S15group-delete-unix=action|Event|group-delete|Action|S15group-delete-unix|Start|1228804769 67261|End|1228804769 305093|Elapsed|0.237832
Dec  9 00:39:29 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/group-delete/S20qmail-delete-group
Dec  9 00:39:29 defcon5 esmith::event[3786]: S20qmail-delete-group=action|Event|group-delete|Action|S20qmail-delete-group|Start|1228804769 308770|End|1228804769 366420|Elapsed|0.05765
Dec  9 00:39:29 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/group-delete/S25ldap-delete
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 fd=9 ACCEPT from IP=127.0.0.1:33310 (IP=0.0.0.0:389)
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 op=0 BIND dn="cn=root,dc=mydomain,dc=local" method=128
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 op=0 BIND dn="cn=root,dc=mydomain,dc=local" mech=SIMPLE ssf=0
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 op=0 RESULT tag=97 err=0 text=
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 op=1 SRCH base="dc=mydomain,dc=local" scope=2 deref=2 filter="(uid=mytest)"
Dec  9 00:39:29 defcon5 slapd[3470]: conn=1 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=
Dec  9 00:39:30 defcon5 esmith::event[3786]: Failed ldap search: No such object at /etc/e-smith/events/group-delete/S25ldap-delete line 63. 
Dec  9 00:39:30 defcon5 slapd[3470]: conn=1 fd=9 closed (connection lost)
Dec  9 00:39:30 defcon5 esmith::event[3786]: S25ldap-delete=action|Event|group-delete|Action|S25ldap-delete|Start|1228804769 370312|End|1228804770 23994|Elapsed|0.653682|Status|65280
Dec  9 00:39:30 defcon5 esmith::event[3786]: Running event handler: /etc/e-smith/events/actions/adjust-services
Dec  9 00:39:30 defcon5 esmith::event[3786]: adjusting supervised smbd (sighup) 
Dec  9 00:39:30 defcon5 esmith::event[3786]: adjusting supervised smbd (up) 
Dec  9 00:39:30 defcon5 esmith::event[3786]: adjust-services=action|Event|group-delete|Action|adjust-services|Start|1228804770
......

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Question on migrating user accounts
« Reply #7 on: December 11, 2008, 06:03:06 AM »
edb

Quote
No, I did not copy over the /home/e-smith directory although I did copy over the /home/e-smith/db/accounts file.

I suggest you follow the instructions completely, as they are not written for no reason ie include all of /home/e-smith

the accounts db is not the only db file of importance

There are earlier tips in that wiki article re how to exclude user and ibay data, see
http://wiki.contribs.org/Backup_server_config#Copying_data_to_the_restored_server
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #8 on: December 11, 2008, 06:35:25 AM »
Ok, thanks again Mary.
That is likely the issue then if there are other critical files in the /home/e-smith directory.
I guess I will have to try the restore as per the directions and see what happens.

Thanks everyone for your responses but I was hoping that maybe there was an easy answer and BTW I do realize that the instructions are written for a reason. I just don't see what other files would be necessary other than the ones I transfered already but I'll try the full restore of all the directories listed in the how-to and hope that works.

edb
......

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Question on migrating user accounts
« Reply #9 on: December 11, 2008, 09:28:04 AM »
I just don't see what other files would be necessary other than the ones I transfered already
Concerning user accounts there are at least user profile folders and e-mail.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline slords

  • *****
  • 235
  • +3/-0
Re: Question on migrating user accounts
« Reply #10 on: December 11, 2008, 11:20:11 PM »
There are all kinds of files needed from /home/e-smith.  You have the backup of ldap, the actual users home directory, profiles (if enabled).  If you short circuit the directions and it doesn't work it is most likely that you didn't follow the directions.  Don't make assumptions and then assume you did everything right.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -- Rich Cook

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #11 on: December 12, 2008, 12:24:07 AM »
Thank you slords ...

I agree that it looks like the issue likely resides in the fact that it is dependent on the user directories actually existing and the ldap file.

Very much appreciate all the replies to my question.

I will post back if copying the entire /home/e-smith directory actually does the trick or not and the good thing is that this is just a virtual test server.
I just wanted to understand which files were obsolutely necessary but I guess they all are and that's the answer.

edb
......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Question on migrating user accounts
« Reply #12 on: December 12, 2008, 08:44:08 AM »
I will post back if copying the entire /home/e-smith directory actually does the trick or not and the good thing is that this is just a virtual test server.

I would recommend that you use the standard backup/restore processes, and report any problems via the bug tracker. You are just wasting your time and ours by doing non-standard things.

Offline edb

  • *
  • 548
  • +0/-0
Re: Question on migrating user accounts
« Reply #13 on: December 12, 2008, 02:53:49 PM »
Seems like everyone just can't help themselves from bashing some who asks a question.
Gee, I thought it was a simple enough question.
Lighten up people!!

This can be a frosty forum at times.
Get into the Christmas spirit already and quit making people feel stupid for asking questions!

edb
......

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Question on migrating user accounts
« Reply #14 on: December 12, 2008, 02:59:15 PM »
Seems like everyone just can't help themselves from bashing some who asks a question.

Gee, I thought it was a simple enough question.
Lighten up people!!
I think you should not blame the people who react to your question, but you should put your question and action in the correct light.
Do not blame us for our reactions, where you should question your lack of knowledge on the bowels of SME Server please.

This can be a frosty forum at times.
That is in the eye of the beholder. The more experienced people, me included, do not understand why you want to take such a short-cut, where a lot of effort has been taken to secure proper backup routines and when the whole process, when you want to do it manually, is documented in the wiki as well for you to follow step by step.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)