Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

...

PowerDNS REST is a replacement for PowerDNS module and its easier to configure / maintain in long run (no ssh keys required). Procedure below describes how to migrate existing zones/products from regular PowerDNS to PowerDNS REST module.

Migration

...

  1. Backup your HostBill database !
  2. Make sure that the PowerDNS REST module is enabled.
  3. Create App Connection for PowerDNS REST.
  4. Check if the test connection returns Success.
  5. Connect to the database.
  6. You should run the query which is below.

Query

Code Block
languagesql
titleMigration from PowerDNS to PowerDNS REST
linenumberstrue
SET @powerdnsrest = (SELECT `id` FROM hb_modules_configuration WHERE `filename` = 'class.powerdns_rest.php'),
@powerdns = (SELECT `id` FROM hb_modules_configuration WHERE `filename` = 'class.powerdns.php'),
@server_group = (SELECT `id` FROM hb_server_groups WHERE module = IF(@powerdnsrest IS NOT NULL, @powerdnsrest, @powerdns)),
@serv = (SELECT `id` FROM hb_servers WHERE group_id = @server_group AND `default` = 1);
UPDATE hb_accounts a LEFT JOIN hb_products_modules pm ON (a.product_id = pm.product_id)
SET a.server_id = @serv WHERE pm.module = @powerdns;
UPDATE hb_server_groups g, hb_servers s, hb_products_modules p
SET g.`module` = IF(@powerdnsrest IS NOT NULL, @powerdnsrest, @powerdns),
s.`default_module` = IF(@powerdnsrest IS NOT NULL, @powerdnsrest, @powerdns),
p.`module` = IF(@powerdnsrest IS NOT NULL, @powerdnsrest, @powerdns),
p.`server` = @serv
WHERE g.`module` = @powerdns AND s.`default_module` = @powerdns AND p.`module` = @powerdns;

If you do not have any program to connect to the database, you can execute this query using the command line.

  1. Log in to the server where you have the HostBill installation.
  2. Then use the commands:
Code Block
mysql;


Code Block
use {$database_name};


Info

Where {$database_name} is the name of the database you want to connect to. You can find the name of your database in the file public_html/includes/config.php

Then execute the SQL query that is above.

Related modules

...