The server only needs to be set up on one machine where you want the database to reside. Theatre Manager can be set up on as many machines as you wish.
|
Do not install virus software on the Postgres Server except under very controlled circumstances and never allow virus scanner to scan the actual postgres database directories. |
![]() |
When downloading any update for Theatre Manager, please make sure your personal firewall is turned on (PCI requirement 1.4) |
The server needs to be set up on one machine and the application can be set up on as many machines as you wish.
Follow these steps if you are using the TheatreManager TM PostGresSetup installer program and you may want to bookmark this page in your browser in case you want to refer to these installation steps. If you are only installing a demo, refer to the last column for required steps.
| task | Description | Full Install | Demo |
| 1 | If the server is OSX-LION (10.7.0 or later) and there are two drives in the computer (you will probably see two disk icons on the desktop or look in disk utilities), we strongly recommend STRIPING the two drives due to a very significant performance improvement. If you have this situation (very common in Mac Mini Servers), refer to this page to prepare the hardware and reinstall the operating system as Lion is not shipped with the drives striped.
The steps are similar for those using OSX 10.6.x or earlier - but you will have install DVD which makes is a bit easier. The process is similar. |
yes | no |
| 2 | download the PostGres installer for Mac | yes | yes |
| 3 | the installation of the PostGres SQL server | yes | yes |
| 4 | installing the demo database and the main TheatreManager User | optional | yes |
| 5 | configuration of the server parameters for maximizing performance in a production database | yes | no |
| 6 | creating a daily backup job in using cronnix to run the backup | yes | no |
| 7 | Turn off energy saving, airport and other energy saving features | yes | no |
|
The steps outlined are similar if you have a Mac Mini or Mac Pro running OSX 10.6.x or earlier. You will have and install DVD and can do most of the steps without connecting to the internet. |
The general process to prepare such as machine for optimal performance is:
The steps have a degree of technical complexity and assume you are able to interpret and adapt to variations in the process yourself.
Since Lion does not come with any install disks, you will need to follow a special procedure to stripe the drives on a lion servers as follows:
At the and of the TM PostGres file installation phase, the actual Postgres install process will begin immediately. If you cancel the setup of PostGres, you can always start it again by repeating the process from the start.
| 1. | Double click on the TMPostgresSetup application. You will be asked to authenticate the installation by OS-X. Please type the appropriate user id and password.
|
| 2. |
Click 'Continue' on the splash screen
|
| 3. |
Read the licence agreement and click 'Continue' to accept it.
|
| 4. | Click 'Agree' on this screen
|
| 5. | Click 'Install' on this screen.
|
| 5. | Click 'Install' on this screen.
|
| 6. | You will see the installer complete the work.
|
| 7. | When it is done, you will see a notice that postgres was installed. Click 'Continue'
|
| 8. | Click 'Quit' on this screen and restart the computer.
|
In most circumstances, you can skips this and the remainder of the steps if you are only installing a demo. If you are not, you will need to proceed to steps 3 and 4.
The database server needs a specific user called TheatreManager with specific privileges that will be assigned as the owner of each database. We also want to import a demo database. This step assumes that you have installed things into the /Users/Shared directory. If you did not, then you will need to edit the script and do this step manually
| 1. | Go to /Users/Shared directory. You should see some files and folders with names that look like below.
|
| 2. | Start terminal and change the user to 'postgres' by typing: su - postgres Press RETURN and then type the postgres user's password (password will not display anything)
|
| 3. | Drag the script '/Users/Shared/CreateDemoDB.sql onto the terminal window. This shortcut saves typing anything. Click into the terminal window and then press RETURN to start the command. If it does not run, then possible issues are:
![]() |
| 4. | The script will run and load up the TheatreManagerDemo database. You can modify this script to load up a customer database if necessary by editing it in BBedit or in textedit (make sure to save it as text if you use textedit - its preference, unfortunately, is to save as an rtf document). Note, any WARNING messages from the TheatreManagerDemo database creation can be ignored. These warnings are normal.
|
The general steps are:
This step is optional to do and is done for you automatically when you run the Theatre Manager postgres database installer
This step is done automatically for you if you have used the Theatre Manager postgres database installer and you have more than 2 gigs of ram on the sever
In order for clients to connect to the server, their IP address must be in the allowed list of users. The two common authentication methods that you will see being used for Theatre Manager clients are MD5 and trust.
| 1. |
The first changes to make involve the pg_hba.conf file and the postgres.conf file. To do so, you'll need to use VI (a text editor) and be the postgres user in terminal. To do this, start terminal and type
su - postgres enter the password
|
| 2. | Go to the postgres data directory by typing
cd data
|
| 3. | Edit the postgres pg_hba.conf file that contains the addresses to listen on. Type
VI pg_hba.conf You should see a page of information. If you do not, then type 'Shift Q' and then just a 'q' - after which you can start the process over. If you see the list of text similar to the right, then: Use the down arrow on your keyboard to go to the very end of the file
|
| 4. | ![]() When you are at the end of the file, use the up arrow on your keyboard so that you are right after the first line in the IPv4 settings there it says 'host all all 127.0.0.1/32 trust'. In the example the cursor is on the '#' on the line after. type the
key and the message at the bottom will change to Insert. |
| 5. | ![]() Edit the pg_hba.conf so that its final settings are similar to the window on the right. Type directly into Terminal so the data looks like the window above. Use the delete key to get rid of characters. You will likely end up typing the following lines where the first one is your subnet. This is the most typical example we've seen at venues NOTE: For the 127.0.0.1/32 option, edit the handshaking to be TRUST at the end of the line to allow backups to run unaided. NOTE: If your machine uses IPv6 (the new internet IP setting standard), you may also need to set ::1/128 to be TRUST instead of md5. If so, edit that line to look like:
NOTE: If you are running version 9.0 or higher of postgres in a Mac environment the local all all line should be set to TRUST. NOTE: You may also need to edit the local all all line from md5 to TRUST. This can be determined if the backup script will not run without a password after changing the settings above for 127.0.0.1 and ::1/128. The line you added (or need to add) are for:
At the end of the subnet, the /24 refers to a complete subnet when you want any machine on the subnet to access the database. This is what is used most often. The /32 refers to a particular machine. If you use this option, you will need to provide the exact computer IP that you want to allow to access the database. |
| 6. | ![]() At the end, type, in this order: hit the '' key (the insert mode will dissappear) (the window will show the 'Entering Ex mode' message) and the window will clear.
Reference for settings in the pg hba.conf file www.postgresql.org/docs/9.0/interactive/auth-pg-hba-conf.html |
| 1. |
You will need to start by changing to the postgres user in Terminal. To do this, start terminal and type
su - postgres enter the password
|
||||||||||||||||
| 2. | Go to the postgres data directory by typing
cd data
|
||||||||||||||||
| 3. | ![]() This will also use VI to edit it. Type when the list appears, type to go into insert mode and use the up and down arrows to find the options below
Find and edit the parameters in the list below and change them to the suggested values, if they are not already set to that value.
For any setting that is about disk space or memory, you can type 1GB, 1000MB, 1000000KB and they are the equivalent. Do not leave a space between the number and the memory amount at the GB, MB or KB otherwise postgres will not start. |
||||||||||||||||
| 4. |
Reference for postgres.conf file parameters http://www.postgresql.org/docs/9.0/interactive/runtime-config.html |
||||||||||||||||
| 5. | Once the changes are made, type, in this order:
hit the '' key (the insert mode will dissappear) (the window will show the 'Entering EX mode' message) and the window will clear and you will be back at terminal |
Otherwise, this step is not required under most circumstances.
| 1. | Start Terminal and navigate to the home directory for postgres user.
Type: cd /Library/PostgreSQL/9.1 |
| 2. | Next, lets update the profile for terminal to that it makes life easier in postgres from this point on. Type
it will open with an empty window as below.
Just like when using VI for the other two files, type: to put you in insert mode |
| 3. | ![]() Type the two lines into the file exactly as shown. When done, type, in this order: hit the '' key (the insert mode will dissappear) (the window will show the 'Entering Ex mode' message) and the window will clear and you will be back at terminal. The next time you start terminal under the postgres user account, you will have access to the postgres commands and data directory in a more convenient fashion. |
If you used the Theatre Manager postgres installer, it will detect if you have more than 2 gigs of ram in your machine and automatically insert these into the /etc/sysctl.conf file for you. After installing postgres the first time, simply reboot the server - these settings will have been done for you and you need not continue with the steps below.
BEFORE STARTING: Ensure you are in terminal at your own user, not postgres. This is a fairly technical topic and the reference: http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html
| 1. |
Open terminal again and type: su - [Your UserName] Type vi /etc/sysctl.confType I to insert data Add the lines: kern.sysv.shmmax=2202009600kern.sysv.shmmin=1 kern.sysv.shmmni=64 kern.sysv.shmseg=16 kern.sysv.semmns=130 kern.sysv.shmall=550502400 kern.sysv.maxproc=2048 kern.maxprocperuid=512 These settings reflect the maximum size of a shared buffer. These settings assume you are running at least 2GB of RAM. If you have less RAM, these settings may need to be altered. shmmax is the key setting; it is in bytes. If the machine has more memory to use, then this could be increased as well. shmall is the shmmax setting divided by 4. Hit the Esc key Hit Shift Q Type wq Hit Enter Restart OS X after doing this. This is required to apply the changes.
Restart OS X after doing this. This is required to apply the changes. |
However, it is perfectly ok to set up 2 or more daily backups while Theatre Manager is running. You may wish to do this on a high volume site and pick times like 8:00am, 1:30pm and 8:00pm, for example. Backups can run while Theatre Manager is being used.
You can also do a manual backup at any time by going into Terminal and running the 'backupTM.php' file mentioned in this section, even if Theatre Manager is running. You would do this using terminal on the server by typing
php /Users/Shared/backupTM.php
based on what you had already done to configure the script using the instructions below.
This backup process only exports data from the database and creates a compressed backup file. You will need to take those backups and copy them to another machine and/or establish a backup rotation and take some offsite.
| 1. | If you used the installer to place files into the correct location, you can skip to Step 2 in this section. If you did not, then you will need a copy of the backup script files and then:
|
| 2. | If the files are in the correct place because they were installed by the installer, then we will need to edit the backupTM.php file. Note, if you have multiple databases to backup, make a copy of this file for each database you want to backup and edit accordingly.
|
| 1. | ![]() Test the batch file by starting up terminal and typing the highlighted command
|
| 1. | Create a timed backup for the database by going to the /applications directory and starting a program called CronniX. A copy was installed by the PostGres Setup program. CronniX is shareware and can be found at www.abstracture.de/projects-en/cronnix
Only do this on the machine that has the database server on it and make sure you are logged on as the administrator. |
| 2. | Double click on the 'CronniX.app' icon (it may or may not have .app at the end). This will start the CronniX task Scheduler. On a side note, Cronnix is an interface to the Unix CRON facility. CRON has been around for a long time and is one of the task scheduling tools that is built into the unix operating system. You don't have to worry if it is on your system.... it just is.
Click the New icon on the upper left. It will open a new window with a sample script at the bottom that says: echo "Happy New Year!" Replace this with the same command used to start a backup in the preceding section. php /Users/Shared/backupTM.php Click on the expert tab and make the settings in the upper half of the screen as per the example. These settings adjust your backup schedule. For example if you want a daily 2am and 2pm backup:
This will effectively schedule two per day backup of your database and is the recommended backup schedule to setup. Entries for any of the items can be like:
Note: you can schedule backupTM to run as many times as you want during the day by changing the parameters of the one CRON job, or by creating more jobs. Once or twice per day is normally enough but you may feel that more times is better for your backup requirements on busy days. |
These steps are valid if you are using version 9 of Theatre Manager or later.
Download the latest postgres installer from the Artsman web site. Once you have it, make sure you have done the following steps:
|
Remember, do not attempt to try this unless you just made a backup of your database. Preferably, you should also have restored that backup on another machine for safety, logged into it using Theatre Manager to prove that you can restore a backup and that it has 100% integrity.
|
If you have postgres 9.0.x (or older), the upgrade process involves some extra steps and can be done by Arts Management Support team if you are not comfortable following the steps below. These are:
com.edb.launchd.postgresql-8.3.plist
com.edb.launchd.postgresql-8.4.plist
com.edb.launchd.postgresql-9.0.plist
Please delete those file and restart your machine. If you uninstalled the older servers properly, they should not be there. Do not delete the file corresponding to the current version of the server.
Make sure that postgres 9.1 is still running
The following settings should be made on all servers (postgres, apache and web listeners) that are installed on Macintosh.
| 1 | Make sure to turn off all energy saving options such as prevent hard disk sleep, do not allow the CPU to go into low processor mode, etc. |
| 2 | Make sure to turn airport OFF if the Mac comes with it. Airport will cause the mac to temporarily freeze while it looks for a network to connect to - and will lock out sales while it does that.
This is done by opening the control panel, clicking on the airport interface and then clicking on the 'gear' at the bottom to select the option 'make service inactive'. If you do this, the status will go from 'off' to 'inactive'
|
| 3 | Make sure to physically plug in a Monitor to the Mac -or- connect a KVM switch into it that is powered up. If you disconnect a monitor from the Mac, it will stop working as a listener and web sales appear frozen. (it is an OSX thing) |
| 4 | Turn off Spotlight Indexing on Snow Leopard using sudo mdutil -a -i off On Lion, use the following command sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist This will prevent the operating system doing un-neccessary work while serving web pages. you will know if Spotlight is running on a server if you see the 'mds' application running. It can take a lot of CPU. |
| 5 | Do not use the postgres server for Time Machine backups - use the backup script and move the backups to another machine |
The server needs to be set up on one machine and the application can be set up on as many machines as you wish.
Follow these steps if you are using the TheatreManager TM PostGresSetup installer program and you may want to bookmark this page in your browser in case you want to refer to these installation steps. If you are only installing a demo, refer to the last column for required steps.
| task | Description | Full Install | Demo |
| 1 | download the PostGres installer for Windows | yes | yes |
| 2 | the installation of the PostGreSQL server. Please make sure to read any caveats for the version of Windows you are using. | yes | yes |
| 3 | installing the demo database and the main Theatre Manager User | optional | |
| 4 | configuration of the server parameters for maximizing performance in a production database | yes | |
| 5 | creating a daily backup job in Windows Task Scheduler to run the backup | yes | |
| 6 | Considerations for installing virus protection on the Postgresql server - please do not include the posrgres data folder. | yes | |
| 7 | Turn off Microsoft disk indexing on the volume that the database is running on. | yes |
| Windows Small Business Server | For Windows Small Business Server, you MUST turn off 'disk quota' for all users prior to installing PostGres (and leave it off). Otherwise you may run out of space for the installer and any databases that get installed.
|
| VISTA or Windows 7 | For VISTA/Windows 7, you may need to turn off UAC (user access control) because it is acting as a server. You can run Theatre Manager on other workstations with UAC on. To turn UAC off for a server:
|
| DOMAIN CONTROLLER | If you want to run postgres on server that is acting as a DOMAIN CONTROLLER, you will need to:
|
| Microsoft Windows Server 2008 | If you are running Microsoft Windows Server 2008, the following steps should be followed when running the installation programs:
|
| XP, 2000, or 2003 | There are no known caveats with XP, 2000. With Windows 2003 server, you may need to refer to the the Microsoft Windows Server 2008 - depending on how your 2003 server is configured. |
When you run the installer for the database, accept all the defaults.
| Click OK | Right click on the TMPostgresSetup.exe application and use Run As to begin the install. Select a LOCAL administrator as the user ID to use for the install. If a checkbox that implies "Protect My Computer" or "Run with Restrictions" is available and enabled, uncheck the box to allow the installer to run with full install privileges.
|
| Click Next | ![]() |
| Click Next | ![]() |
| Click Next | ![]() |
| Click Next | The installer files and all the support files needed for the rest of the steps are put into a C:\BoxOffice directory.
Note: If you have multiple drives, you may want to install the database server on a larger data drive like D:\BoxOffice
|
| Click Next | ![]() |
| Click Yes | At the end of the TM PostGres installer, you are asked if you want to install the PostGreSQL database in the dialog (as in below).
If you say yes, follow the instructions to install postgres in the next section. Alternatively, you can install them later manually by:
![]() |
| Click Next | ![]() |
||||
| Click Next |
|
||||
| Click Next |
Accept the default for the ' Account Password' for the postgres user. However, if this is a demo. In that case, please pick a user password that you remember - we suggest 'Master'.
|
||||
| Click Next |
Leave the Port Number as 5432 (if you change the standard port, you will also have to change it in Theatre Manager login window) |
||||
| Click Next |
Leave both these settings as shown. |
||||
| Click Next | ![]() |
||||
| Click Next | You will need to wait for a bit while the database server is installed
|
||||
| Click Finish |
At this time, the database should have installed successfully and should be runnning. ![]() |
| Click Yes | ![]() |
| Wait | Wait while a DOS window pops up and shows the progress of the demo database being imported. Depending on the performance and RAM in your machine, this could take a few minutes to finish.
|
| When the DOS window closes, the database server is installed, and the TheatreManagerDemo database is imported. |
|
Only perform this step if you did not install the demo database when installing server. |
After the database server is installed, You need to create a specific user called TheatreManager and give them privileges. You also want to import a demo database. This step assumes that you have installed into C:\BoxOffice. If you did not, then you will need to edit the .bat files and do this step manually.
| 1. | Go to C:\BoxOffice directory. You will see some files and folders with names similar to below.
|
||
| 2. | Double click on the 'ImportDemo' bat file. This starts a DOS prompt and start the bat file running.
If you have altered the install directory, you will need to change the path name to point to the location that Postgres was installed in. Often, this is just changing the drive letter. |
||
| 3. | You are asked for the password to create the 'TheatreManager' user. Type the password you used for the installation of the database in the preceding section. If this is a demo database install, this may have been 'master' you used when installing the server.
|
||
| 4. | You are asked for the password to create a 'TheatreManagerDemo' database. Type the same password used above and elsewhere in the install instructions.
|
||
| 5. | You are asked again for the password to import data into the TheatreManagerDemo database. Type the same password again and you will see a lot of lines displayed to you after that point as the demo database is imported.
|
| 1. | Start the PG Admin III database management application. This is found using Start Menu->Programs->PostGresSQL-> PG Admin III.
If you get any helpful tips, click 'close' to get rid of them. |
||||||||||||||||||||||||||
| 2. | Click on the server for this machine and login. Use the password you created when installing the database server
|
||||||||||||||||||||||||||
| 3. | Click on the Databases line to begin the next step of configuration. | ||||||||||||||||||||||||||
| 4. | edit the pg_hba.conf file.
|
||||||||||||||||||||||||||
| 5. | Edit the postgesql.conf file
|
However, it is perfectly ok to repeat the steps below and set up 2 or more backups daily while Theatre Manager is running. You may wish to do this on a high volume site and pick times like 8:00am, 1:30pm and 8:00 pm, for example. Backups can run while Theatre Manager is being used.
You can also do a manual backup at any time by double clicking on the 'BackupTM.bat' file mentioned in this section - again, even if Theatre Manager is running. It is generally found in the C:\BoxOffice folder, although it may be on another drive on the database server. The location of this file is where you placed it using the instructions on the rest of this page.
This backup process only exports data from the database and creates a compressed backup file. You will need to take those backups and copy them to another machine and/or establish a backup rotation and take some offsite.
| 1. | If you used the installer to place files into the correct location, you can skip to step 2 in this section. If you did not, then you will need a copy of two files and then:
|
||||||||
| 2. | If the files are in the correct place, then we will need to edit the BackupTM.bat file. Note, if you have multiple databases to backup, make a one copy of this file for each database you want to backup and edit accordingly.
|
||||||||
| 3. | test the batch file by double clicking on the TMBackup.bat to see that it runs. You may be asked for a password. if so, enter it and you should see a bunch of feedback as the database is backed up. If you do have to enter a password, refer to #4 (below) When done and the DOS window closes, go to the C:\BoxOffice\Backups directory and see if there is a recent backup for your database. Note that there shold be some size to the database backup.. is should not be zero bytes. In this sample, we have the original demo and a backup made on 20070913 at 12:40:04 in the afternoon. There will be a new file here each time the backup is run.
|
||||||||
| 4 | If you entered a password to make the backups run, then you need to tell the postgres to allow 'Trust' permissions for the local machine so that backups will run un-aided. On XP, you may just need to provide trust access to 127.0.0.1/32. On Vista, you may need to provide 'trust' access to ::1/128 as well. Refer to the section on editing the pg_hba.conf. file |
| 1. | Create a timed backup for the database by going to Start->Settings->Control Panels->Scheduled Tasks. Only do this on the machine that has the database server on it. If you are using vista or do not have a 'classic' view of the task scheduler, then you may wish to change the control panel view to 'classic' mode. Somehow, this just seems easier to find things.
|
||||||||||||||||||
| 2. | Double click on the Scheduled Task icon to begin the setup process
|
|
you can schedule backupTM to run as many times as you want during the day by creating more jobs. |
These steps are valid if you are using version 9 of Theatre Manager or later.
Download the latest postgres installer from the Artsman web site. Once you have it, make sure you have done the following steps:
Remember, do not attempt to try this unless you just made a backup of your database. Preferably, you should also have restored that backup on another machine for safety, logged into it using Theatre Manager to prove that you can restore a backup and that it has 100% integrity.
If you have postgres 9.0.5 (or any earlier version), the upgrade process involves some extra steps and can be done by Arts Management Support team if you are not comfortable following the steps below. These are:
C:\Program Files\PostgreSQL
or
D:\Program Files\PostgreSQL (if there are two drives)
Leaving any of those on will affect performance of the server for the database
As of Oct, 2010, the current minimum acceptable version of Postgres is 8.4.4 (or later). Theatre Manager has been tested with version 9.0 and works with the bytea_encoding set to escape (see parameters in step 4).
The server needs to be set up on one machine and the application can be set up on as many machines as you wish.
Follow these steps and you may want to bookmark this page in your browser in case you want to refer to these installation steps. If you are only installing a demo, refer to the last column for required steps.
| task | Description | Full Install | Demo |
| 1 | download the PostGres installer for Linux from Postgresql.org | yes | yes |
| 2 | the installation of the PostGres SQL server | yes | yes |
| 3 | installing the demo database and the main TheatreManager User | optional | yes |
| 4 | configuration of the server parameters for maximizing performance in a production database | yes | |
| 5 | creating a daily backup job in using cronnix to run the backup | yes |
| 1. | Install the PostgreSQL application. |
The database server needs a specific user called TheatreManager with specific privileges that will be assigned as the owner of each database. We also want to import a demo database. This step assumes that you have installed things into the /Users/Shared directory. If you did not, then you will need to edit the script and do this step manually
| 1. | Go to /Users/Shared directory. You should see some files and folders with names that look like below.
|
| 2. | Start terminal and change the user to 'postgres' by typing: su - postgres Press RETURN and then type the postgres user's password (password will not display anything)
|
| 3. | Drag the script '/Users/Shared/CreateDemoDB.sql onto the terminal window. This shortcut saves typing anything. Click into the terminal window and then press RETURN to start the command. If it does not run, then possible issues are:
![]() |
| 4. | The script will run and load up the TheatreManagerDemo database. You can modify this script to load up a customer database if necessary by editing it in BBedit or in textedit (make sure to save it as text if you use textedit - its preference, unfortunately, is to save as an rtf document). Note, any WARNING messages from the TheatreManagerDemo database creation can be ignored. These warnings are normal.
|