Table of Contents
Introduction

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

Requirements

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

Converted Data

The conversion script will convert and import the following data from your AutoGallery SQL 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 ags-convert.php /full/path/to/ags

Where /usr/local/bin/php is the full path to the PHP CLI executable on your server and /full/path/to/ags is the full path to the AutoGallery SQL installation on your server.

Conversion Process

Follow the steps below to convert your AutoGallery SQL data:

The conversion process will not affect your AutoGallery SQL installation. The AutoGallery SQL data will be left unchanged and you will be able to continue using AutoGallery SQL as normal after the conversion has been completed.

Before you start the conversion you should process all of the waiting partner account requests in AutoGallery SQL. Partner account requests will not be copied over to TGPX, but if you process them first in AutoGallery SQL it won't matter since you will have either created the necessary partner accounts or deleted the requests you don't want.
  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 AutoGallery SQL 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 AutoGallery SQL installation is currently configured for. The TGPX installation should not point to the same Thumbnail URL as your AutoGallery SQL installation.

  3. Once TGPX is installed and has had it's initial settings configured through the General Settings interface, upload the ags-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 and fonts directories to 777 so the annotation and font files from AutoGallery SQL can be copied over.

  5. Point your web browser to the ags-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 AutoGallery SQL installation on your server. This should point to the directory where the ags.pl and common.pl files are located.

  6. Once you have filled in the directory path to your AutoGallery SQL 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 AutoGallery SQL installation and that you have the correct version of AutoGallery SQL 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 AutoGallery SQL 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 and fonts directories back to their original setting (generally 755)
Once you have completed these steps, the coversion process is complete. You should remove the ags-convert.php file from your server to prevent it from being accidentally run again.