Hi team! I face a question. When I use "slapcat -l filename.ldif ", the output file will include the createTimestamp、modifyTimestamp、entrycsn and entryUUID etc. These attributes will cause the output file can not put back to the bdb database. could you pls kindly tell me how can use this slapcat without these attibutes ?
thanks and best wishes
Eileen~
Eileen(=^ω^=) wrote:
I face a question. When I use "slapcat -l filename.ldif ", the output file will include the createTimestamp、modifyTimestamp、entrycsn and entryUUID etc. These attributes will cause the output file can not put back to the bdb database.
could you pls kindly tell me how can use this slapcat without these attibutes ?
LDIF output of slapcat is usually used for DB restore with slapadd. It won't work with normal ldapadd because 'createTimestamp' etc. are operational attributes maintained by the server.
Does that answer your question? If not, then provide more information about what you did or want to do.
Ciao, Michael.
hi Ciao, Michael! thank you for the reply. i use the slapcat is for backup the BDB database. if the computer down, i can use the slapadd commond to put the backup file back to the server. but now i can not find the right way to use the slapcat commond to get the output file, which can use the slapadd commond add the records back directly. you know 'createTimestamp' etc attributes can not add into the server computer directly. so could you pls tell me how to use the slapcat commond to take the right output file. the output file can directly use the slapadd commond into the server.
thank you Eileen
------------------ 原始邮件 ------------------ 发件人: "Michael Ströder";michael@stroeder.com; 发送时间: 2015年1月12日(星期一) 下午5:11 收件人: "Eileen(=^ω^=)"123784635@qq.com; "openldap-technical"openldap-technical@openldap.org;
主题: Re: slapcat command
Eileen(=^ω^=) wrote:
I face a question. When I use "slapcat -l filename.ldif ", the output file will include the createTimestamp、modifyTimestamp、entrycsn and entryUUID etc. These attributes will cause the output file can not put back to the bdb database.
could you pls kindly tell me how can use this slapcat without these attibutes ?
LDIF output of slapcat is usually used for DB restore with slapadd. It won't work with normal ldapadd because 'createTimestamp' etc. are operational attributes maintained by the server.
Does that answer your question? If not, then provide more information about what you did or want to do.
Ciao, Michael.
Eileen(=^ω^=) wrote:
thank you for the reply. i use the slapcat is for backup the BDB database. if the computer down, i can use the slapadd commond to put the backup file back to the server. but now i can not find the right way to use the slapcat commond to get the output file, which can use the slapadd commond add the records back directly. you know 'createTimestamp' etc attributes can not add into the server computer directly. so could you pls tell me how to use the slapcat commond to take the right output file. the output file can directly use the slapadd commond into the server.
slapadd will definitely add 'createTimestamp' etc. when adding entries which do not exist before.
If anything goes wrong on your side you should provide more information about what exact command you're using and what the error message is.
Ciao, Michael.
hi Ciao, Michael! i use the slapcat to get the output file,just like belows.then i delete this person.
dn: cn=tiangexuanadd,ou=users,dc=xxx,dc=xxx cn: tiangexuanadd createtimestamp: 20121127080342Z creatorsname: cn=manager,dc=xxx,dc=xxx entrycsn: 20121127082433.542652Z#000000#000#000000 entrydn: cn=tiangexuanadd,ou=users,dc=xxx,dc=xxx entryuuid: b48c76ae-ccb4-1031-8745-b3f3f9fa7bb0 gidnumber: 93003 hassubordinates: FALSE homedirectory: /home/tiangexuanadd loginshell: /bin/bash modifiersname: cn=manager,dc=tmsr,dc=org modifytimestamp: 20121127082433Z objectclass: posixAccount objectclass: shadowAccount objectclass: inetOrgPerson sn: zouyang structuralobjectclass: inetOrgPerson subschemasubentry: cn=Subschema uid: tiangexuanadd uidnumber: 30962 userpassword: 123
after that, i use slapadd command to add this person. will get the wrong message. so i think the attribute createtimestamp can not be added, it should be created by ldap server or system,not in the file.
[root@tmsr-ldap0 ldap]# ldapadd -x -D "cn=manager,dc=xxx,dc=xxx" -W -f test.ldif Enter LDAP Password: adding new entry "cn=tiangexuanadd,ou=users,dc=tmsr,dc=org" ldap_add: Constraint violation (19) additional info: createtimestamp: no user modification allowed
------------------ 原始邮件 ------------------ 发件人: "Michael Ströder";michael@stroeder.com; 发送时间: 2015年1月12日(星期一) 下午5:38 收件人: "Eileen(=^ω^=)"123784635@qq.com; "openldap-technical"openldap-technical@openldap.org;
主题: Re: 回复: slapcat command
Eileen(=^ω^=) wrote:
thank you for the reply. i use the slapcat is for backup the BDB database. if the computer down, i can use the slapadd commond to put the backup file back to the server. but now i can not find the right way to use the slapcat commond to get the output file, which can use the slapadd commond add the records back directly. you know 'createTimestamp' etc attributes can not add into the server computer directly. so could you pls tell me how to use the slapcat commond to take the right output file. the output file can directly use the slapadd commond into the server.
slapadd will definitely add 'createTimestamp' etc. when adding entries which do not exist before.
If anything goes wrong on your side you should provide more information about what exact command you're using and what the error message is.
Ciao, Michael.
On 01/12/15 20:41 +0800, Eileen(=^ω^=) wrote:
[root@tmsr-ldap0 ldap]# ldapadd -x -D "cn=manager,dc=xxx,dc=xxx" -W -f test.ldif
See the manpage for slapadd(8), which is appropriate for restoring your DB. ldapadd is something else. If you want to store data in portable ldif format appropriate for use with ldapadd, use ldapsearch.
Eileen(=^ω^=) wrote:
after that, i use slapadd command to add this person. will get the wrong message. so i think the attribute createtimestamp can not be added, it should be created by ldap server or system,not in the file.
^^^^^^^
[root@tmsr-ldap0 ldap]# ldapadd -x -D "cn=manager,dc=xxx,dc=xxx" -W -f test.ldif Enter LDAP Password: adding new entry "cn=tiangexuanadd,ou=users,dc=tmsr,dc=org" ldap_add: Constraint violation (19) additional info: createtimestamp: no user modification allowed
slapadd and ldapadd are different command-line tools for different purposes. Please consult the man pages of each of the tools.
Ciao, Michael.
On 2015.01.12 03.17, Eileen(=^ω^=) wrote:
Hi team! I face a question. When I use "slapcat -l filename.ldif ", the output file will include the createTimestamp、modifyTimestamp、entrycsn and entryUUID etc. These attributes will cause the output file can not put back to the bdb database.
output generated with slapcat is complete [subject to filtering done with -H uri], comprehensive data, intended for use with slapadd, so a directory/database can be completely reconstructed.
making some assumptions, i guess you're trying to take data generated with slapcat and feed it into ldapadd/ldapmodify?
preferably, generate your source data with ldapsearch. other less desirable alternatives include possibly constructing an uri to use with slapcat -H, or using some external program to post process the data.
-ben
openldap-technical@openldap.org