Checking Files data integrity 

The appropriate way to restore backed-up Files data is to restore versions of file system data and database data that match. You can check integrity between database data (metadata) and file system data (binary) by running the FilesDataIntegrityService.checkFiles command.


Before you begin

To use administrative commands, use the wsadmin client. See Starting the wsadmin client for details.


About this task

The FilesDataIntegrityService.checkFiles command outputs messages to the SystemOut.log file. Any files found on the file system but not in the database are moved to a file path location you specify in the command. You might want to delete these extra files, or back them up if you think you might need them for a future Files backup.

The command also logs files that are in the database but missing from the file system. The log includes the location where the file should be, its type (such as media), and its file_id. Users cannot download files if they are missing from the database. You can use the log information to find the missing files if possible, or restore an older backup on which the command will run successfully. Alternately, you can delete the rows that own the file ids from the database, but be aware that this data is then irretrievable. You can also leave the mismatch and have it fail when users attempt to download.


Procedure

  1. Start the wsadmin client.

  2. Start the Files Jython script interpreter using the following command:

      execfile("filesAdmin.py")

  3. Check the integrity of data in the database and file system directory with the following command:

      FilesDataIntegrityService.checkFiles("/<path_to_extra_filesDirectory>")


Parent topic

Backing up Files data


Related tasks


Starting the wsadmin client

Related reference
Files administrative commands


   

 

Submitted by Pam Gilday on Jan 19, 2012 11:31:26 AM

Re: Checking Files data integrity

regarding the comment above -- the original steps 1 and 2 are still valid and wil be included in the wiki post refresh -- the

"Check the integrity of data in the database and file system directory with the following command:

On Windows -- FilesDataIntegrityService.checkFiles("C:\path_to_extra_filesDirectory")

On AIX or Linux -- FilesDataIntegrityService.checkFiles("/opt/path_to_extra_filesDirectory") "

statement is actually a revised step 3.

Submitted by Pam Gilday on Jan 19, 2012 11:22:54 AM

Re: Checking Files data integrity

revised topic to read as follows:

Checking Files data integrity

The appropriate way to restore backed-up Files data is to restore versions of file system data and database data that match. You can check integrity between database data (metadata) and file system data (binary) by running the FilesDataIntegrityService.checkFiles command.

Before you begin

To use administrative commands, use the wsadmin client. See Starting the wsadmin client for details.

About this task

The FilesDataIntegrityService.checkFiles command moves files found on the file system, but not in the database, to a file path location you specify in the command. You might want to delete these extra files, or back them up if you think you might need them for a future Files backup.

Users cannot download files if they are missing from the database.

Before running the FilesDataIntegrityService.checkFiles command, create the target path_to_extra_filesDirectory folder. This folder will be used to save unused files during the integrity check. Create the folder on the device from which you will run the command.

If you are running the command on Linux or AIX, ensure that you have correct write permissions enabled for the folder.

Procedure

Check the integrity of data in the database and file system directory with the following command:

On Windows -- FilesDataIntegrityService.checkFiles("C:\path_to_extra_filesDirectory")

On AIX or Linux -- FilesDataIntegrityService.checkFiles("/opt/path_to_extra_filesDirectory")

});