A set of Ruby scripts to report common problems with ArchivesSpace top containers in preparation for migration to version 1.5.x
- These scripts assume that you are using MySQL for your ArchivesSpace database. They will not work with the demo database distributed with ArchivesSpace.
- As these are Ruby scripts, you will need to have Ruby installed on the computer running the scripts (this does not need to be the same machine running ArchivesSpace or the database). Any relatively recent version of Ruby (1.9.x or later) should work.
- Clone or download this repository. Do not change the locations of the folders or files within the archivesspace_top_container_reports directory.
- From within the base directory (archivesspace_top_container_reports) run:
bundle install
That should be it.
The file config/config.yml is where you will specify the info required to connect to your database and to provide links to your ArchivesSpace instance in the generated reports. Each line of this file is a different configuration option. Some of these are optional and can be left out, but do not leave blank spaces between lines.
The reports will provide links to your ArchivesSpace instance based on the values provided here.
- archivesspace_host: The host name of the server where your ArchivesSpace instance is deployed.
- archivesspace_frontend_port: The port on which your ArchivesSpace front end (staff interface) is accessed (default is 8080)
- archivesspace_https: Set to true if ArchivesSpace is accessed via https
- mysql_host: The host name of the MySQL server
- mysql_database: The name of your ArchivesSpace database
- mysql_username: User with permissions to query the ArchivesSapce database
- mysql_password: Password associated with the MySQL user. If your database does not require a password for authentication you can remove this line and the scripts will attempt to connect without one.
- mysql_port: Port used to access the MySQL database. This is typically 3306 and will default to that if this line is omitted
- mysql_ssh: If the database server requires SSH connection, set this to true and provide values for the following parameters:
- mysql_ssh_username: SSH user name used to connect to the server (probably different than the database user name)
- mysql_ssh_password: Password associated with the SSH user
There are 4 reports available. Each must be run separately via the command line. The provided commands must be run from the base directory (archivesspace_top_container_reports). The generated reports are HTML files that will be saved to the reports/ directory.
Reports on top containers within the same resource or accession that have the same type and indicator values but different barcodes
To run:
ruby barcode_conflicts.rb
The report is organized by resource or accession, then by top container, then by barcodes associated with that top container, with links to each record where the association exists.
Reports on barcodes that are duplicated in multiple top containers.
To run:
ruby duplicate_barcodes.rb
The report is organized by barcode value, then by resource/accession, then by top containers within the resource/accession, with links to records associated with the container.
Reports on top containers within the same resource/accession that have the same indicator and type but different locations.
To run:
ruby location_conflicts.rb
The report is organized by resource/accession, then by top container, then by location, followed by links to records where the container/location association exists.
This one is actually a specialized version of the 'Location conflicts' report, but shows otherwise identical top containers in the same resource (by type and indicator) where some instances have an associated location and some do not.
To run:
ruby missing_locations.rb
The report is organized the same as the 'Location conflicts' report, but missing locations are listed as [ NULL ]