Loaddb Reference

The loaddb tool lets you interact with the database to perform various tasks, such as backing up the database or uploading content. This reference lists the commands to perform these tasks.

The loaddb tool can be run from the command line console when it is opened from the WEB-INF directory.

The standard usage is:
loaddb.{bat,sh}
-Dlc.port=port# -Dlc.protocol=https -Dlc.host=fully-qualified-domain-name 
command
Example:
loaddb.bat
-Dlc.port=8443 -Dlc.protocol=https -Dlc.host=lc.example.com 
loadpub
lc.example.com, where lc refers to an example server dedicated to Content Delivery.

The following table lists the most usual commands used with the loaddb tool. These commands cover most of the needs for database operations with Content Delivery. The default command for the loaddb tool is UPGRADE.

CommandDescriptionOptions specific to the command
BACKUPCreates a backup of the Content Delivery database. By default it creates a backup of the entire database as a .zip file located in the WEB-INF repository
Example with options:
loaddb.bat -Dlc.file=mybackup -Dlc.db=Y BACKUP
  • -Dlc.file="filename" specifies the name of the saved backup ZIP file or folder. By default, the filename is full<datetime>.zip.

    If the argument to -Dlc.file= does not end in .zip, the backup will be saved to a folder, which is recommended when the size of the database being backed up exceeds 8G. When you decide to save to a folder, you need to set the following: -Dlc.zip=no. This is because the default value of -Dlc.zip is yes, which means that a zip file would be created even if it is saved to a folder.

  • -Dlc.db=CollectionPoint specifies the database collection point (repository) inside the database for the backup. By default, the repository is /db, which means the entire database.
    If you use for example
    loaddb
    -Dlc.db=/db/LiveContent/config -Dlc.zip=yes
    BACKUP
    The full *.zip file will be a back up of
    /db/LiveContent/config
    repository (and all of the repositories inside it, if any exist).
  • Specifying -Dlc.zip=no creates a backup of the original database to a folder rather than to a zip file. The default is yes.
RESTORERestores a backup of the Content Delivery database. By default, loaddb will restore the standard backup file stored in the WEB-INF repository.
  • -Dlc.file="filename" specifies the name of the backup ZIP or folder file. By default, the filename is full<datetime>.zip.
  • -Dlc.pswd="admin_password" specifies the local administrator password. By default, no password is specified.
UPGRADEUpgrades the database with the latest set of files from the db folder, usually for a skin files update. It always upgrades with the entire content of the folder.

Specifying this command creates a log file called UPGRADE.log in the ContentDelivery_home/logs.

No specific option.
CHECKDBRuns a manual database consistency checking, rather than having to wait for the scheduled backup.

The backup configuration in conf.xml supports scheduled backups with database consistency checking. However, running the loaddb BACKUP command does not perform database consistency checking.

  • Specifying -Dlc.backup=yes creates a backup of the original database after running consistency checking. By default, no backup is created.
  • Specifying -Dlc.zip=no creates a backup of the original database to a folder rather than to a zip file. The default is yes.
  • Specifying -Dlc.max_zip=number_of_zip_files limits the maximum number of ZIP files that are created for the backup. By default, the maximum number of backup files is five. This is valid only when lc.backup=yes
FIX-PERMISSIONSRestores the permissions that were valid before a database upgrade. This command is used whenever Content Delivery is upgraded to a new version.No specific option.
SKINS-RESTORERestores the default skins as they were just after installation, if you had modified them afterwards. This command is typically used after an upgrade of Content Delivery to a new version.No specific option.
INITGRAPHCreates a graph for every publication in the Content Delivery database.No specific option.

The following table lists the options that can be used with all the commands.

NameDescription
-Dlc.contextWeb application context, used to form the application URL. The default is derived from local configuration, usually /ContentDelivery
-Dlc.hostHost name of the Content Delivery instance in which to connect. The default is localhost. Install a certificate to JAVA directly with all options.
-Dlc.portPort number to connect to. The default is derived from the local configuration.
-Dlc.protocolThe network protocol to use for the connection. Should be either http or https. The default is http. Install a certificate to JAVA directly with all options.
-jhHelper option used when you need to explicitly point to a java location other than JAVA_HOME, or if JAVA_HOME is not set.

