Customer Login



Recover Password

WorkOrder TS Support Database

 

Bookmark: Root \ Backup & Restore Guides \ Backup WorkOrder TS on a Linux server

Backup WorkOrder TS on a Linux server


Last Updated: 2009-03-26
NOTE, all backup and restore guides are currently being rewritten to explain the new backup feature in WorkOrder TS 0.6.1. Please allow a few days to complete the guides

WorkOrder TS backup can backup your information by directly executing commands on your server or if your server configuration does not allow this it can generate a backup script which you can execute locally.

The three backup modes supported by WorkOrder TS are
1) Create & download backup file (requires safe_mode off)
2) Create & store backup file locally (requires safe_mode off)
3) Create Batch file (Windows) or Create Bash file (Linux)


Mode 1 and 2 - Manual WorkOrder TS Backup via the web interface
If your host is configured to allow this you select a few options and click "Submit" to download a copy of your files. Keep in mind that most shared hosting companies do not allow you to backup this way because they run PHP in safe_mode.
The new version of WorkOrder TS backup has a lot of configuration options but the script attempts to detect the best default values for your installation, customizing the advanced backup options should not be required.

- Path to mysqldump only needs to be adjusted if MySQL is not in your path.
- Backup Type
* Complete Database - This will backup everything in your database, not just WorkOrder TS
* WorkOrder TS Tables Only - This will only backup tables used by WorkOrder TS
* with Uploads directory - This will backup your entire uploads directory.
* include config files - This will add your configuration files to the backup.
- Output Style
* File Download - The backup file will be offered to you as a download.
* Store Backup Locally - The file will be stored in the directory specified at the "Save Backup to Directory" option.
* Create Shell Script for Linux (Bash) - This creates a backup script, see QWERTY for details
- Backup Options - These are mysqldump specific options, you can click on each link for an explanation of what it does. Keep in mind that --extended-insert is not supported by the restoration script if you are running with PHP in safe_mode.
- Save Backup to Directory - Specifies the storage location if "Store Backup Locally" is selected or if you are creating a script.
- Working Directory - Is a directory with write permission, it is used to prepare the backup.
- Compression Options - Create a tar.bz2 or tar.gz backup file

Examples:
* Backup everything needed to restore WorkOrder TS and download the file
- Select "WorkOrder TS Tables Only", "with Uploads directory", "include config files" and "File Download". Click "Submit" to start the backup.



* Backup WorkOrder TS tables only and download the file
- Select "WorkOrder TS Tables Only" and "File Download". Click "Submit" to start the backup.


Mode 3 - Generate backup batch files and configure automated backups
This is the best way to backup WorkOrder TS because you can configure automated backups of the database, upload directory and configuration files.

WarningIf you select the option "WorkOrder TS Tables Only" you will create a backup script which has a list of all WorkOrder TS tables at the time of creating the backup script but will not backup tables a future WorkOrder TS release may create. A new backup script written in PHP will be released soon which will be able to refresh a list of tables. Until then, select "Complete Database" when creating backup scripts.

Creating a batch file is very simple, first select "Create Batch File for Windows" in the Output Style section.
Next specify where you would like to store your backup by entering a directory into the "Save Backup to Directory" field.
The option "Working Directory" and "Save Backup to Directory" can be changed to a directory outside of your web server's document root but this is optional.
Modifying the "Linux bash script cron job options" will not actually install the script as a cronjob but will generate the cron commands for you and write them to the top of the backup script.

The backup file created will be named: WorkOrder_TS-Backup-2009-03-16_1556.zip where
  • 2009-03-16 is the date in year-month-day format
  • 1556 is the time in 24hour format


Example Scenario:
I want to backup everything twice a day and store the backup in my main backup directory.
* I want my backups stored in /backups/workorder_ts
* I want the working directory to be /backups/temp
So I enter "/backups/workorder_ts" into the "Save Backup to Directory" field and enter "/backups/temp" into the "Working Directory" field. Next I click submit to generate and download the batch file.

I also want my backups to run at 23:00 (11:00pm) every day and receive notification emails. This can be enabled by checking "Enable "Successful Backup" notification E-Mail" and I enter my personal e-mail address into the E-Mail field.

Before configuring the automatic backup job the batch file should be tested to ensure that all the settings are correct.
Make sure the file is executable then run ./wots_backup to test the script. ( chmod u+x wots_backup will allow the user owning the file to execute it.)
Now goto the specified backup directory, /backups/workorder_ts in this example, and look for a file with a name similar to "WorkOrder_TS-Backup-2009-02-16_1525.tar.bz2".
Next validate the file by following the validation guide located QWERTY. Continue with this page once you are done.

Now that you know that the script is creating proper backups it is time to install it as a cronjob. Open the backup script with a text editor and follow the crontab instructions at the top of the backup script.
Example with wots_backup located in /backups/:
# WorkOrder TS Backup Script
# You can run this script manually or you can add it as a cronjob
# To add it as a cronjob, type (without #)
# crontab -e
# on the linux command line to open the cron job editor
# Paste the two lines below into the editor, replace SCRIPT/PATH with the real path, (without #)
# MAILTO="test@localhost"
# 0 23 * * 0-6 /backups/wots_backup

 

No Comments yet .....

 

Add Your Comment:

Note: All posts require administrator approval. Please allow 24 hours for message approval.

Name:
E-Mail:
Title
Plain text only, less then 65 000 characters.

What color do you get when you mix yellow with red?

Please answer the question above and type the answer into the text box below.