The database tools interface allows you to use functions to manage the MySQL database that the TGPX data is being stored in. The functions available in the Database Tools interface are described in this document.
Database Backup and Restore
The database backup and restore functions provide you with an internal method to create a backup of the MySQL database tables that TGPX uses to store it's data. On some servers, depending on the server configuration and size of your database, this internal function may not work and you may need to use an alternate method. The method that you use is really not that important, as long as the data is in a format that MySQL can read.
Database Backup
To use the database backup feature access the Database > Tools function from the control panel menu. This will load a page with a section header bar labeled 'Database Backup and Restore' which is where you will run the database backup function. This warning message may appear, depending on your server configuration:
-
The database backup and restore functions will have to be run through your browser...
The database backup feature has a few options that you can configure. Each of those is described below.
SQL Filename | Enter the filename to which you would like the data from your MySQL database written. This field is required, and the file will be created in the data directory of your TGPX installation. |
Thumbs Filename | If you would like to generate a backup file containing your preview thumbnail images, enter the filename to which you would like them written. This field is optional; if it is left blank the thumbnails will not be backed up. If you do specify a filename, it will be created in the data directory of your TGPX installation. |
Archive Filename |
This option will not be available on all servers. It requires that your server have the CLI version of PHP, the tar program, and the gzip program installed and
available for you to use
If you would like the software to automatically create a gzipped tarball archive of your backup file(s), enter the filename to use in this field. This field is optional; if it is left blank, no archive file will be created. If you do specify a filename, it will be created in the data directory of your TGPX installation. This will also automatically remove the SQL and Thumbs backup files after they have been added to the archive. |
Database Restore
To use the database restore feature access the Database > Tools function from the control panel menu. This will load a page with a section header bar labeled 'Database Backup and Restore'. You may again see a warning message, in which case it may not be possible to restore your data from the web-based interface.
To do the actual database restore, you will first need to upload the backup file(s) to the data directory of your TGPX installation. You can upload only the SQL backup file or you can upload both the SQL and Thumbs backup files. Note that the restore function cannot automatically read from an archive file, so you will need to have extracted the backup files first if they are in a gzipped tarball.
Once the files are uploaded, enter their names in the appropriate text input boxes and then press the Restore button. The data in the file(s) will be read back into your TGPX installation. You should allow a few minutes for this process to complete (more time will be needed for larger databases) before you begin accessing the other software functions.
Alternate Backup/Restore Methods
Backing up your MySQL data can be done using any tool that creates a file containing the raw SQL queries needed to restore the database. Programs such as phpMyAdmin offer this capability, so you can try using that to backup your SQL data. Your server may also have a web-based control panel that has a feature to backup your MySQL data. If you still are unable to find a solution to backup your MySQL data, contact your server administrator to discuss with them the options you have for backing up your MySQL data.
Most utilities that allow you to backup your MySQL data also have a function to restore the MySQL data from the file that was generated. You can again try using one of these tools if they are available to you on your server, or you can contact your server administrator to discuss with them the options you have for restoring MySQL data from a file.
For your thumbnail preview images, you can download the contents of your TGPX Thumbnail URL folder to your local computer for safe keeping. If you ever need to restore them, simply upload them back to your server and set their permissions to 666.
Database Repair/Optimize
This function allows you to "cleanup" the MySQL database tables that it uses so they are optimized for both speed and disk usage. In general, you will not need to run this command more than once every few weeks, as MySQL is quite efficient in maintaining it's datafiles. The only time you may need to run it more often is if you delete a large number of galleries from your database.
In some cases, usually after your server recovers from a serious error, your MySQL database may become corrupted. When this happens you will get error messages from TGPX indicating that there is a problem with one or more of your database tables. In most circumstances MySQL is able to repair damaged tables with it's built in functions. TGPX allows you to run these built in functions through the Database Tools interface. If you ever get these types of error messages, simply login to the control panel and use the Optimize/Repair function.
To use the database repair/optimize feature access the Database > Tools function from the control panel menu. This will load a page with a section header bar labeled 'Database Backup and Restore'. In the header bar, click on the icon to start the repair/optimize process.
Raw Database Query
This function allows you to run a raw SQL query against the MySQL database that is storing the TGPX data. This feature is intended for advanced users who have experience working with SQL queries and understand the impact they will have on the database. In most cases you will not need to use this feature, unless you have been specifically instructed to do so for tech support purposes.