0

I am trying to back up the config and database files from an existing LDAP server to move it to a different freshly installed server (Ubuntu 18.04). I followed the steps given here: https://tylersguides.com/articles/backup-restore-openldap/ to use slapcat to create both config and data ldif files.

When I execute slapadd on the server side, slapadd -n 0 -F /etc/openldap/slapd.d -l /backups/config.ldif works fine, but executing slapadd -n 1 -F /etc/openldap/slapd.d -l /backups/data.ldif gives the following error:

Database number selected via -n is out of range
Must be in the range 0 to 0 (the number of configured databases)

All the sites I have been able to find regarding this migration process follow steps similar to the ones above, but none of them mention anything about preconfiguring the number of databases or anything like that. I'm not sure how to proceed from here.

2 Answers2

0

almost sure that you did a mistake during dump and the content of the second file is the same as the config file

Thiago Conrado
  • 726
  • 8
  • 15
0

Try removing -F /etc/openldap/slapd.d from the second slapadd.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 06 '23 at 14:07