Migrating DNS entries from old ispconfig to new ispconfig via script

Discussion in 'General' started by ranceh, Apr 27, 2016.

  1. ranceh

    ranceh New Member

    I have a php script that logs in to the database of the old ispconfig system and gets the dns_soa records and then queries the database of the new ispconfig system to know if I need to call a new record creation or an edit existing record api call.

    I'm to the point now where I need to create/update dns zones and the api is telling me that my mbox value is failing regex testing.
    The new ispconfig system is running
    the email address I'm sending is an email address, and has been validated with every regex I know of to try. It is in the format [3 alpha characters]@[5 alpha characters].org. Its really simple email address and should be validating easily.
    The data is coming from the database of the old ispconfig server so needs to be sanitized before it can be inserted into the new one. The data starts with a . replacing the @ and a trailing . I'm truncating the last . and substring replacing the . for a @ to get the data to send to the ispconfig api.

    Can someone tell me what I am doing wrong, or failing that, what I can do about it.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You had simply sent email addresses in the wrong format. The email address of a dns record never contains an @, the @ is replaced by a dot in DNS, see e.g. BIND documentation or take a look at a BIND zone file. So the ispconfig API has to take care that you do not send email addresses in wrong format( with @) and complains if you do so.
  3. ranceh

    ranceh New Member

    Thanks, I'll give it a try. I don't see where api documentation specifies data formats so I was using the ISPConfig web ui as a guide for the kind of data it was expecting.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the data as it is stored in the database to get an example, not the interface.

Share This Page