The File Repository in SystemWeaver is used for file attachment functionality. You can create new empty file repositories to be used by a server installation or change the file repository format. The repository storage solution can be in one of two possible formats - database or file-based. Using the database format, the repository is stored in one big file. using the file-based format, it is stored using a file system in a custom file structure. Both options utilize a sqlite database type. 

Creating a File Repository Filing Structure

  1. Navigate out to the SystemWeaver installation and open the swDatabaseManager application.

  2. Click on the File Repository tab.

  3. For a database type repository, click on Create file repository (DB). Name the database in which the file repository will be stored and Save. The default extension is .sqlite.
  4. For a file-based type repository, click on Create File Repository (Files). Select the folder location that will contain the file repository structure. We advise that you select a new directory and not an existing one. A data directory will be created and an initial structure. 

You must never manually edit this structure or it's files. This may corrupt the file store. You can move the file store to another location by copying the entire directory including all it's subdirectories and files.

Configuring the Use of the File Repository

The use of a file repository is defined in the swServer.ini file. 

  1. Open the swServer.ini in a text editor like Notepad++. Example values shown below to the right of = on each line are meant to illustrate the format only:
  2. For FileRepositoryType, enter the type of file repository. Possible values are 'DB' or 'Files'. 
  3. For FileRepository, enter the file path to the file repository. If the FileRepositoryType is 'Files' the path should identify the folder under which the files will be stored. If the type is 'DB' the path defines the SQLite database file. (Currently SQLite is the only supported database file repository.)

Converting From Database to File-based

If you are using a database format for the file repository and want to switch to using a file-based file repository, you can do this by using the swDatabaseManager:
In the Convert from database to filebased section, select the original database formatted file repository be clicking Select database. You will be prompted to select the database. Next, specify where the new file-based repository should be located by clicking Select directory. You will be prompted to select the location of, and name of, the new directory where you want the repository copy to be placed.

After you have specified the old and new database locations respectively, you can click on Convert. This will start the process of copying the files from the original repository to the new repository. This may take a while. 

Note: It is always a good idea to create a copy of the original repository as an extra backup that you can easily revert to if something unexpected should happen.

File Repository Backups Using the swServerCommand Utility

If the file-based file repository is used, the backup file generated by the swServerCommand.exe utility will contain only the file index. It does not generate a backup of the files in the repository so this must be done separately. To get a backup index file in synch with the file repository itself, it is recommended that the backup of the file repository be performed at the same time. If not performed at the same time, a file repository backup from a later point of time will pose no real problem, other than that any files added to the repository after the backup index file was created will not be detected by the file index.

If a SQLite database-type file repository is used, the backup file will contain the entire file repository.

How to Back Up the Database provides more information on configuring the backup of the file repository.