The following table lists unusual commands used with the loaddb tool. These commands are used in very specific cases and will likely be absent from most used command set.

CommandDescriptionOptions specific to the command
ADDCONFIGSets a global configuration value. This allows an administrator to change some of the global configuration values.
  • -Dlc.config.name is the global configuration name.
  • -Dlc.config.value is the global configuration value.
AUDITEXTRACTExtracts the audit XML files from the Content Delivery database to the ContentDelivery_home/extract/audits directory.No specific option.
clientLaunches the eXistDB client tool. This tool can be used to
  • View the database structure
  • View the file content
  • Re-index the collection
No specific option.
DELETECONFIGDeletes a global configuration value. This allows an administrator to delete a global configuration value.

-Dlc.config.name is the global configuration name.

fix_auditsAdjusts the Content Delivery aggregated audit server.

If the CDs have the problem, the non-aggregated audits on the CDs can also be fixed by running the following:

loaddb.bat -Dlc.audittype=local

No specific option.
INSTALLRe-installs the database and removes all references to publications. Creates a log file called INSTALL.log in the ContentDelivery_home/logs directory. No specific option.
loadpacInstalls and uploads a documentation package. Creates a log file called loadpac.log in the ContentDelivery_home/logs directory.
  • -Dlc.package="filename.pac" specifies the name of a package file (.pac) or the path to a directory that contains multiple .pac files.
loadpubUploads a publication from a directory of XML or data files. Creates a log file called loadpub.log in the ContentDelivery_home/logs directory.
  • -Dlc.filter="filename" specifies the name of the XML resource that must be used as the filter file for the publication.
  • -Dlc.install=true forces the publication to visible state. If set to false the publication's visible value will not be changed. The default is false
  • -Dlc.pubdir="directoryname" specifies the directory where the publication data to be uploaded is located. It is possible to specify multiple input directories by way of a list of names separated by commas, for example:
    -Dlc.pubdir="documentation,samples/DITA"
  • -Dlc.publang=en specifies the language of the publication. The default value is en.
  • -Dlc.pubname="publicationname" specifies the name of the publication
  • -Dlc.toc="filename" specifies the name of the XML resource that must be used as the publication's top level table of content. This file needs to be present in the directories specified with -Dlc.pubdir="directoryname".
loadtopicThe loadtopic option is used for topic upload or prepare. The target will upload topic files from a folder, and then do a single topic prepare.

Loaddb with the loadtopic option

  1. Waits for Content Delivery to be online.
  2. Logs in to Content Delivery in secure mode.
  3. Writes output to logs\loadtopic.log
  4. Calls the com.xyenterprise.xquery.lcutil.PrepareTopic java program to prepare a single topic for viewing.

All files in the single_topic folder are first uploaded using web/pub.xql?action=upload_start&type=topic, upload_resource&type=topic, followed by upload_end&type=topic.

After all files are uploaded into the holding area, single topic prepare is invoked using web/pub.xql?action=prepare_topic with the &publish argument, if provided. If the action succeeds, the publication in its selected language is made visible.

loadtopic -Dlc.pubname=MP330-v1 -Dlc.publang=en
-Dlc.pubdir=single_topic -Dlc.publish=all
No specific option.
optimizeDefragments the Lucene index.

As you load and delete publications over time, the Lucene index can become fragmented. Defragmenting the Lucene index can improve performance and reduce memory consumption during search operations.

No specific option.
PATCHLoads a single file into the Content Delivery database. File is loaded from the ContentDelivery_home/db folder.
  • -Dpatch.dir=folder specifies the folder from which to load the patched file. This folder must start with db/ and is always local to the db/ folder.
  • -Dpatch.file=file specifies the file to load into the XML database, which is located in the folder denoted by -Dpatch.dir
UNPROXYRemoves a proxy setting (proxy.url) from a Content Delivery installation. No specific option.