<div dir="ltr"><div><div><div><div>Hi Jordan,<br><br></div>In the past, I've used a Windows-based tool called TOAD (<a href="http://software.dell.com/products/toad-for-mysql/">http://software.dell.com/products/toad-for-mysql/</a>). It allows you to do a direct comparison between two different databases: just log into your MySQL server from TOAD and you should be on your way.<br><br></div>If you're worried about duplicate database records or other db strangeness, you can use the zone2sql tool to convert between SQL and zone files:<br><br><a href="https://wiki.powerdns.com/trac/wiki/Zone2SQLFAQ">https://wiki.powerdns.com/trac/wiki/Zone2SQLFAQ</a><br><br></div>Best of luck!<br><br></div>John<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 7, 2015 at 8:07 PM, Jordan Rieger <span dir="ltr"><<a href="mailto:jordan@webnames.ca" target="_blank">jordan@webnames.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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".<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Do you know of a tool or API command that would make this easier? (Other than a generic database data comparison tool.)<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Jordan Rieger<u></u><u></u></p><p class="MsoNormal">Senior Software Developer<u></u><u></u></p><p class="MsoNormal">Webnames.ca Inc.<u></u><u></u></p></div></div>
<br>_______________________________________________<br>
Pdns-users mailing list<br>
<a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>
<a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">John Miller<br>Systems Engineer<br>Brandeis University<br><a href="mailto:johnmill@brandeis.edu" target="_blank">johnmill@brandeis.edu</a><br>(781) 736-4619</div>
</div>