ShipWorks is installed with Microsoft SQL Express which includes a 10 GB (gigabyte) database limit. In the vast majority of cases this is more than enough database space. However, there may be times when you may wish to remove old data from the ShipWorks database in order to free up some database space. This article will guide you through how to create an action in ShipWorks that will:
- Backup the ShipWorks database at a scheduled time.
- Once the backup completes successfully, purge order data older than 180 days from the ShipWorks database.
If you are attempting to add the default Delete Old Data action, please see this article instead.
First Things First
Prior to creating the action you will need to be on ShipWorks version 3.7 or later. You can easily see what version of ShipWorks you are running by clicking on the Help tab and then on the About ShipWorks button. If you need assistance with upgrading your version of ShipWorks, please see this article. You will also need to be logged into ShipWorks as a user with administrator rights.
The Backup Task
1. In ShipWorks click on the Manage tab and then click the Actions button.
2. Click on the New Action button.
3. On the Action Editor screen, type a name for your Action into the Name field. For this example, we will name our filter Delete Old Data.
4. Next, let's set the schedule for when the action should run. For this example, we will set the action to run every night at 11PM.
Note: You can schedule the action to run at whatever time you wish. However, we recommend setting the action to run after normal business hours.
4a. Under When the following occurs, click the drop-down menu that says An order is downloaded and select A scheduled time.
4b. Click on the blue text One Time and select Daily.
4c. Set the schedule:
- Start: [current date] 11:00 pm
- End: Never
- Run Every: 1 day(s)
5. Next, let's tell the action what we need it to do. Click on the Add Task button and then select Backup the database.
6. Now, let's define the backup settings:
- Backup file name: Enter what you would like the backup file to be named. ShipWorks will automatically append the date and time that the backup was created to the name you enter.
- Backup folder: Click the Browse.. button. Then, navigate to the folder in which you would like the ShipWorks backups to be stored. We suggest a location other than a folder on the ShipWorks computer such as an external drive or network folder.
- Retention: By default, ShipWorks will save 5 successful backup files. Since you will be configuring ShipWorks to purge data from the database in the below steps, we suggest that you uncheck this box so that all historical data and backups are retained.
The Flow - Stop the Action if the Backup Fails
Next, we need to configure the Backup task so that if it fails the action will stop and not perform the database purge.
1. Click on the Flow... button located in the Backup the database task.
2. Locate the When an error occurs: drop-down and select Quit from the list of available options. Leave all other settings as they are and click OK.
The task should now look like this:
The Purge Task
The next step is to add the Purge old data task to the action. Here's how:
1. Click the Add Task button.
2. Select Delete old data from the list of available options.
3. The Delete data older than option allows you to specify how much historical data to keep in the ShipWorks database. The default value is 30 days worth of data. However, we suggest modifying this value to the number of days of historical data that best works for you. Typically, a value of 180 days is a good place to start.
Remember, entering 180 days means that data up to 180 days old will remain in the ShipWorks database while data older than 180 days will be purged. Again, enter the number of days that is best for your business.
4. Next, you will need to determine which data you wish to have deleted from the ShipWorks database. Here are the available options:
- Audit History - Selecting this setting will remove all audit history information from the ShipWorks database older than the Delete data older than setting you entered in Step 3.
- Email Content - Selecting this option will remove the email body from all emails sent from ShipWorks older than the Delete data older than setting you entered in Step 3. You will still be able to see if an email was sent, to whom, when and the subject line of the emails.
- Shipping Label Images - If you print labels in Standard format to a regular inkjet or laser printer, selecting this setting will delete only the label images stored in the ShipWorks database older than the Delete data older than setting you entered in Step 3. All shipment history, such as tracking numbers and shipment date, will be preserved.
- Print Job Content - Selecting this option deletes the print content older than the Delete data older than setting you entered in Step 3. The print history is preserved.
- Orders - Selecting this option will delete the orders, information associated to the orders such as emails, shipment details and print job details for orders older than the Delete data older than setting you entered in Step 3. The only thing that will remain is the audit data associated to the order, unless you also select the above Audit History option.
- If the last order belonging to a customer record is deleted during the purge, the customer record will also be deleted.
One thing to note is that if you are configuring an action to purge data in an effort to keep the overall database size at a minimum without deleting order information, we recommend setting the task so that it purges Email Content, Shipping Label Images, and Print Job Content older than 180 days. This is a good starting point and can be adjusted as needed.
If, however, you are considering purging unneeded order data from the ShipWorks database, please a look at our Order Retention Best Practices article for more information prior to selecting this option.
5. Lastly, select which options from the Options section you would like activated. We recommend:
- Stop if deletion takes longer than 6 hours.
- Reclaim disk space
The action should now, based upon the options you selected in the steps above, look like the below screenshot.
Run the Action Only on the ShipWorks Server
If you are running ShipWorks on more than one computer:
1. Click on the Settings link.
2. Then, select On specific computers: and ensure that only the ShipWorks server computer is selected.
Once you are finished configuring the action, click the OK button and then the Close button to exit the Action Manager.