{"id":33,"date":"2017-10-09T05:00:00","date_gmt":"2017-10-09T05:00:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/how-to-recover-ldap-data-base"},"modified":"2017-10-09T12:15:58","modified_gmt":"2017-10-09T12:15:58","slug":"recover-ldap-data-base","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/ldap\/recover-ldap-data-base","title":{"rendered":"How to Reindex Corrupted OpenLDAP Database"},"content":{"rendered":"<p>If your LDAP DB got corrupted or showing unclear shutdown, then you can recover it manually by re indexing the database.<\/p>\n<h2><span style=\"text-decoration: underline;\">Recover Corrupted LDAP Database<\/span><\/h2>\n<p>Stop Ldpa service first<\/p>\n<div><b style=\"background-color: white;\">#service slapd stop<\/b><\/div>\n<p><b style=\"background-color: white;\"> <\/b><br \/>\nTake the database backup<\/p>\n<div><b style=\"background-color: white;\">#tar -cvzf ldap.tar.gz \/var\/lib\/ldap\/* <\/b><\/div>\n<h3><u style=\"background-color: white;\">LDAP Database Recovery Method<\/u><\/h3>\n<h4><u><b style=\"background-color: white;\">1. DB Recovery Method <\/b><\/u><\/h4>\n<p>Identify the path of ldap data base.<\/p>\n<p>Run the following command. This will recover the LDAP Database.<\/p>\n<div><b style=\"background-color: white;\">#\/usr\/sbin\/slapd_db_recover -v -h \/var\/lib\/ldap<\/b><\/div>\n<p>Now Start the ldap service<\/p>\n<div><b style=\"background-color: white;\">#service slapd start<\/b><\/div>\n<h4><u><b style=\"background-color: white;\">2. Re indexing Method <\/b><\/u><\/h4>\n<p>If the above method was not recovering the ldap db, then try to re index the database.<\/p>\n<div><b style=\"background-color: white;\">#service slapd stop<\/b><\/div>\n<div><b style=\"background-color: white;\">#slapindex<\/b><\/div>\n<div><b style=\"background-color: white;\">#cd \/var\/lib\/ldap<\/b><\/div>\n<div><b style=\"background-color: white;\">#chown -R ldap.ldap *<\/b><\/div>\n<div><b style=\"background-color: white;\">#service slapd start<\/b><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If your LDAP DB got corrupted or showing unclear shutdown, then you can recover it manually by re indexing the database. Recover Corrupted LDAP Database Stop Ldpa service first #service&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/ldap\/recover-ldap-data-base\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":4,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/33\/revisions\/590"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}