How do I Replace LDAP database with LDIF file

I have an OpenLDAP openldap-server-2.3.43 that I'm trying to replace the existing (very outdated) database with the LDIF file from the more current server.

I would generally use slapadd -l after stopping the services, but I've noticed that it does not remove records it just adds (which makes sense as it is slapADD).

My question: Is there a similar way to REPLACE the current database with the contents of the LDIF file?
gracewildAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
How about creating a new database and then load the ldif?
The database can be found through the slapd.conf

in a statement like this:

directory       /var/lib/openldap-data

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gracewildAuthor Commented:
Noci,

Thank you for your reply.  

I stopped the ldap service, then I renamed the openldap-data and created an empty openldap-data directory with ldap:ldap permissions and did the slapadd -l and started the ldap services.

Everything is as I need it.

Thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.