Environment
Novell Service Desk
Situation
Sometimes a backup of a MySQL database is required, but the size of the database even after being compressed could too large for the entire database to be backed up. This article advises on how to limit the size of the backup accordingly for troubleshooting purposes.
The usage of these steps really depends on the situation. If troubleshooting is needed on another server using Novell Service Desk, the partial database may not work. It may also fail some internal validation due the dependencies of parent-child, foreign key relationship.
The usage of these steps really depends on the situation. If troubleshooting is needed on another server using Novell Service Desk, the partial database may not work. It may also fail some internal validation due the dependencies of parent-child, foreign key relationship.
Resolution
Note that before making any backups of a Novell Service Desk database, the application server (eg Tomcat, JBoss, etc) should be stopped.
To limit the number of rows in each table the mysqldump command can be used with the following options, where 123.123.123.123 is the hosting address of the database server, username is the username for accessing the database and dbname is the database name:
mysqldump --opt --where='true LIMIT 1000' -h 123.123.123.123 -u username -p dbname > dbname.sql
This limit may or may not be enough to backup the required parts of the database so the LIMIT number may need to be increased accordingly.
Note that this will backup the first (up to) 1,000 entries in each table accordingly so if the reason the backup is needed relates specifically to a most recent customer/user or request then a full backup may be needed.
However, if the backup is required to investigate configuration issues with workflows, etc, then limiting the results may be a solution where backing up and sending the entire database is not practical.
To limit the number of rows in each table the mysqldump command can be used with the following options, where 123.123.123.123 is the hosting address of the database server, username is the username for accessing the database and dbname is the database name:
mysqldump --opt --where='true LIMIT 1000' -h 123.123.123.123 -u username -p dbname > dbname.sql
This limit may or may not be enough to backup the required parts of the database so the LIMIT number may need to be increased accordingly.
Note that this will backup the first (up to) 1,000 entries in each table accordingly so if the reason the backup is needed relates specifically to a most recent customer/user or request then a full backup may be needed.
However, if the backup is required to investigate configuration issues with workflows, etc, then limiting the results may be a solution where backing up and sending the entire database is not practical.
Additional Information
Formerly known as 1000910