Export DNS Records from Server.app
I'm setting up a new server from scratch and I need to duplicate my DNS records on the new server. How do I export the DNS records from the old server and import them on the new one?
OS X Server, OS X Yosemite
I'm setting up a new server from scratch and I need to duplicate my DNS records on the new server. How do I export the DNS records from the old server and import them on the new one?
OS X Server, OS X Yosemite
It used to be that ServerAdmin provided the means to export and import settings as XML files. However this GUI tool has been discontinued. Server.app does not appear to have the capability itself.
Fortunately there is at least one other option which is to use the command line tool 'serveradmin'. The following would export the DNS settings as an XML file.
sudo serveradmin -x settings dns
However I believe in this case using XML might not be as useful. I would therefore suggest the following on the old server
sudo serveradmin settings dns > savedsettings.txt
and on the new server
sudo serveradmin settings < savedsettings.txt
I also strong suggest doing this first either on a test server or making sure you have a full backup of the server boot drive.
Note: The above only exports the DNS settings, using serveradmin settings all does them all. Do man serveradmin for more details.
Will give this a try. Thank you!
I found with Yosemite and ElCapitan that the -x option was not needed.
Instead of creating an XML output, just create the default key/value pair and then import.
On source:
(sudo) serveradmin settings dns > /tmp/dns.kvp
on destination:
(sudo) serveradmin settings < /tmp/dns.kvp
Export DNS Records from Server.app