Netmagis

logo

Netmagis: Upgrade instructions

Starting from 2.2.2, you can upgrade your database from any version later than 2.1.x with only one call to the netmagis-dbupgrade program.

For previous versions, or to upgrade from a version older than 2.1.0, you must follow upgrade procedure for all intermediate versions.

Upgrading to Netmagis 2.3 from Netmagis 2.2

Don't forget to read release notes.

This procedure assumes that your existing Netmagis database is already running with a version >= 9.1 of PostgreSQL and that your Apache version is greater or equal to 2.4. If this is not the case, read PostgreSQL upgrade instructions.

First, make a backup of your existing Netmagis database.

On your database server, run the netmagis-dbupgrade program (without argument). You should see an output similar to:

Detected schema version: 22
Latest schema supported: 23

This messages says that you database is detected as 2.2.x (or lower) installation, and the netmagis-dbupgrade is able to upgrade it to 2.3.x. Run now:

# netmagis-dbupgrade 23
to upgrade your database to 2.3.x.

Since this release includes some large infrastructure changes related to authentication, you may have to modify some of your configuration files:

  • Change the following configuration parameters in your netmagis.conf files (using for example the default values supplied in the teletype netmagis.conf.sample):
    • Remove the crypt parameter
    • Modify the ouiurl parameter
    • Add the cafile parameter
    • Add the random parameter
  • Since the minimum Apache version is now 2.4, you have to adapt your http.conf. Use the example file supplied in ..../share/examples/netmagis/httpd.conf,

The authentication infrastructure is deeply modified with this release: authentication is no longer performed by the Apache server, but directly by the application. You should now use the "Connection" item in the left side. Familiarize yourself with the new authentication parameters in the "Admin" / "Application parameters" menu.

Upgrading to Netmagis 2.2 from Netmagis 2.1

Don't forget to read release notes.

This procedure assumes that your existing Netmagis database is already running with a version >= 9.1 of PostgreSQL. If this is not the case, read PostgreSQL upgrade instructions.

First, make a backup of your existing Netmagis database.

On your database server, run the netmagis-dbupgrade program (without argument). You should see the following output:

Detected schema version: 21
Latest schema supported: 22

This messages says that you database is detected as 2.1.x installation, and the netmagis-dbupgrade is able to upgrade it to 2.2.x. You can now run:

# netmagis-dbupgrade 22
to upgrade your database to 2.2.x.

Since this release includes some large infrastructure changes, you may have to modify some of your scripts or configuration:

  • If you have written scripts which calls programs in the utils package (dnsaddhost, dnsdelip, etc.), you have to add a new (mandatory) argument view to all calls (if you are just upgrading, a view named "default" has been created for you).

    The parameters for the dnsmodattr have been translated from French to English. If you have written scripts which calls this program, adapt them.

  • If you use the detecteq module and have changed your radius.conf file, please modify the SQL request according to the new column names (see the example file installed with the module).
  • If you use the "Addtl RR" facility in zone edition, please replace "%NOM%" by "%NAME%".

Upgrading to Netmagis 2.1 from Netmagis 2.0

Don't forget to read release notes.

This procedure assumes that your existing Netmagis database is already running with a version >= 9.1 of PostgreSQL. If this is not the case, read PostgreSQL upgrade instructions.

First, make a backup of your existing Netmagis database.

One of the changes in Netmagis 2.1 release is the use of only one unprivileged PostgreSQL user (the one you specified with the parameter dnsdbuser in the netmagis.conf file, let us call it "nm"). This simplifies considerably the installation, but the upgrade needs to take this into account: you need to transfer ownership of the database to this unprivileged user. Assuming this user is called "nm":

On the database server, do the following actions:

  • as your existing administrative user, dump the database:
    $ pg_dump --no-owner netmagis-database-name | egrep -v "^(GRANT|REVOKE)" > /tmp/netmagis.dump
  • as the PostgreSQL administrator user (pgsql on FreeBSD, postgres on Linux), create the unprivileged user:
    pgsql$ createuser --no-superuser --no-createrole --createdb --pwprompt nm
    where nm is the name of the PostgreSQL user to create.
  • as the nm PostgreSQL user, create a new database with the correct ownership:
    pgsql$ createdb --template=template0 -E unicode --owner=nm netmagis-new
  • next, restore the database contents:
    $ psql --username=nm --host=localhost -f /tmp/netmagis.dump netmagis-new
  • as the PostgreSQL administrator user (pgsql on FreeBSD, postgres on Linux), install the new database:
    pgsql$ psql template1 -c 'ALTER DATABASE "netmagis-database-name" RENAME TO "netmagis-old"'
    pgsql$ psql template1 -c 'ALTER DATABASE "netmagis-new" RENAME TO "netmagis-database-name"'

Next, go to the .../share/examples/netmagis/upgrade/20-21/ directory, and then:

  • Inspect the upgrade.sql script
  • As the unprivileged user, run this script:
    $ psql -f upgrade.sql netmagis-database-name
  • Next, specify in netmagis.conf where you want to create the MAC database (see installation instructions)
  • Next, create the MAC schema, with the newly installed netmagis-dbcreate script:
    $ netmagis-dbcreate mac

When you have tested your new installation, you can remove the old database:

  • As the PostgreSQL administrator user (pgsql on FreeBSD, postgres on Linux), delete the old database (are you sure you have a backup copy?)
    pgsql$ dropdb netmagis-old

Upgrading to Netmagis 2.0 from WebDNS 1.5

Don't forget to read release notes.

Upgrading from the previous Netmagis/WebDNS version is simple.

First, make a backup of the old WebDNS database.

Next, install common, database packages, and configure them according to installation instructions (except database creation).

On the database server, go to the .../share/examples/netmagis/upgrade/15-20/ directory, and then:

  • Inspect the upgrade.sql script, and adapt login names of users in the GRANT lines.

  • As the privileged user, run the upgrade.sql script on your existing database (have I already said that you should make a backup first?):

    $ psql -f upgrade.sql webdns-database-name

  • If you have configured the PostgreSQL authentication system, make a dump of your old auth database:

    $ pg_dump auth-database-name > /tmp/auth.dump

    Next, apply the script to merge database authentication in the Netmagis database:

    $ pg_dump --data-only auth-database-name | sed -f pgauth.sed > /tmp/pgauth.load

    You should take a look on the /tmp/pgauth.load to see if everything is ok. Then, load the converted file:

    $ psql -f /tmp/pgauth.load webdns-database-name

    Next, issue the SQL command with psql:

    INSERT INTO global.config (clef, valeur) VALUES ('authmethod', 'pgsql') ;

  • If you have configured the LDAP authentication, issue the SQL command with psql:

    INSERT INTO global.config (clef, valeur) VALUES ('authmethod', 'ldap') ;

Next, install the www package, and follow installation instructions. If you use PostgreSQL authentication, do not forget to update the Apache configuration to use to the new tables in the Netmagis database.

Netmagis license Netmagis Web site