PowerDNS OpenDBX Backend/Migration

From Linuxnetworks
Jump to: navigation, search

From gMySQL

To convert an existing gMySQL Database to an OpenDBX MySQL database, an additional status column is required since patch 2.9.20-3:

SET SESSION sql_mode='ANSI';
ALTER TABLE "domains" ADD "status" CHARACTER(1) NOT NULL DEFAULT 'A';

Adding a foreign key constraint from records.domain_id to domains.id is a good idea too:

ALTER TABLE "records" ADD CONSTRAINT "pdns_fk_records_domainid"
FOREIGN KEY ("domain_id") REFERENCES "domains" ("id")
ON UPDATE CASCADE ON DELETE CASCADE

You should also recreate your indices for optimal performance. Please have a look in the appropriate file listed in the section above.

Add auto_serial

The latest version supports automatic generation of serials for SOA records but requires an additional column "auto_serial" in the "domains" table:

ALTER TABLE "domains" ADD "auto_serial" INTEGER DEFAULT 0;