UPGRADE INSTRUCTIONS
Contemplate(tm) Web Templating System

(to perform a new installation, see install.txt)

-----------------------------------------------------------------------

UPGRADING FROM 2.x to 2.x

1. Document any customizations you have made to the Contemplate source code.

2. In your installation, remove all the existing files except those in the
config folder.

3. Upload all the new files except those in the config folder.

4. In general, you should not update the config folder because that's where your
site-specific settings reside. But some new features do require updating some
files in this folder. Check docs/release_notes.html to see if any new features
apply to you. If so, you can copy those specific changes from the new config
files to your existing files. A diff tool will show you what has changed while
letting you preserve your own configuration settings and visual customizations.

5. If you documented any customizations in step 1, check docs/release_notes.html
to see if your customizations have been included in this release. If not,
re-apply your customizations to the new source code.

If you need help, visit
http://www.arlomedia.com/software/contemplate/assembled/community.html

-----------------------------------------------------------------------

UPGRADING FROM 1.x to 2.x

1. Rename the new contemplate folder to contemplate_new to avoid overwriting
your existing files.

2. Copy the contemplate/data/pages.txt file from your existing contemplate
folder to the contemplate_new/config folder.

3. Open the contemplate/data/preferences.ini file in your existing contemplate
folder and compare it to the default values in the
contemplate_new/config/constants.php file. Change any values in the new file to
match changes you made in your existing file.

4. Upload contemplate_new to your website.

5. Rename your existing contemplate folder to contemplate_old and rename
contemplate_new to contemplate.

6. Test your site.

SETTING UP A DATABASE FOR THE NEW REPORTER VERSION

1. If you're using the Contemplate Reporter to track visitors and page views,
you now need a MySQL database; you can create a new one or use an existing one.
Enter your database connection details into the REPORTER_DATABASE settings in
config/constants.php. If you wish to password-protect your reports, you can also
specify a password for the PASSWORD setting.

2. Run this SQL query to create a new table for the Reporter:

	CREATE TABLE `reporter` (
	  `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
	  `visitor_id` tinytext NOT NULL,
	  `ip_address` tinytext NOT NULL,
	  `host` tinytext NOT NULL,
	  `page` tinytext NOT NULL,
	  `user_agent` tinytext NOT NULL,
	  `referrer` tinytext NOT NULL,
	  `entry` tinyint(3) NOT NULL default '0',
	  `exit` tinyint(3) NOT NULL default '0',
	  `duration` smallint(6) NOT NULL default '0',
	  `http_status` smallint(6) NOT NULL default '0',
	  `assembler_error` tinytext NOT NULL
	);

3. View a few website pages to generate some data. Then browse to
http://www.yourdomain.com/contemplate/reporter/reporter.php to test your setup.

IMPORTING YOUR EXISTING REPORTER DATA INTO THE NEW REPORTER DATABASE

1. If you did not use the USE_COOKIES_TO_TRACK_VISITORS option in the old version,
you must set this option to false while importing your old data. Once the old data
is imported, you can enable this option if you wish.

2. Download the reporter import tool from
http://www.arlomedia.com/software/contemplate/source/reporter_database_import.zip
and upload it to the contemplate/reporter directory of your website.

2. Browse to http://www.yourdomain.com/contemplate/reporter/database_import.php
to import the data from your old data files. If you followed the Contemplate
upgrade instructions above, your old data files are located at
../../contemplate_old/data/reporter.

3. When the import script finishes running (it typically processes about 1000
entries per minute), return to
http://www.yourdomain.com/contemplate/reporter/reporter.php to check your data.

4. Now you can delete the contemplate/reporter/database_import.php script from
your website.
