-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade
For XNAT 1.9x -> 1.10, this is required.
Note, with XNAT 1.10, the xnat.cfg file has changed to include xnat-data= to replace xnat-home, archive, postgresql mount points.
This is for upgrading the xnat-setup repo etc. It is only for major updates.
Warning: This will stop your current server. Backup everything! Please read the troubleshooting pages if you encounter and error, specifically database errors.
- Rename your xnat-setup directory to xnat-setup-backup.
- Backup using the save and restore script in the Linux directory. This will create a directory /path/to/xnat-setup/Linux/backup with all your current images and data. WARNING - this copies and compresses the entire archive - use with caution or edit the script before using. If you do not want to backup the entire archive comment out the line: tar -zcvf ./backup/xnat_home.tar.gz -C $xnat_home ..
- Run:
cd Linux
sudo ./save_and_restore.sh save
- Do not stop your current XNAT - settings are extracted from the existing XNAT and it needs to be running.
- Download the latest version of xnat-setup.
- Fill in the xnat.cfg file, based on your old xnat.cfg file, but enter the lastest XNAT version and compatible plugins. The Postgresql Password (psql_pwd) is taken from the running XNAT container, not xnat.cfg - you can leave this empty
- Make any custom changes to the docker-compose-stack.yml file (ports, cpu/memory, any additional custom mounts) - this should be similar to the docker-compose.yml file of your old installation. Do not change shared_memory / shm parts of the new docker-compose-stack.yml file.
- Make sure your plugins that are not listed in xnat.cfg are copied over to the new ./plugins directory.
- run:
cd Linux
sudo ./build.sh upgrade
A warning will appear, asking for confirmation. Make sure the warning contains UPGRADE else it may be building from scratch - although this will fail and not delete anything if the /xnat-data directory exists
XNAT should be upgraded. If not, please read the troubleshooting page
If you wish to only update individual docker base images of Nginx and Postgresql, download the script into the /xnat-setup/Linux directory:
You can then run the script - Warning! This will restart XNAT:
cd Linux
sudo ./update_iamges.sh
It will also update and upgrade software in the xnat-web container. It creates a nightly cron job to automatically update software in the container.
You may want to save the container to save the settings. This will replace your existing xnat docker image. You could save as xnat2, therefore keeping your original image. Then you'd need to update docker-compose.yml to select which docker image it uses. To get the container id:
docker ps
Then run:
docker commit [container id] xnat
If you wish to keep everything the same, but just update your xnat.war file, update your xnat.cfg file to the newest xnat version:
xnat_version=XXX
Read the release notes to ensure that you are able to update easily from your current version and that plugins are compatible (you may have to update your plugins).
Place this script in your Linux directory:
sudo cd Linux && ./update_xnat_war.sh
These instructions are effectively the contents of the automatic script.
Nginx upgrade:
You may wish to upgrade the nginx settings. All files are located in [path-to]/xnat-setup/nginx. Most importantly the files Dockerfile and xnat.conf
To upgrade nginx, ensure that the xnat.conf file is uptodate. Use this site to find the appropriate intermediate settings.
Edit the Dockerfile and change the nginx tag. This is the very first line in the format:
*FROM nginx:VERSION-alpine*
The xnat-setup script uses alpine image. Tags can be found https://hub.docker.com/_/nginx?tab=tags&page=1&ordering=last_updated
Then run:
cd `[path-to]/xnat-setup/nginx
docker build -t nginx-xnat1 .
Then restart docker:
cd [path-to]/xnat-setup/Linux
sudo ./restart.sh
Postgresql Upgrade:
The xnat-setup script basically uses the official postgresql Docker image. There are currently no modifications therefore you could change docker-compose.yml to use hte most uptodate postgresql 12 (only 12 supported) docker image or follow the instructions above and edit the file ./postgres/Dockerfile:
*FROM postgres:VERSION*
The tags are available on dockerhub
Then run:
cd `[path-to]/xnat-setup/postgres
docker build -t postgres-xnat .
Then restart docker:
cd [path-to]/xnat-setup/Linux
sudo ./restart.sh
You will have to update the postgresql settings by running the script ./postgres/set_postges_db:
cd [path to]/xnat-setup/postgres
sudo ./set_postgres_db.sh