You are here

Updating the Database Backup Script

Subscribe to Syndicate
The following indicates how to install the backup script, or update an older version of the database backup script with a newer version and the key changes that need to be made.

The amount of time to implement the script is about 2 or 3 minutes using an editor and comparing lines in the old and new backup scripts.

OSX or Linux

Download the PHP script and edit it as follows

  • Find the line that says

    date_default_timezone_set('MST');

    and change MST to AST, EST, CST, or PST as per the instructions in the script right above this line in the script. Note that if you are running OSX 10.4.11, you will have to put a '#' in front of the statement to comment it out because that version of PHP does not support this command.

  • Change the line that has

    $backupDB = 'TheatreManagerDemo';

    so that the name of the database TheatreManagerDemo is replaced with your database name

  • Depending on the version of postgres you are running (8.4, 9.0, or 9.1) you will have to change the x.x in the line

    $postgresBin = '/Library/PostgreSQL/x.x/bin/';

    to $postgresBin = '/Library/PostgreSQL/9.1/bin/';

  • Compare the last two changes ($backupdb and $postgresBin) with your old script to make sure they are exactly the same
  • (optional step): If you keep fewer backups that the standard 30, look at the line that has

    $KeepFilesFor = 30;

    and replace the 30 with the number of days you want to keep backup files for.

  • (optional step): If you also FTP your database to an offsite location or another computer, find the line that has

    $ftpHost = '';

    and replace the $ftpHost, $ftpUser, $ftpPass, $ftpFolder, and $ftpDaysOldToPurge fields with the values from your old script

  • Replace your old script with the new one. If you are setting up the script for the first time, please follow these steps for OSX which tell you where to put the script and how to schedule it to run daily.
  • and run a test to make sure it creates a backup.

Windows

Download the BackupTM BAT and edit it as follows

  • Change the line that has

    set DATABASE_NAME=TheatreManagerDemo

    so that the name of the database TheatreManagerDemo is replaced with your database name

  • If you are still running version 8.4.x of postgres server, you will have to change part of the line

    set POSTGRESQL_PATH=C:\Program Files\PostgreSQL\9.1

    to

    set POSTGRESQL_PATH=C:\Program Files\PostgreSQL\8.4

    Note also, that if the database was placed on a D: or E: drive, you will have to change the drive prefix at the same time from C:

  • If you are running on a 64 bit server, you will have to change the line

    set POSTGRESQL_PATH=C:\Program Files\PostgreSQL\9.1

    to reference 'Program Files (x86)'

    set POSTGRESQL_PATH=C:\Program Files (x86)\PostgreSQL\9.1

    Note also, that if the database was placed on a D: or E: drive, you will have to change the drive prefix at the same time from C: and if you are running 8.4

  • Compare the last two changes (DATABASE_NAME and POSTGRESQL_PATH) with your old script to make sure they are exactly the same
  • (optional step): If your backup folder is on a different drive that the C: drive, look for the line

    set BOXOFFICE_DIR=C:\BoxOffice

    and replace the C: the same drive letter as your old script

  • (optional step): If you keep fewer backups that the standard 30, look at the line that has

    set KEEP_FILES_FOR=30

    and replace the 30 with the number of days you want to keep backup files for.

  • (optional step): If you also FTP your database to an offsite location or another computer, find the line that has

    set FTPSERVER=

    and replace the FTPSERVER, FTPUserName, and FTPPassword fields with the values from your old script

  • Replace your old script with the new one. If you are setting up the script for the first time, please follow these steps for Windows which tell you where to put the script and how to schedule it to run daily.
  • and run a test to make sure it creates a backup.