Migrate from tinydns to powerdns

Here is how you can use powerdns itself to migrate from tinydns to powerdns:

1. Make copy of the data.cdb file from tinydns

2. Run powerdns with the tinydns backend:

pdns_server \
  --no-config --daemon=no \
  --local-port=5300 \
  --launch=tinydns --socket-dir=/tmp \
  --tinydns-dbfile=data.cdb

3. List all the zones inside the tinydns cdb file and save the list to a file:

pdnsutil \
  --config-dir=~/tinydns/conf \
  list-all-zones > /tmp/zone-list

4. Extract and save all DNS records for each domain:

mkdir /tmp/zones/
for z in cat ../zones;
do
   pdnsutil --config-dir=~/tinydns/conf \
     list-zone $z > /tmp/zones/$z;
done

5. Import the zones back into powerdns setup with any other backend:

cd /tmp/zones/
for zone in `ls -1`; do
   pdnsutil load-zone $zone $zone;
done