Table of Contents
Introduction

If you are currently running TGP Rotator on one of your sites and would like to import it's data into a TGPX installation, you can use the included tgpr-convert.php script to do just that. This document will outline the steps necessary to convert your TGP Rotator data.

Requirements

To convert your TGP Rotator data you will need to be using the latest snapshot release (currently 1.2.1-SS). If you are not using the latest TGP Rotator snapshot release, follow the instructions in the TGP Rotator software manual to upgrade or patch your installation.

Converted Data

The conversion script will convert and import the following data from your TGP Rotator installation: The conversion script will attempt to convert your TGP page templates to the new TGPX format, however some template directives cannot be converted or may need some tweaking after the conversion is complete. Here are the known limitations of template conversion: Running From The Command Line

You will need shell access (through telnet or SSH) to your server to run the conversion script from the command line

The conversion script can be run from the command line of your server, and this is the recommended method if you have a large number of galleries to convert (20,000+). The conversion process is the same as listed below, however instead of accessing the conversion script through your browser you will run it from the command line of your server using the PHP CLI executable. The command you will use will be something like this:

/usr/local/bin/php tgpr-convert.php /full/path/to/tgpr

Where /usr/local/bin/php is the full path to the PHP CLI executable on your server and /full/path/to/tgpr is the full path to the TGP Rotator installation on your server.

Conversion Process

Follow the steps below to convert your TGP Rotator data:

The conversion process will not affect your TGP Rotator installation. The TGP Rotator data will be left unchanged and you will be able to continue using TGP Rotator as normal after the conversion has been completed.
  1. Install a clean copy of TGPX on your server using the standard installation instructions. Do not add any galleries, categories, or setup any pages before you convert your TGP Rotator data. Anything that you configure in TGPX will be deleted during the conversion process. You will need to setup the TGPX settings through the General Settings interface, however.

  2. When configuring the TGPX settings, make sure you use a different Thumbnail URL setting than what your TGP Rotator installation is currently configured for. The TGPX installation should not point to the same Thumbnail URL as your TGP Rotator installation.

  3. Once TGPX is installed and has had it's initial settings configured through the General Settings interface, upload the tgpr-convert.php file from the utilities directory of the TGPX distribution to the admin directory of your TGPX installation on your server.

  4. You will need to temporarily change the permissions on the TGPX annotations directory to 777 so the annotation files from TGP Rotator can be copied over.

  5. Point your web browser to the tgpr-convert.php script that you uploaded to the admin directory of your TGPX installation. This will load a page where you will need to enter the full directory path to the location of the TGP Rotator installation on your server. This should point to the directory where the tgpr.pl and common.pl files are located.

  6. Once you have filled in the directory path to your TGP Rotator installation, you can press the Convert Data button. You will be asked to confirm that you do want to convert this data.

  7. The conversion script will run a few tests to make sure you have entered a valid directory path to your TGP Rotator installation and that you have the correct version of TGP Rotator installed. If any errors are encountered, it will display them and terminate the conversion process.

  8. If all of the pre-conversion tests pass, the script will begin converting your TGP Rotator data. The conversion process can take anywhere from a few seconds to several minutes depending on the size of your gallery database. During the conversion process, the script will output some text to let you know what it is doing. Don't be alarmed if you don't see any text, as some web servers will wait for the script to complete before outputting the information it is generating. You can also check the convert.log file which will be located in the data directory of your TGPX installation.

  9. When the conversion process is complete you will see a message that says "Data conversion complete!" (check the convert.log file in the data directory of your TGPX installation if you don't get output in your browser). You can login to your TGPX control panel to check that all of the data has been properly imported.

  10. Run the TGP Pages > Recompile TGP Templates function to force the software to recompile all of the imported TGP page templates.

  11. Change the permissions on the annotations directory back to it's original setting (generally 755)
Once you have completed these steps, the coversion process is complete. You should remove the tgpr-convert.php file from your server to prevent it from being accidentally run again.