This article discusses the types of files that take up space on the FeneVision database server, and ways to save space on the server. The main users of storage space are:
- Databases and backups
- Order Attachments
- Machine Files
Databases
Backups
- By default, 3 days' worth of FeneVision databases are backed up to a local drive on your database server. These backups are a bare minimum safety net, and make it easier to send a backup to Support to reproduce issues. You should be storing more thorough database backups on a separate server offsite. Offsite backups are critical for restoring your operations in the event of a hardware failure or cybersecurity incident.
- Once you have a robust backup procedure and data recovery plan in place, consider reducing the number of backups the FeneVision Database Maintenance - Nightly SQL agent job creates to save space on your database server. The number of backups is controlled by the @CleanupTime parameter in the job, whose value is in hours.
- In SQL Server Management Studio, right click on this job and select Properties. In the DatabaseBackup - USER-DATABASES - FULL step, find the @CleanupTime parameter. The default value is 60, which in hours is more than 2 days, resulting in 3 backups being saved. Decrease this value to 48 or a bit under that for 2 backups. Do the same for the DatabaseBackup - SYSTEM-DATABASES - FULL step.
Test Databases
- The FeneVision Database Maintenance - Nightly SQL agent job backs up all databases with "FV" in the name. For example, that would include "MyFVMasterTest". Name these test databases something like "MyFenMasterTest" instead, to avoid wasting space for their backups. After renaming a test database in this fashion, don't forget to clean up its old backups.
- Are you done with the test database? Save one backup of the database as a precaution, then remove the restored database.
- Very old database backups found on the hard drive are likely no longer needed. Consider removing them once confirmed unnecessary.
Database Recovery Model (Simple vs. Full).
- Full causes the database to take up a lot more space over time. During initial server setup, the FeneVision databases (those with names prefixed by FV) are set to Simple Recovery.
- To view how your FeneVision database are set, open SQL Server Management Studio on your database server. Right click on a database in the object explorer under databases and select Properties from the popup menu. Select Options on the left side of the Database Properties dialog, and you will see the Recovery model value.
- If the Recovery Model is Full, make sure you are backing up your transaction log file on a regular basis so SQL will "release" the old logs. More than 30% of the database's size can come from old transaction logs that had never been backed up and truncated.
Order Attachments
- The setting that controls the order attachments directory is found in Core - Setup - System Settings on the Orders tab. Order and line item attachments can use a lot of space, so you might want to move them to another drive or server.
- Moving old order attachments only:
- Check your Order Attachments directory and see if you can move old order attachments to a separate drive. Order attachments usually contain images, so the space adds up over the years. You will need to move the order attachments back to the main drive if you want to manipulate an old order.
- Things to consider when moving all order attachments:
- Perform the move during off-hours so the data can be copied to the new location and the new Order Attachments directory setting can be updated at the same time.
Attribute scripts can access the order attachments directory, and need to be updated so that new orders place data in the new location. Search for these instances with this query, replacing your servername and your current path name:
USE [FVMaster]
SELECT * FROM Attributes
WHERE AttrExpression LIKE '%\\servername\FeneTech\orderattachments\%'Existing orders might have attributes that reference the old order attachments directory. If you want to be able to pull up attachments for old orders, they must be updated. The query below searches for the 200 most recent occurrences. If it returns nothing, then you do not need to do anything further.
USE [FVMaster]
SELECT TOP 200 * FROM OrderDetailAttributes
WHERE ParamValue2 LIKE '%\\servername\FeneTech\orderattachments\%'ORDER BY odkey DESC
- If the above query returns results, then you need to update the path using SQL queries. Replace your servername and paths in the query. This query may take a long time to run if you update all odkeys at once, another reason to do this process off-hours.
USE [FVMaster]
UPDATE oda SET ParamValue2 = REPLACE(ParamValue2, '\\servername\FeneTech\orderattachments\', '\\newservername\FeneTech\orderattachments\')
FROM OrderDetailAttributes oda
WHERE oda.ParamValue2 LIKE '\\servername\FeneTech\orderattachments\' - For glass customers, CAD export scripts and CAD parameters can access the order attachments directory. Review these items to and make corrections for the path, so that new orders place data in the new location.
Machine Files
- These are typically in a similar directory to the order attachments.
- Consider moving old machine files to a backup location.