API: Move DNS zone from one server to another

Discussion in 'ISPConfig 3 Priority Support' started by KoS, Aug 16, 2017.

  1. KoS

    KoS Member HowtoForge Supporter

    I have a new DNS server in a multiserver setup and would like to move the existing DNS zones to the new server via the API.
    Is it possible in general to "move" the zone to another server? at least in the UI I couldn't find an option.
    I tried with the dns_zone_get and dns_zone_update functions. Is it possible to move the zone that way?
    • use the "id" from get as "primary_id" for update
    • provide the right server_id in the params for update
    • i didn't provide a client_id for the update. is it needed? may that be the issue? which of the values in dns_zone_get is the client_id?
    Thanks for a hint in the right direction.
     
  2. KoS

    KoS Member HowtoForge Supporter

    As i want to move all multi-servers to a new server, my plan was to first "move" the dns/web/mail server and afterwards move the main/admin/ispconfig-server. what is the right way to move all the services etc?
    I thought i had read a while ago that e.g. i should setup the new web server machine, add it to ispconfig, rsync all the /var/www data, and then re-assign the websites in ispconfig? and similar for emails.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    A dns zone has no data, so you can use the api for that in this case. delete the zone on the old system and create it on the new one with the api.
     
  4. KoS

    KoS Member HowtoForge Supporter

    @till thank you. i am aware of the fact that the zone has no data and that is the reason why i have choosen the DNS to be first moved.
    but for obvious reason i want to MOVE the zones (one by one) via the API to the new server, and not RE-CREATE them with all the records in there. so is the dns_zone_update function not supposed to re-assign the whole zone (with all its records) to another server?

    but i see that i should probably get the migration tool as the API is not supposed to provide any support on moving the configuration of a dns zone/website/mail etc from one to another multi-server, even without the data on the file system. could that please be noted somewhere, as i suppose i am not the only one that was mislead? :-(
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The remote API is a way to add or update records in ISPConfig with a script, we nowhere state that the remote API is for moving data.

    It might be possible that you can use the dns update function to change the server_id of the record but youl probably have to update the sub records as well, have not tested that yet, but in case you want to move all dns zons in that ay, I would simply run an SQL query that changes the server_id in the dns_rr and dns_soa table and then do a resync.
     

Share This Page