[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.1 Creating the Database

To create a database use anubisadm --create (or anubisadm -c) command. Anubisadm will read database entries from the standard input and write them to the database. The standard input is supposed to be formatted as text database (see section Plain text databases).

Thus to create a GDBM database from plain text file ‘userlist’, use the following command

 
anubisadm --create gdbm:/etc/anubis.db < userlist

Similarly, to create an initially empty database, type

 
anubisadm --create gdbm:/etc/anubis.db < /dev/null

Notice, that if you use SQL database format, ‘--create’ command does not imply creating the database structure! So, before running

 
anubisadm --create mysql://localhost/dbname < userlist

make sure you create the underlying database structure (including granting privileges to the anubis user), via the usual procedure. Please refer to corresponding database manual for the detailed instructions on this.

It is sometimes necessary to convert the existing user database from one format (protocol) to another. For example, suppose you have been running GDBM database (text:/etc/anubis.db) for some time, but now it has grown considerably and you decided to switch to PostgreSQL database to improve performance. To do so, first create the database using postgres utilities. Then run

 
anubisadm --list text:/etc/anubis.db | \
 anubisadm --create pgsql://localhost/dbname

That's all there is to it!


This document was generated by Sergey Poznyakoff on December, 20 2008 using texi2html 1.78.