24.42. taler-auditor-dbinit(1)#

24.42.1. Name#

taler-auditor-dbinit - initialize Taler auditor database

24.42.2. Synopsis#

taler-auditor-dbinit [–dry] [-c FILENAME | –config=‌FILENAME] [-g | –gc] [-h | –help] [-L LOGLEVEL | –loglevel=‌LOGLEVEL] [-l FILENAME | –logfile=‌FILENAME] [-R | –reset] [-r | –restart] [-v | –version]

24.42.3. Description#

taler-exchange-dbinit is a command-line tool to initialize the Taler exchange database. It creates the necessary tables and indices for the Taler exchange to operate.

Normal initialization skips stored-procedure files whose recorded contents are current. Schema upgrades also refresh procedures. Databases initialized before content tracking was introduced require one procedure refresh.

Normal initialization always executes versioning.sql under the migration lock. This script upgrades the shared _v metadata schema transactionally and records its revision in _v.versioning. An already-current script leaves schema objects and metadata unchanged. A script with an older target revision preserves a newer installed revision.

Stop the services before upgrading the database. If an upgrade fails, rerun taler-auditor-dbinit to complete it before restarting the services. Services refuse to start while the final upgrade steps are unfinished.

Its options are as follows:

–dry

Inspect pending initialization and upgrade work without modifying the database. Output contains one tab-separated line per action: kind, component, SQL filename or finalization statement, and reason. A current database produces no output. Diagnostics go to standard error.

Inspection includes versioning-schema upgrades, numbered migrations, stored-procedure updates, and unfinished deferred table setup. Table setup is reported as an operation, including its partition argument; migration SQL is not executed to predict individual table changes.

This option has no short form. It cannot be combined with reset or maintenance actions.

Exit status is 0 when current, 2 when work is pending, and 1 on inspection failure. An existing empty database can be inspected; a missing database or failed connection is an error. The plan describes a snapshot and does not guarantee that executing the SQL will succeed.

Dry inspection compares the target revision declared in versioning.sql with _v.versioning without executing the script. A missing revision table is treated as revision zero, including on existing databases. The script also creates the stored-procedure hash registry when upgrading a legacy database.

Content hashes track files applied by these tools. They do not detect manual edits to database procedures or changes made by older tools.

-c FILENAME | –config=‌FILENAME

Use the configuration and other resources for the exchange to operate from FILENAME.

-g | –gc

Garbage collect database. Deletes all unnecessary data in the database.

-h | –help

Print short help on options.

-L LOGLEVEL | –loglevel=‌LOGLEVEL

Specifies the log level to use. Accepted values are: DEBUG, INFO, WARNING, ERROR.

-l FILENAME | –logfile=‌FILENAME

Send logging output to FILENAME.

-R | –reset

Drop tables. Dangerous, will delete all existing data in the database.

-r | –restart

Restart all auditors from the beginning. Useful for testing.

-v | –version

Print version information.

24.42.4. See Also#

taler-auditor-httpd(1), taler-auditor-dbconfig(1), taler-auditor.conf(5).

24.42.5. Bugs#

Report bugs by using https://bugs.taler.net/ or by sending electronic mail to <taler@gnu.org>.