Skip to content

Save and Optimize the Database

In this page, you can find information related to saving the database and configuring Squash TM.

Saves

Squash TM does not offer any particular saving mechanism. The only items you should save are:

  • the database;
  • the configuration files for the 'bin' and 'conf' folders.

Save the Database

Run this query to save the Squash TM database on Maria DB with a super user account:

mysqldump -u <username> -p<password> -D <squashtm database> > path/backup.sql

Run this query for PostgreSQL with a super user account:

pg_dump -p <port> --username <username> <squashtm database> > path/backup.sql

Restore the Database

Run this query to restore Squash TM's database on MariaDB with a super user account:

mysql -u root -p<password> <squashtm database> < path/backup.sql

Run this query for PostgreSQL with a super user account:

psql -p <port> --username <username> <squashtm database> < path/backup.sql

Focus

After restoring the database with a super user account, don't forget to verify that the user ('squash-tm' in the example) in Squash TM still has the necessary rights on the database. If that is not the case, please run the following requests:

GRANT ALL ON squashtm.* TO 'squash-tm'@'localhost';
FLUSH PRIVILEGES;


PostgreSQL :

GRANT ALL PRIVILEGES ON DATABASE squashtm TO "squash-tm";

Save Configuration Files

To save Squash TM's configuration, copy the following files:

  • startup.sh or startup.bat;
  • squash.tm.cfg.properties;
  • squash.tm.cfg-mysql.properties or squash.tm.cfg-postgresql.properties if it contains access to the database;
  • log4j2.xml if particular loggers were added;
  • custom language files if there are any.

Optimize the database

To optimize the use of the database, we recommend that you start a tables optimizations once a month on Maria DB:

mysqlcheck -p <password> -o <squashtm database>