# Upgrading the Search UI
![Search UI screenshot](images/metacatui-dataone-1000w.png)
## Updating the Search UI The production Search UI, search.dataone.org, is hosted on two machines, and all need to be upgraded individually:
search-ucsb-1.dataone.org
search-orc-1.dataone.org
For the DataONE test environments, all Search UIs are hosted on a single machine: - search.test.dataone.org
This machine is configured to host the following virtual hosts: - search-dev.test.dataone.org - search-dev-2.test.dataone.org - search-sandbox.test.dataone.org - search-sandbox-2.test.dataone.org - search-stage.test.dataone.org - search-stage-2.test.dataone.org
When upgrading the SearchUI software for each environment, it will be installed in the appropriate DocumentRoot configured for the virtual host.
## Upgrade steps - Scripted upgrade
Clone the metacatui-config repository to your home directory on the Search UI machine
`bash git clone https://github.nceas.ucsb.edu/walker/metacatui-config.git `
In the scripts directory, run the upgrade script
For production: Run the upgrade.sh script and send the MetacatUI version via the -v flag and the deployment name (dataone) via the -d flag.
`bash cd metacatui-config/scripts/ bash upgrade.sh -v 2.12.0 -d dataone `
For development environments: Run the upgrade-test-dataone.sh script and send the MetacatUI version via the -v flag. This script upgrades all of the test DataONE search UIs.
`bash cd metacatui-config/scripts bash upgrade-test-dataone.sh -v 2.12.0 `
## Upgrade steps - Manual upgrade
Download the latest version of MetacatUI from https://github.com/NCEAS/metacatui/releases
Unpack the .zip or .tar.gz file
`bash unzip metacatui-2.12.0.zip `
Backup the currently-installed Search UI files
`bash cp -rf /var/www/search.dataone.org . `
Open the ` metacatui-2.12.0/src/index.html` file in a text editor and change the appConfigPath variable towards the beginning of the HTML file to match the location where the DataONE MetacatUI theme config file will be deployed.
##### Production Config
For production, this will be in the themes directory included in MetacatUI:
##### Development Config
Config files for development environments are not released in the MetacatUI repository, but instead are maintained in a separate metacatui-config repository here: https://github.nceas.ucsb.edu/walker/metacatui-config
Each CN development environment will have a config file in that repository. Download the corresponding config file and deploy to the DocumentRoot configured for the virtual host. Set the appConfigPath to that root path:
See the MetacatUI documentation for more detailed instructions and for customization options: https://nceas.github.io/metacatui/
Move the new search UI files to the root directory where web files are served.
`bash cp -rf metacatui-2.12.0/src/* /var/www/search.dataone.org/ `
## Installing a new Search UI 1. Set up a VM and configure Apache to serve web files from a directory in /var/www/. Follow steps 1-5 above to install MetacatUI in the /var/www/ directory.
Add the FallbackResource Apache directive and allow encoded slashes:
See the MetacatUI Apache configuration documentation for further details: https://nceas.github.io/metacatui/install/apache.html
If having issues with CORS requests to the CN, configure Apache to proxy requests to DataONE CN API calls. Add the following Apache directives:
`apache SSLProxyEngine on ProxyPass "/cn/v2/" "https://cn.dataone.org/cn/v2/" ProxyPassReverse "/cn/v2/" "https://cn.dataone.org/cn/v2/" `
Enable these Apache mods:
`bash a2enmod proxy_http a2enmod proxy `