Difference between revisions of "PowerDNS OpenDBX Backend/Migration"

From Linuxnetworks
Jump to: navigation, search
(migration)
 
(removed backlink)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
== 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:
 
To convert an existing gMySQL Database to an OpenDBX MySQL database, an additional status column is required since patch 2.9.20-3:
  
  ALTER TABLE domains ADD ( status CHAR(1) NOT NULL DEFAULT 'A' )
+
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:
 
Adding a foreign key constraint from records.domain_id to domains.id is a good idea too:
  
  ALTER TABLE records ADD CONSTRAINT fk_records_domainid
+
  ALTER TABLE "records" ADD CONSTRAINT "pdns_fk_records_domainid"
  FOREIGN KEY (domain_id) REFERENCES domains (id)
+
  FOREIGN KEY ("domain_id") REFERENCES "domains" ("id")
 
  ON UPDATE CASCADE ON DELETE CASCADE
 
  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.
 
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;
Back to [[PowerDNS_OpenDBX_Backend|Overview]]
+

Latest revision as of 14:39, 22 June 2008

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;