RE: Importing a backup of data
Thanks Emmanuel I've got to that bit, and I'm seeing loads of data now, much much better The only issue now is that it's not in the correct order, and it's failing creating items, when their parent item hasn't been created yet but is further down in the file. We're not passing a -S option, but we are passing a -s, but I don't think that relates to the order of the results, whilst -S does. Any ideas what switch to use to ensure the results follow the correct parent first pattern so I can import it? Thanks again Emmanuel From: Emmanuel Lécharny [elecha...@gmail.com] Sent: 11 February 2020 13:11 To: dev@directory.apache.org Subject: Re: Importing a backup of data On 11/02/2020 11:24, Davies, Matt wrote: > Hi there > > A colleague of mine recently exported what we believed to be all the data > from a running apacheds v24 server like so > > ldapsearch -h hostname -x -p 10389 -b "dc=org" -s sub "(ObjectClass=)" + > > backup_060220.ldif > > I've then ran through a number of ldif scripts, adding them to a new > installation to build up the same structure on a different machine, but when > I try to add the backup file it's failing right at the start > > ldapadd -h localhost -p 10389 -x -w [PASSWORD] -D "uid=admin,ou=system" -f > /tmp/backup_060220.ldif > > adding new entry "dc=DansOrg2,dc=org" > ldap_add: Object class violation (65) > additional info: OBJECT_CLASS_VIOLATION: failed for MessageType : > ADD_REQUEST > Message ID : 2 > Add Request : > Entry > dn[n]: dc=DansOrg2,dc=org > > subschemaSubentry: cn=schema > createTimestamp: 20191018141712.279Z > entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e > entryDN: dc=DansOrg2,dc=org > nbSubordinates: 2 > entryCSN: 20191018141712.279000Z#00#001#00 > entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2 > nbChildren: 2 > creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system > : ERR_60 Entry dc=DansOrg2,dc=org does not contain a STRUCTURAL ObjectClass > > > Looking at the backup ldif file, there are numerous entries at the beginning > that don't have any objectclass defined, here's the first one > > # DansOrg2.org > dn: dc=DansOrg2,dc=org > entryCSN: 20191018141712.279000Z#00#001#00 > nbSubordinates: 2 > nbChildren: 2 > createTimestamp: 20191018141712.279Z > creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system > subschemaSubentry: cn=schema > entryDN: dc=DansOrg2,dc=org > entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e > entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2 > > We're very new to apacheds, so I don’t know if we're creating the backup > incorrectly, or importing it incorrectly, or a bit of both. > > I don't really understand how it could import without an object class. You specified that you wanted only the operational attributes in your search request ( the '+' at the end of ...-s sub "(ObjectClass=)" +) Replace it with '*', that should do the trick. Or use '*' and '+'. Note : you should normally not specify either of them. The operational attributes are internal attributes that are not necessarily needed (except in some corner cases) and teh default is for a search to return all the other attributes (ie you don't have to add the '*') Hope it helps. Emmanuel - To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org - To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org
Importing a backup of data
Hi there A colleague of mine recently exported what we believed to be all the data from a running apacheds v24 server like so ldapsearch -h hostname -x -p 10389 -b "dc=org" -s sub "(ObjectClass=)" + > backup_060220.ldif I've then ran through a number of ldif scripts, adding them to a new installation to build up the same structure on a different machine, but when I try to add the backup file it's failing right at the start ldapadd -h localhost -p 10389 -x -w [PASSWORD] -D "uid=admin,ou=system" -f /tmp/backup_060220.ldif adding new entry "dc=DansOrg2,dc=org" ldap_add: Object class violation (65) additional info: OBJECT_CLASS_VIOLATION: failed for MessageType : ADD_REQUEST Message ID : 2 Add Request : Entry dn[n]: dc=DansOrg2,dc=org subschemaSubentry: cn=schema createTimestamp: 20191018141712.279Z entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e entryDN: dc=DansOrg2,dc=org nbSubordinates: 2 entryCSN: 20191018141712.279000Z#00#001#00 entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2 nbChildren: 2 creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system : ERR_60 Entry dc=DansOrg2,dc=org does not contain a STRUCTURAL ObjectClass Looking at the backup ldif file, there are numerous entries at the beginning that don't have any objectclass defined, here's the first one # DansOrg2.org dn: dc=DansOrg2,dc=org entryCSN: 20191018141712.279000Z#00#001#00 nbSubordinates: 2 nbChildren: 2 createTimestamp: 20191018141712.279Z creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system subschemaSubentry: cn=schema entryDN: dc=DansOrg2,dc=org entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2 We're very new to apacheds, so I don’t know if we're creating the backup incorrectly, or importing it incorrectly, or a bit of both. I don't really understand how it could import without an object class. Any help or advice would be very welcome. Thanks Matt
Re: Backup and restore
Thanks Emmanuel This is a one off process, so as long as there's no harm in taking the entire default folder, the instance, I'll do that. Can you think of anything that could go wrong with taking the entire folder? Matt On 07/02/2020, 14:32, "Emmanuel Lécharny" wrote: Hi, On 07/02/2020 14:14, Davies, Matt wrote: > Hi there > > We've got apacheds M24 running on one machine, with some configuration and data inside it. > > I now need to back up all the server, config, data, the lot, and move it to another machine. > > Is it possible to stop the server on the machine to be backed up, then transfer the entire default directory over to another server running the software, then start that server up? > > If it is possible, is it only this folder I need to move across? > > /var/lib/apacheds-2.0.0_M24/default/ You should be able to move the whole 'partitions' directory (that will contain the data) but also the 'conf' directory which contains the configuration. All that assuming you aren't changing the layout from one machine to the other. > > Thanks > > Matt > > > > - > To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org > For additional commands, e-mail: dev-h...@directory.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org - To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org
Backup and restore
Hi there We've got apacheds M24 running on one machine, with some configuration and data inside it. I now need to back up all the server, config, data, the lot, and move it to another machine. Is it possible to stop the server on the machine to be backed up, then transfer the entire default directory over to another server running the software, then start that server up? If it is possible, is it only this folder I need to move across? /var/lib/apacheds-2.0.0_M24/default/ Thanks Matt