5.7.112. checksetup

5.7.112.1. NAME

checksetup.pl - A do-it-all upgrade and installation script for Bugzilla.

5.7.112.2. SYNOPSIS

./checksetup.pl [--help|--check-modules|--version]
./checksetup.pl [SCRIPT [--verbose]] [--no-templates|-t]
                [--make-admin=user@domain.com]
                [--reset-password=user@domain.com]

5.7.112.3. OPTIONS

SCRIPT

Name of script to drive non-interactive mode. This script should define an %answer hash whose keys are variable names and the values answers to all the questions checksetup.pl asks. For details on the format of this script, do perldoc checksetup.pl and look for the RUNNING CHECKSETUP NON-INTERACTIVELY section.

--help

Display this help text

--check-modules

Only check for correct module dependencies and quit afterward.

--make-admin=username@domain.com

Makes the specified user into a Bugzilla administrator. This is in case you accidentally lock yourself out of the Bugzilla administrative interface.

--reset-password=user@domain.com

Resets the specified user's password. checksetup.pl will prompt you to enter a new password for the user.

--no-templates (-t)

Don't compile the templates at all. Existing compiled templates will remain; missing compiled templates will not be created. (Used primarily by developers to speed up checksetup.) Use this switch at your own risk.

--verbose

Output results of SCRIPT being processed.

--version

Display the version of Bugzilla, Perl, and some info about the system that Bugzilla is being installed on, and then exit.

5.7.112.4. DESCRIPTION

Hey, what's this?

checksetup.pl is a script that is supposed to run during installation time and also after every upgrade.

The goal of this script is to make the installation even easier. It does this by doing things for you as well as testing for problems in advance.

You can run the script whenever you like. You MUST run it after you update Bugzilla, because it will then update your SQL table definitions to resync them with the code.

You can see all the details of what the script does at How Checksetup Works.

5.7.112.5. MODIFYING CHECKSETUP

There should be no need for Bugzilla Administrators to modify this script; all user-configurable stuff has been moved into a local configuration file called localconfig. When that file in changed and checksetup.pl is run, then the user's changes will be reflected back into the database.

However, developers often need to modify the installation process. This section explains how checksetup.pl works, so that you know the right part to modify.

How Checksetup Works

checksetup.pl runs through several stages during installation:

1

Checks if the required and optional perl modules are installed, using Bugzilla::Install::Requirements/check_requirements.

2

Creates or updates the localconfig file, using Bugzilla::Install::Localconfig/update_localconfig.

3

Checks the DBD and database version, using Bugzilla::DB/bz_check_requirements.

4

Creates the Bugzilla database if it doesn't exist, using Bugzilla::DB/bz_create_database.

5

Creates all of the tables in the Bugzilla database, using Bugzilla::DB/bz_setup_database.

Note that all the table definitions are stored in Bugzilla::DB::Schema/ABSTRACT_SCHEMA.

6

Puts the values into the enum tables (like resolution, bug_status, etc.) using Bugzilla::DB/bz_populate_enum_tables.

7

Creates any files that Bugzilla needs but doesn't ship with, using Bugzilla::Install::Filesystem/update_filesystem.

8

Creates the .htaccess files if you haven't specified not to in localconfig. It does this with Bugzilla::Install::Filesystem/create_htaccess.

9

Updates the system parameters (stored in data/params.json), using Bugzilla::Config/update_params.

10

Pre-compiles all templates, to improve the speed of Bugzilla. It uses Bugzilla::Template/precompile_templates to do this.

11

Fixes all file permissions to be secure. It does this differently depending on whether or not you've specified $webservergroup in localconfig.

The function that does this is Bugzilla::Install::Filesystem/fix_all_file_permissions.

12

Populates the fielddefs table, using Bugzilla::Field/populate_field_definitions.

13

This is the major part of checksetup--updating the table definitions from one version of Bugzilla to another.

The code for this is in Bugzilla::Install::DB/update_table_definitions.

This includes creating the default Classification (using Bugzilla::Install/create_default_classification) and setting up all the foreign keys for all tables, using Bugzilla::DB/bz_setup_foreign_keys.

14

Creates the system groups--the ones like editbugs, admin, and so on. This is Bugzilla::Install/update_system_groups.

15

Creates all of the user-adjustable preferences that appear on the "General Preferences" screen. This is Bugzilla::Install/update_settings.

16

Creates an administrator, if one doesn't already exist, using Bugzilla::Install/create_admin.

We also can make somebody an admin at this step, if the user specified the --make-admin switch.

17

Creates the default Product and Component, using Bugzilla::Install/create_default_product.

Modifying the Database

Sometimes you'll want to modify the database. In fact, that's mostly what checksetup does, is upgrade old Bugzilla databases to the modern format.

If you'd like to know how to make changes to the datbase, see the information in the Bugzilla Developer's Guide, at: http://www.bugzilla.org/docs/developer.html#sql-schema

Also see Bugzilla::DB/"Schema Modification Methods" and Bugzilla::DB/"Schema Information Methods".

5.7.112.6. RUNNING CHECKSETUP NON-INTERACTIVELY

To operate checksetup non-interactively, run it with a single argument specifying a filename that contains the information usually obtained by prompting the user or by editing localconfig.

The format of that file is as follows:

$answer{'db_host'}   = 'localhost';
$answer{'db_driver'} = 'mydbdriver';
$answer{'db_port'}   = 0;
$answer{'db_name'}   = 'mydbname';
$answer{'db_user'}   = 'mydbuser';
$answer{'db_pass'}   = 'mydbpass';

$answer{'urlbase'} = 'http://bugzilla.mydomain.com/';

(Any localconfig variable or parameter can be specified as above.)

$answer{'ADMIN_EMAIL'} = 'myadmin@mydomain.net';
$answer{'ADMIN_PASSWORD'} = 'fooey';
$answer{'ADMIN_REALNAME'} = 'Joel Peshkin';

$answer{'NO_PAUSE'} = 1

NO_PAUSE means "never stop and prompt the user to hit Enter to continue, just go ahead and do things, even if they are potentially dangerous." Don't set this to 1 unless you know what you are doing.