Am Freitag, den 09.08.2019, 08:45 +0100 schrieb Rowland penny via samba:> On 09/08/2019 07:38, David Ayers via samba wrote: > > Am Donnerstag, den 08.08.2019, 20:01 +0100 schrieb Rowland penny > > via > > samba: > > >> > But what I could do, is copy the setup incl. the tdb files to a > > test VM to try to reproduce it, upgrade that test VM in the hope to > > produce a dump, that can then be imported back into new clean > > installation of the older version. > > > > Is that feasible? > > I.e. would a clean dump of a later version be backward compatible > > to > > 4.5.16-Debian? > > Yes and YesOkay... just for validation of the process itself I just tried this: - installed the current version of Debian 10 (Buster) into a new vm - installed samba Version 4.9.5-Debian - without any changes to the default smb.conf: ayers at vmbuster:~$ sudo smbpasswd -a ayers New SMB password: Retype new SMB password: Added user ayers. ayers at vmbuster:~$ sudo pdbedit -L -v --------------- Unix username:????????ayers NT username:?????????? Account Flags:????????[U??????????] User SID:?????????????S-1-5-21-2831882250-3016382946-1246711671-1000 Primary Group SID:????S-1-5-21-2831882250-3016382946-1246711671-513 Full Name:????????????David Ayers Home Directory:???????\\vmbuster\ayers HomeDir Drive:???????? Logon Script:????????? Profile Path:?????????\\vmbuster\ayers\profile Domain:???????????????VMBUSTER Account desc:????????? Workstations:????????? Munged dial:?????????? Logon time:???????????0 Logoff time:??????????Mi, 06 Feb 2036 16:06:39 CET Kickoff time:?????????Mi, 06 Feb 2036 16:06:39 CET Password last set:????Fr, 09 Aug 2019 13:40:33 CEST Password can change:??Fr, 09 Aug 2019 13:40:33 CEST Password must change: never Last bad password???: 0 Bad password count??: 0 Logon hours?????????: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ayers at vmbuster:~$ sudo pdbedit -e tdbsam:/home/ayers/samba.tdbsam-export ayers at vmbuster:~$ sudo tdbdump samba.tdbsam-export? { key(19) = "INFO/minor_version\00" data(4) = "\00\00\00\00" } { key(9) = "NEXT_RID\00" data(4) = "\E8\03\00\00" } { key(13) = "INFO/version\00" data(4) = "\04\00\00\00" } I assume that ist not what its supposed to look like? Cheers, David -- David Ayers - Team Austria Free Software Foundation Europe (FSFE) [] (http://www.fsfe.org) Become a supporter of the FSFE! [][][] (https://fsfe.org/join) Your donation powers our work! || (http://fsfe.org/donate) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://lists.samba.org/pipermail/samba/attachments/20190809/ecb1591a/signature.sig>
On 09/08/2019 12:49, David Ayers via samba wrote:> Am Freitag, den 09.08.2019, 08:45 +0100 schrieb Rowland penny via > samba: >> On 09/08/2019 07:38, David Ayers via samba wrote: >>> Am Donnerstag, den 08.08.2019, 20:01 +0100 schrieb Rowland penny >>> via >>> samba: >>> But what I could do, is copy the setup incl. the tdb files to a >>> test VM to try to reproduce it, upgrade that test VM in the hope to >>> produce a dump, that can then be imported back into new clean >>> installation of the older version. >>> >>> Is that feasible? >>> I.e. would a clean dump of a later version be backward compatible >>> to >>> 4.5.16-Debian? >> Yes and Yes > Okay... just for validation of the process itself I just tried this: > > - installed the current version of Debian 10 (Buster) into a new vm > - installed samba Version 4.9.5-Debian > - without any changes to the default smb.conf: > > ayers at vmbuster:~$ sudo smbpasswd -a ayers > New SMB password: > Retype new SMB password: > Added user ayers. > ayers at vmbuster:~$ sudo pdbedit -L -v > --------------- > Unix username:????????ayers > NT username: > Account Flags:????????[U??????????] > User SID:?????????????S-1-5-21-2831882250-3016382946-1246711671-1000 > Primary Group SID:????S-1-5-21-2831882250-3016382946-1246711671-513 > Full Name:????????????David Ayers > Home Directory:???????\\vmbuster\ayers > HomeDir Drive: > Logon Script: > Profile Path:?????????\\vmbuster\ayers\profile > Domain:???????????????VMBUSTER > Account desc: > Workstations: > Munged dial: > Logon time:???????????0 > Logoff time:??????????Mi, 06 Feb 2036 16:06:39 CET > Kickoff time:?????????Mi, 06 Feb 2036 16:06:39 CET > Password last set:????Fr, 09 Aug 2019 13:40:33 CEST > Password can change:??Fr, 09 Aug 2019 13:40:33 CEST > Password must change: never > Last bad password???: 0 > Bad password count??: 0 > Logon hours?????????: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF > ayers at vmbuster:~$ sudo pdbedit -e tdbsam:/home/ayers/samba.tdbsam-export > ayers at vmbuster:~$ sudo tdbdump samba.tdbsam-export > { > key(19) = "INFO/minor_version\00" > data(4) = "\00\00\00\00" > } > { > key(9) = "NEXT_RID\00" > data(4) = "\E8\03\00\00" > } > { > key(13) = "INFO/version\00" > data(4) = "\04\00\00\00" > } > > I assume that ist not what its supposed to look like? > > Cheers, > David >I don't think so, I have just checked on a standalone server in a VM and I get a very similar result. I did run tdbdump against /var/lib/samba/private/passdb.tdb and get more output, but it is unreadable, even though 'man tdbdump' says this: tdbdump is a very simple utility that 'dumps' the contents of a TDB (Trivial DataBase) file to standard output in a human-readable format. There is a big difference between readable and understandable, there doesn't seem to be much point in a 'dump' that you cannot understand, or am I missing something ? Having said that, they are .tdb files, so back them up with tdbbackup cd /var/lib/samba/private tdbbackup passdb.tdb tdbbackup secrets.tdb copy the resulting .bak to the new computer and remove the .bak suffix. Rowland
Am Freitag, den 09.08.2019, 13:41 +0100 schrieb Rowland penny via samba:> ayers at vmbuster:~$ sudo tdbdump samba.tdbsam-export > > { > > key(19) = "INFO/minor_version\00" > > data(4) = "\00\00\00\00" > > } > > { > > key(9) = "NEXT_RID\00" > > data(4) = "\E8\03\00\00" > > } > > { > > key(13) = "INFO/version\00" > > data(4) = "\04\00\00\00" > > } > > > > I assume that ist not what its supposed to look like? > > > > Cheers, > > David > > > > I don't think so, I have just checked on a standalone server in a VM > and? > I get a very similar result. I did run tdbdump against? > /var/lib/samba/private/passdb.tdb and get more output, but it is? > unreadable, even though 'man tdbdump' says this: > > tdbdump is a very simple utility that 'dumps' the contents of a TDB? > (Trivial DataBase) file to standard output in a human-readable > format. > > There is a big difference between readable and understandable, there? > doesn't seem to be much point in a 'dump' that you cannot understand, > or? > am I missing something ?Indeed... so it seems next to the tdbdump issue the issue of pdbedit also remains open: Are pdbedit -e/-i intended to be tools to reliably export and import user data as the man pages suggest: ???????-e|--export passdb-backend ???????????Exports all currently available users to the specified password database backend. ???????????This option will ease migration from one passdb backend to another and will ease backing ???????????up. ... -i|--import passdb-backend Use a different passdb backend to retrieve users than the one specified in smb.conf. Can be used to import data into your local user database. This option will ease migration from one passdb backend to another. ... Do these three issues warrant a bug report?> Having said that, they are .tdb files, so back them up with tdbbackup > > cd /var/lib/samba/private > > tdbbackup passdb.tdb > > tdbbackup secrets.tdb > > copy the resulting .bak to the new computer and remove the .bak > suffix.Done. Thank you. My specific migration issue is now solved. And the my backups scripts have been amended. Thank you very much for your help! David -- David Ayers - Team Austria Free Software Foundation Europe (FSFE) [] (http://www.fsfe.org) Become a supporter of the FSFE! [][][] (https://fsfe.org/join) Your donation powers our work! || (http://fsfe.org/donate) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://lists.samba.org/pipermail/samba/attachments/20190810/49c09970/signature.sig>