The savapage-db command-line tool provides functions for
manipulating the database. The tool is located in
/opt/savapage/server/bin/[platform]/ and needs to be
executed from a command prompt. The syntax of the command is:
usage: [OPTION] --db-config-get <NAME> Gets configuration property value. This is an advanced option. Please contact SavaPage Support before use. --db-config-set <NAME=VALUE> Sets configuration property value. This is an advanced option. Please contact SavaPage Support before use. --db-delete-logs <DAYS> Deletes application, account transaction and document log data older than DAYS. A DAYS value of zero (0) will remove all log data from the system. --db-export Exports the database to the default backup location. --db-export-to <FILE|DIR> Exports the database to the specified file or directory. --db-import <FILE> Imports the database from the specified file. Deletes any existing data before loading the data. --db-init Re-initializes the database even if it already exists. --db-run-script <FILE> Runs SQL statements from the specified script file. NOTE: Only perform as requested by SavaPage Support. --db-run-sql <STATEMENT> Runs an SQL statement. NOTE: Only perform as requested by SavaPage Support. -h,--help Displays this help text.
The command must be run as the
savapage user. An
sudo su - savapage cd server/bin/linux-x64 ./savapage-db --db-import /home/john/savapage-backup.zip
savapage-db needs exclusive access to the database. It is important that any SavaPage services and processes are stopped before executing a command. Failure to do so will result in a "database in use" error message. The savapage-db command is a powerful low-level utility and its use on a production system should be carefully considered. Details of the available commands are discussed below.
This option delete old log data from the system. This command will permanently delete the following data.
Document logs - Record all document history and statistics
Transaction logs - Record all financial history and statistics
Application logs - Record application status and error messages
The DAYS option determines what data will be deleted. If DAYS is 90, then all log data more than 90 days old will be deleted. A value of zero (0) will remove all historical log data from the system. This is an example:
savapage-db --db-delete-logs 90
This option exports the data from the database. The application server must be stopped before performing the export. See Section C.4, “Stopping and Starting the Server”.
If you want to perform an online backup without stopping the application server you can use the backup function in the Admin Web App.
savapage-db --db-export savapage-db --db-export-to /home/john savapage-db --db-export-to /home/john/savapage-backup.zip
The database export file is created in the
This option is used to override the default backup directory.
The filename will still be named
The full path and filename where the backup is saved is specified.
When executing the command the last line echoed to
stdout is the canonical path of the database
If the directory or filename parameters contain spaces, then the argument needs to be quoted.
This option imports the data (from a previous export) into the database. The application server must be stopped to perform the import. This is an example:
savapage-db --db-import /home/john/savapage-backup.zip
Progress and statistics of the import process are written to
Be careful, existing data in the database are erased.