[Pdns-users] Easiest way to compare two PowerDNS MYSQL zones (or whole databases)
jordan at webnames.ca
Fri May 8 00:07:44 UTC 2015
What do you guys think would be the best approach for comparing two PowerDNS MYSQL databases that are supposed to hold the same domains and records? I want to produce a list of discrepancies between the two databases, e.g. domains missing from one but not the other, records missing from one but not the other, etc.
So far I'm thinking that I could dump both databases at the same time, import them into a temporary scratch database, and then write a SQL script to compare the records directly between database X and Y. (I have a lot of SQL experience, but not much in MySQL, and I have never looked at the PowerDNS schema.) I could start by checking if each domain is present in both X and Y. And then, since I assume the primary keys wouldn't match, I would have to compare the count of records in each domain, and if the counts matched, I would have to compare the actual record content, e.g. "does X.domain1.record1 match a record in Y.domain1?" and so forth for each record in X. And since the order of records is not significant, and duplicates are possible, I would have to repeat the same comparison from the opposite direction, Y to X, to catch everything. And of course when I say "match" I mean "all publically-visible DNS content is the same between the two records".
Do you know of a tool or API command that would make this easier? (Other than a generic database data comparison tool.)
Background: we already have a PowerDNS server synced with our existing Bind master, and I am confident that there are no discrepancies. We will soon be migrating all servers to PowerDNS, but this requires rewriting a lot of our backend code to use the PowerDNS API. For the first few months, we want to run both our old Bind API wrapper and our new PowerDNS API wrapper in parallel to evaluate. The new PowerDNS server will then be potentially out of sync if there are any bugs in our new wrapper. That is why I would like a comparison tool to find the discrepancies.
Senior Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pdns-users