\documentclass[10pt,twoside]{memoir}
\usepackage{layouts}[2001/04/29]

\usepackage{palatino} 
\usepackage{color,calc} 
\newsavebox{\ChpNumBox} 
\definecolor{ChapBlue}{rgb}{0.00,0.65,0.65} 
\makeatletter 
\newcommand*{\thickhrulefill}{% 
\leavevmode\leaders\hrule height 1\p@ \hfill \kern \z@} 
\newcommand*\BuildChpNum[2]{% 
\begin{tabular}[t]{@{}c@{}} 
\makebox[0pt][c]{#1\strut} \\[.5ex] 
\colorbox{ChapBlue}{% 
\rule[-10em]{0pt}{0pt}% 
\rule{1ex}{0pt}\color{black}#2\strut 
\rule{1ex}{0pt}}% 
\end{tabular}} 
\makechapterstyle{BlueBox}{% 
\renewcommand{\chapnamefont}{\large\scshape} 
\renewcommand{\chapnumfont}{\Huge\bfseries} 
\renewcommand{\chaptitlefont}{\raggedright\Huge\bfseries} 
\setlength{\beforechapskip}{20pt} 
\setlength{\midchapskip}{26pt} 
\setlength{\afterchapskip}{40pt} 
\renewcommand{\printchaptername}{} 
\renewcommand{\chapternamenum}{} 
\renewcommand{\printchapternum}{% 
\sbox{\ChpNumBox}{% 
\BuildChpNum{\chapnamefont\@chapapp}% 
{\chapnumfont\thechapter}}} 
\renewcommand{\printchapternonum}{% 
\sbox{\ChpNumBox}{% 
\BuildChpNum{\chapnamefont\vphantom{\@chapapp}}% 
{\chapnumfont\hphantom{\thechapter}}}} 
\renewcommand{\afterchapternum}{} 
\renewcommand{\printchaptertitle}[1]{% 
\usebox{\ChpNumBox}\hfill 
\parbox[t]{\hsize-\wd\ChpNumBox-1em}{% 
\vspace{\midchapskip}% 
\thickhrulefill\par 
\chaptitlefont ##1\par}}% 
} 
\chapterstyle{BlueBox}

\setsecheadstyle{\sffamily\bfseries\Large}
\setsubsecheadstyle{\sffamily\bfseries\normal}

\makepagestyle{myruledpagestyle}
\makeevenhead{myruledpagestyle}{\thepage}{}{\leftmark}
\makeoddhead{myruledpagestyle}{\rightmark}{}{\thepage}
\makeatletter
\makepsmarks{myruledpagestyle}{
  \def\chaptermark##1{\markboth{%
        \ifnum \value{secnumdepth} > -1
          \if@mainmatter
            \chaptername\ \thechapter\ --- %
          \fi
        \fi
        ##1}{}}
  \def\sectionmark##1{\markright{%
        \ifnum \value{secnumdepth} > 0
          \thesection. \ %
        \fi
        ##1}}
}
\makeatother

\makerunningwidth{myruledpagestyle}{1.1\textwidth}
\makeheadposition{myruledpagestyle}{flushright}{flushleft}{flushright}{flushleft}
\makeheadrule{myruledpagestyle}{1.1\textwidth}{\normalrulethickness}

\makeglossary
\makeindex

\def\mychapterstyle{BlueBox}
\def\mypagestyle{myruledpagestyle}
\def\revision{}
%%% need more space for ToC page numbers
\setpnumwidth{2.55em}
\setrmarg{3.55em}

%%% need more space for ToC section numbers
\cftsetindents{part}{0em}{3em}
\cftsetindents{chapter}{0em}{3em}
\cftsetindents{section}{3em}{3em}
\cftsetindents{subsection}{4.5em}{3.9em}
\cftsetindents{subsubsection}{8.4em}{4.8em}
\cftsetindents{paragraph}{10.7em}{5.7em}
\cftsetindents{subparagraph}{12.7em}{6.7em}

%%% need more space for LoF numbers
\cftsetindents{figure}{0em}{3.0em}

%%% and do the same for the LoT
\cftsetindents{table}{0em}{3.0em}

%%% set up the page layout
\settrimmedsize{\stockheight}{\stockwidth}{*}	% Use entire page
\settrims{0pt}{0pt}

\setlrmarginsandblock{1.5in}{1.5in}{*}
\setulmarginsandblock{1.5in}{1.5in}{*}

\setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout

\usepackage{fancyvrb}			% Allow \verbatim et al. in footnotes
\usepackage{graphicx}			% To include graphics in pdf's (jpg, gif, png, etc)
\usepackage{booktabs}			% Better tables
\usepackage{tabulary}			% Support longer table cells
\usepackage[utf8]{inputenc}		% For UTF-8 support
\usepackage{xcolor}				% Allow for color (annotations)

%\geometry{landscape}			% Activate for rotated page geometry

\usepackage[parfill]{parskip}	% Activate to begin paragraphs with an empty
								% line rather than an indent


\def\myauthor{Author}			% In case these were not included in metadata
\def\mytitle{Title}
\def\mykeywords{}
\def\mybibliostyle{plain}
\def\bibliocommand{}

\VerbatimFootnotes
\def\myauthor{Tracks Development Team}
\def\baseheaderlevel{2}
\def\mycopyright{2008 rousette.org.uk \\ This work is licensed under a Creative Commons License. \\ http://creativecommons.org/licenses/by-nc-sa/3.0/}
\date{2008-03-06}
\def\format{complete}
\def\latexxslt{memoir-twosided-manual.xslt}
\def\revision{Revision: \$Id: manual.markdown 733 2008-03-06 17:42:00Z bsag \$}
\def\mytitle{Tracks 1.5 Manual}
\def\version{1.5}
\usepackage{xmpincl}
\includexmp{CCAttributionShareAlike}


%
%	PDF Stuff
%

%\ifpdf							% Removed for XeLaTeX compatibility
%  \pdfoutput=1					% Removed for XeLaTeX compatibility
\usepackage[
	plainpages=false,
	pdfpagelabels,
	pdftitle={\mytitle},
	pagebackref,
	pdfauthor={\myauthor},
	pdfkeywords={\mykeywords},
	colorlinks=true,
	urlcolor=blue,
	linkcolor=red
	]{hyperref}
  \usepackage{memhfixc}
%\fi							% Removed for XeLaTeX compatibility


%
% Title Information
%

\ifx\subtitle\undefined
\else
	\addtodef{\mytitle}{}{ \\ \subtitle}
\fi

\ifx\affiliation\undefined
\else
	\addtodef{\myauthor}{}{ \\ \affiliation}
\fi

\ifx\address\undefined
\else
	\addtodef{\myauthor}{}{ \\ \address}
\fi

\ifx\phone\undefined
\else
	\addtodef{\myauthor}{}{ \\ \phone}
\fi

\ifx\email\undefined
\else
	\addtodef{\myauthor}{}{ \\ \email}
\fi

\ifx\web\undefined
	\else
		\addtodef{\myauthor}{}{ \\ \web}
\fi

\title{\mytitle}
\author{\myauthor}

\maxsecnumdepth{subsection}
\setsecnumdepth{subsection}

\begin{document}

\chapterstyle{\mychapterstyle}
\pagestyle{\mypagestyle}

%
%		Front Matter
%

\frontmatter


% Title Page

\maketitle
\clearpage

% Copyright Page
\vspace*{\fill}

\setlength{\parindent}{0pt}

\ifx\mycopyright\undefined
\else
	\textcopyright{} \mycopyright
\fi

\revision

\begin{center}
\framebox{ \parbox[t]{1.5in}{\centering Formatted for \LaTeX  \\ 
 by MultiMarkdown}}
\end{center}

\setlength{\parindent}{1em}
\clearpage

% Table of Contents
\tableofcontents
%\listoffigures			% activate to include a List of Figures
%\listoftables			% activate to include a List of Tables


%
% Main Content
%


% Layout settings
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip/2}

\mainmatter
\chapter{Installing Tracks 1.5}
\label{installingtracks1.5}

\section{Introduction}
\label{introduction}

Tracks 1.5 has been thoroughly beta tested by a large number of people, and should be fully stable for everyday use. However, once set up, Tracks will contain the majority of your plans for your work and personal life, so it's only sensible to make sure that you have frequent, reliable backups of your data. Full changenotes on the release can be found in \texttt{doc/CHANGELOG}. Full API documentation can be found at \texttt{doc/app/index.html}, once you have run \texttt{rake appdoc}


There are two methods of downloading Tracks 1.5 \textbf{(N.B. These links will not work until Tracks 1.5 final is released)}):


\begin{enumerate}


\item (Recommended for most people) Download the \href{http://www.rousette.org.uk/projects/files/tracks-current.zip}{zipped package}, and unzip in your preferred location (e.g.\ \texttt{\ensuremath{\sim}/Sites} for Mac OS X users).

\item Download using Subversion:
\end{enumerate}

\begin{adjustwidth}{2.5em}{2.5em}
\begin{verbatim}


  svn co --username=guest
  http://www.rousette.org.uk/svn/tracks-repos/tags/current tracks


\end{verbatim}
\end{adjustwidth}

\section{Requirements}
\label{requirements}

The Tracks interface is accessed through a web browser, so you need to run a webserver to serve the Tracks pages up to you. This isn't as daunting as it sounds, however: Tracks ships with a built-in web server called Mongrel which you can run on your own computer to serve the Tracks application locally. If you want to be able to access Tracks from any computer connected to the Internet, then you need to install Tracks on a publicly accessible server, and you will probably be better off using a more robust server such as \href{http://www.apache.org/}{Apache} or \href{http://www.lighttpd.net/}{Lighttpd} to serve the pages, particularly if it will be used by many people.


Tracks stores its data in a database, and you can either use SQLite3, MySQL or PostgreSQL. SQLite3 is the best choice for a single user (or a small number of users) on a local installation, while MySQL or PostgreSQL is better for multiple users on a remote installation.


\subsection{All-in-one installations}
\label{all-in-oneinstallations}

This is the easiest solution for Mac OS X 10.4 or Windows users wanting to run Tracks locally.


\begin{enumerate}


\item \textbf{Mac OS X}. \href{http://locomotive.sourceforge.net/}{Locomotive} is an all-in one installer for Mac OS X 10.4, which includes everything you need to run Tracks with a SQLite3 database. Locomotive doesn't work with Panther, and isn't really required for Leopard because the default Rails installation works very well. However, if you prefer to use Locomotive, it does work on Leopard.

\item \textbf{Windows}. \href{http://instantrails.rubyforge.org/wiki/wiki.pl}{Instant Rails} includes everything you need, including MySQL.
\end{enumerate}

\subsection{What is included with the Tracks package}
\label{whatisincludedwiththetrackspackage}

\begin{enumerate}


\item Tracks itself

\item Rails 1.2.5 (installed in the \texttt{/vendor/rails} directory, so you do not need to install Rails yourself)

\item An empty SQLite3 database, set up with the correct database schema
\end{enumerate}

\subsection{What you need to install}
\label{whatyouneed}

If you don't want to (or can't) use one of the all in one installations, you'll need to install a few things, depending on your platform and your needs.


\begin{enumerate}


\item \textbf{Ruby}. Version 1.8.6 is recommended, but it is also possible to use 1.8.5, 1.8.4 and 1.8.2. Note that 1.8.3 is not compatible. If you are running Mac OS X Leopard, you already have Ruby 1.8.6 installed by default, so you have nothing to do here. You can get the source to compile yourself \href{http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz}{here} for all platforms, or Windows users can use an easy \href{http://rubyforge.org/frs/?group_id=167}{installer}. If you're using a version of Mac OS X earlier than 10.5.0, it is recommended that you use the \href{http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx}{instructions here} to install all the Rails dependencies, though you can skip the step to install Rails if you like.

\item \textbf{RubyGems}. The gems needed by Rails to interact with the database have to be compiled on the platform on which they will be run, so we cannot include them with the Tracks package, unlike some other gems. So you will need to \href{http://rubyforge.org/frs/?group_id=126}{download} and install RubyGems (run \texttt{ruby setup.rb} after extracting the package). Note that once again, Mac OS X Leopard users get an easy life, because RubyGems and the SQLite3 gem is already installed. Once installed you can use RubyGems to install the gems you need for your database. If you are using SQLite3, run \texttt{sudo gem install sqlite3-ruby}, then select the appropriate package for your platform (version 1.2.1 recommended). You can use MySQL without installing a gem, but installing the gem can speed things up a bit: \texttt{sudo install gem mysql}. If you're using Leopard, there are a few work-arounds necessary, which are explained on \href{http://trac.macosforge.org/projects/ruby/wiki/Troubleshooting#IcannotbuildrubymysqlonLeopardwithmysql.combinaries}{Mac OS Forge}. The ruby-mysql bindings can sometimes be a bit troublesome to install, so to be honest, it's probably not worth the bother unless you are trying to wring maximum speed out of your system. If you are using PostgreSQL, then you can install a postgres gem: \texttt{gem install postgres}.

\item \textbf{Database}. The easiest option is to use SQLite3, as the database is included in the package. All you need then is the \texttt{sqlite3-ruby} gem, as described in step 2, and the SQLite3 libraries and binary (see \href{http://sqlite.org/download.html}{sqlite.org} for downloads and installation instructions). If you want to use MySQL, download and install a package for your platform from \href{http://dev.mysql.com/downloads/mysql/5.0.html}{MySQL.com}. The basic steps for Postgresql should be similar to those for MySQL, but they will not be discussed further here.
\end{enumerate}

\section{Installation}
\label{installation}

This description is intended for people installing Tracks from scratch. If you would like to upgrade an existing installation, please see Upgrading to Tracks 1.5 (\autoref{upgrading}).


\begin{enumerate}


\item Unzip tracks (\autoref{unzip_install}) and install in a directory

\item Decide on a database (\autoref{database_install}) to use
\begin{enumerate}


\item SQLite3 - change database.yml to point to SQLite3 database

\item MySQL - create new MySQL db and grant all privileges 
\end{enumerate}



\item Configure some variables (\autoref{config_install})

\item Populate the database with the Tracks 1.5 schema (\autoref{rake_install})

\item Start the server (\autoref{startserver_install})

\item Visit Tracks in a browser (\autoref{signup_install})

\item Customise Tracks (\autoref{customise_install})
\end{enumerate}

\subsection{Unzip Tracks and install}
\label{unzip_install}

Unzip the package and move Tracks into the directory you want to run it from. For example, for Mac OS X users, \texttt{\ensuremath{\sim}/Sites} is a good choice.


\subsection{Decide on a database}
\label{database_install}

Before you go any further, you need to decide which database you will use. See the What you need to install (\autoref{whatyouneed}) section for details on installing the required components for you choice of database.


\begin{enumerate}


\item \textbf{SQLite3}. All you need to do is make sure that you point Tracks to the included SQLite3 database in \texttt{/db} in the next step, Configure variables (\autoref{config_install}).

\item \textbf{MySQL}. Once you have MySQL installed, you need to create a database to use with Tracks 1.5. Go into a terminal and issue the following commands:
\end{enumerate}

\begin{adjustwidth}{2.5em}{2.5em}
\begin{verbatim}


    mysql -uroot -p
    mysql> CREATE DATABASE tracks15;
    mysql> GRANT ALL PRIVILEGES ON tracks15.* TO yourmysqluser@localhost \
    IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION;


\end{verbatim}
\end{adjustwidth}

\subsection{Configure variables}
\label{config_install}

\begin{enumerate}


\item If you downloaded Tracks 1.5 via Subversion, you need to duplicate the files \texttt{database.yml.tmpl} and \texttt{environment.yml.tmpl} and remove the \texttt{*.tmpl} extension from the duplicates. Similarly, duplicate \texttt{/log.tmpl} and remove the \texttt{*.tmpl} extension, then edit the files as described in steps 2 and 3.

\item Open the file \texttt{/config/database.yml} and edit the \texttt{production:} section with the details of your database. If you are using MySQL the \texttt{adapter:} line should read \texttt{adapter: mysql}, \texttt{host: localhost} (in the majority of cases), and your username and password should match those you assigned when you created the database. If you are using SQLite3, you should have only two lines under the production section: \texttt{adapter: sqlite3} and \texttt{database: db/tracks-15-blank.db}. If you downloaded the zipped file, the database.yml file is already configured to use the provided SQLite3 file.

\item Open the file \texttt{/config/environment.rb}, and read through the settings to make sure that they suit your setup. In most cases, all you need to change is the \texttt{SALT = "change-me"} line (change the string ``change-me" to some other string of your choice), and the time zone setting.

\item If you are using Windows, you may need to check the `shebang' lines (\texttt{\#!/usr/bin/env ruby}) of the \texttt{/public/dispatch.*} files and all the files in the \texttt{/script} directory. They are set to \texttt{\#!/usr/bin/env ruby} by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it to something like \texttt{\#c:/ruby/bin/ruby} to point to the Ruby binary on your system.
\end{enumerate}

\subsection{Populate your database with the Tracks 1.5 schema}
\label{rake_install}

Open a terminal and change into the root of your Tracks 1.5 directory. Enter the following command:


\texttt{rake db:migrate RAILS\_ENV=production}


This will update your database with the required schema for Tracks 1.5. If you are using SQLite3, it is not strictly necessary, because the SQLite3 database included with Tracks already has the schema included in it, but it should not do any harm to run the command (nothing will happen if it is up to date).


\subsection{Start the server}
\label{startserver_install}

While still in the Terminal inside the Tracks 1.5 root directory, issue the following command:


\texttt{script/server -e production}


If all goes well, you should see some text informing you that the Mongrel server is running: \texttt{** Mongrel available at 0.0.0.0:3000}. If you are already running other services on port 3000, you need to select a different port when running the server, using the \texttt{-p} option. You can stop the server again by the key combination Ctrl-C.


\subsection{Visit Tracks in a browser}
\label{signup_install}

Visit \texttt{http://0.0.0.0:3000/signup} in a browser (or whatever URL and port was reported when you started the server in the step above) and chose a user name and password for admin user. Once logged in as admin, you can add other (ordinary level) users.


\subsection{Customise Tracks}
\label{customise_install}

Once logged in, add some Contexts and Projects, and then go ahead and add your actions. You might also want to visit the Preferences page to edit various settings to your liking. Have fun!


\chapter{Upgrading to Tracks 1.5}
\label{upgrading}

\section{Upgrading from Tracks 1.043}
\label{upgrading_1043}

This should be a relatively straightforward, and involves the following main steps:


\begin{enumerate}


\item Back up (\autoref{backup_upgrade}) your existing database and installation of Tracks

\item Install Tracks 1.5 (\autoref{install_upgrade}) in a new directory

\item Copy over (\autoref{config_upgrade}) a few configuration files from your Tracks 1.043 directory. If using SQLite3, copy the old database into the new Tracks 1.5 directory

\item Run \texttt{rake db:migrate RAILS\_ENV=production} to update your old database (\autoref{rake_upgrade}) to the new schema -- you did back up your database didn't you?

\item Run \texttt{script/server} inside your Tracks 1.5 directory to start up Tracks 1.5 (\autoref{startserver_upgrade}).

\item Once you are happy that everything is working well, delete your old Tracks directory (\autoref{cleanup_upgrade}).
\end{enumerate}

\subsection{Backing up}
\label{backup_upgrade}

It's very important that you \textbf{back up your database} before you start the upgrade process. It's always possible for things to go wrong with the database update, and you don't want to lose any data. If you are using SQLite3 and you are leaving your old Tracks directory in place, then you don't need to do anything. However, there is no harm in taking extra precautions and copying your database from \texttt{/db} to a safe location as an extra backup, or making a dump of the schema and contents. You will never regret making too many backups! If you are using MySQL, make a SQL dump of your database, replacing the terms in square brackets with the correct information for your setup:


\texttt{mysqldump ---user [user name] ---password=[password] [database name] $>$ [dump file]}


Rename your old Tracks installation (e.g.\ to `tracks-old') so that you can install Tracks 1.5 along side it.


\subsection{Install Tracks 1.5}
\label{install_upgrade}

There are two methods of downloading Tracks 1.5:


\begin{enumerate}


\item (Recommended for most people) Download the \href{http://www.rousette.org.uk/projects/files/tracks-current.zip}{zipped package}, and unzip in your preferred location (e.g.\ \texttt{\ensuremath{\sim}/Sites} for Mac OS X users).

\item Download using Subversion:
\end{enumerate}

\begin{adjustwidth}{2.5em}{2.5em}
\begin{verbatim}


    svn co --username=guest \ 
    http://www.rousette.org.uk/svn/tracks-repos/tags/current tracks


\end{verbatim}
\end{adjustwidth}

\subsection{Copy over old configuration files}
\label{config_upgrade}

There are a few files you need to copy over from your old installation. If you copy them over rather than moving them, you can still run your old version of Tracks if anything goes awry with the installation process.


\begin{enumerate}


\item Copy \texttt{/config/database.yml} from your old Tracks directory to the same location in the new one. Double check that the information there is still correct.

\item Duplicate \texttt{/config/environment.rb.tmpl} in the Tracks 1.5 directory, and rename the file to \texttt{environment.rb}. Open the file and alter the line \texttt{SALT = "change-me"} so that it matches what you had in this file in your old installation. You may also want to change the time zone setting as appropriate for your location (\texttt{ENV['TZ'] = 'US/Eastern'}). If you have made any other customisations to \texttt{environment.rb} in the past, copy those over, but the contents of the file have changed quite a lot since 1.043, so check it carefully.

\item Copy your \texttt{/log} directory over from your old installation to the root of the new one, or just rename \texttt{/log.tmpl} to \texttt{log} to start afresh.

\item If you are using SQLite3, copy your database from \texttt{/db} in your old Tracks directory to the same location in the new one.

\item If you are using Windows, you may need to check the `shebang' lines (\texttt{\#!/usr/bin/env ruby})\footnote{The \texttt{env} binary helps to locate other binaries, regardless of their location. If you don't have \texttt{env} installed, you'll need to change this line to point to the location of your Ruby binary.The \texttt{env} binary helps to locate other binaries, regardless of their location. If you don't have \texttt{env} installed, you'll need to change this line to point to the location of your Ruby binary.} of the \texttt{/public/dispatch.*} files and all the files in the \texttt{/script} directory. They are set to \texttt{\#!/usr/bin/env ruby} by default. Check the format of those lines in your old installation, and change the new ones as necessary.
\end{enumerate}

\subsection{Update your old database to the new format}
\label{rake_upgrade}

In a terminal, change directories so that you are inside the Tracks 1.5 directory. Then issue the command:


\texttt{rake db:migrate RAILS\_ENV=production}


Watch the output carefully for errors, but it should report at the end of the process that everything worked OK. If you do get errors, you'll have to fix them before you proceed any further. Running rake with the \texttt{--trace} option can help to track down the problem.


\subsection{Start the server}
\label{startserver_upgrade}

If you're still in the Tracks 1.5 root directory in a terminal, enter the following command to start up Tracks in production mode:


\texttt{script/server -e production}


Visit the URL indicated by the output (e.g.\ \texttt{** Mongrel available at 0.0.0.0:3000}
) in a browser, and with any luck, you should be able to log in and find all your actions as you left them!


\subsection{Clean up your old installation}
\label{cleanup_upgrade}

Once you're certain that your new Tracks 1.5 installation is working perfectly, you can delete your old Tracks directory.


\section{Upgrading from versions prior to 1.043}
\label{upgradingfromversionspriorto1.043}

The best option for versions prior to 1.043 is to follow the instructions below to upgrade to version 1.043, then use the instructions above to upgrade from version 1.043 (\autoref{upgrading_1043}).


\begin{enumerate}


\item For safety, rename your current Tracks directory to `tracks-old' or something similar.

\item Before you do anything else, \textbf{BACK UP YOUR DATABASE} (tables and content) and keep the SQL dumps somewhere safe so that you can recreate the old database if necesary.

\item Download a copy of Tracks 1.043 and unzip alongside your `tracks-old' directory.

\item Open the file \texttt{config/environment.rb} and look at the last line which should read: \texttt{SALT = "change-me"}. Change the word change-me to something else of your choosing. This string will be used as a `salt' to encrypt your password and make it a bit more secure. Also look at the timezone setting at the bottom. You can leave it commented out if your server is in the same time zone as you, but you may need to adjust it if your server is in a different time zone.

\item In \texttt{database.yml} insert your old database name, user and password under the `development' section. If you are using SQLite3 rather than MySQL or PostgreSQL, you need only the database name, and to change the `adapter' line to `sqlite3'. You also need to copy (NOT MOVE!), your SQLite3 database from your tracks-old \texttt{db} directory to your new tracks \texttt{db} directory

\item Run the command \texttt{rake extract\_fixtures} inside the Tracks directory. This will populate the \texttt{db/exported\_fixtures} directory with \texttt{*.yml} files corresponding to the contexts, projects and todos table from the contents of your old database.

\item Open \texttt{db/exported\_fixtures/todos.yml} and search for the lines starting \texttt{created:} and replace with \texttt{created\_at:}. If you are using SQLite3, you also need to change the following: \texttt{done: "0"} with \texttt{done: "f"} and \texttt{done: "1"} with \texttt{done: "t"}. You need to replace the similar `done' lines in \texttt{projects.yml}, and in \texttt{contexts.yml} replace \texttt{hide: "0"} with \texttt{hide: "f"} and \texttt{hide: "1"} with \texttt{hide: "t"}.

\item Create a new MySQL database (named tracks1043, for example). In \texttt{database.yml} insert this new database name, user and password under the `development' and `production' sections. If you are using SQLite3, insert a new name for a database to hold your Tracks 1.043 data.

\item Run the command \texttt{rake db\_schema\_import} inside the Tracks directory. This should import the upgraded schema for 1.043 into your new database.

\item Run the command \texttt{rake load\_exported\_fixtures} which will import the contents of your old database from the fixtures files in \texttt{db/exported\_fixtures}.

\item If you are using Windows, you may need to check the `shebang' lines (\texttt{\#!/usr/bin/env ruby})\footnote{The \texttt{env} binary helps to locate other binaries, regardless of their location. If you don't have \texttt{env} installed, you'll need to change this line to point to the location of your Ruby binary.The \texttt{env} binary helps to locate other binaries, regardless of their location. If you don't have \texttt{env} installed, you'll need to change this line to point to the location of your Ruby binary.} of the \texttt{/public/dispatch.*} files and all the files in the \texttt{/script} directory. They are set to \texttt{\#!/usr/bin/env ruby} by default. Check the format of those lines in your old installation, and change the new ones as necessary.

\item Try starting up the server with \texttt{script/server} to make sure that all your data has migrated successfully. If all is well, follow the instructions above to upgrade from version 1.043 (\autoref{upgrading_1043}) to Tracks 1.5
\end{enumerate}

%
% Back Matter
%

\backmatter
%\appendixpage

%	Bibliography
\bibliographystyle{\mybibliostyle}
\bibliocommand

%	Glossary
\printglossary


%	Index
\printindex

\end{document}
