# Update instructions

First rule: Always make a backup before updating an existing installation. There are several cases for updating:

1. Upgrading from a very old major version (1.1x, 1.2x, 1.3x)
2. Upgrading from the last major versions (1.4x and 1.5x)
3. Updating the sub version (1.5x to 1.5x)

## Upgrading from 1.3x or lower

There have been many changes to the internal structure of NagVis and the configuration values.
The recommended way for upgrading to the latest NagVis version is to set up the new version as new installation and migrate your maps/icons/configurations/... manually.

You should take a look at the following places:

- Maps (etc/maps)
  Just copy all map configuration files
- Background-Images (nagvis/images/maps)
  Just copy all map background images
- Iconsets (nagvis/images/iconsets)
  Just copy everything which is not named "std_*"
- Shapes (nagvis/images/shapes)
  Just copy everything
- Templates (nagvis/templates/hover and nagvis/templates/header)
  Just copy all your custom templates. Be aware: Don't replace the default templates.
  Maybe you need to update your pre 1.3 templates to 1.3 version. For more information take a look at the template download page.
- Template-Images (nagvis/images/templates/hover and nagvis/images/templates/header)
  Just copy everything
- Main configuration (etc/nagvis.inc.php)
  You should not copy that file. The best way is to copy the sample configuration of the new NagVis version to etc/nagvis.inc.php and merge the settings of your old installation manually to that file

## Updating from NagVis 1.4x

From NagVis 1.4x to NagVis 1.5x we changed a lot in the directory structure. But in the newest NagVis version there is an installer script included for installing NagVis. This script can also upgrade NagVis 1.4x versions and newer to the latest NagVis release.
So it is recommended to use this script (`install.sh`) distributed with the newest NagVis version to upgrade your installation.

The permission configuration changed with NagVis 1.5. So the installer removes the allowed_for_config and allowed_users parameters from the map configuration files. The permissions are not automatically re-added to the new permission database. The removed permissions are stored as dump in the nagvis/etc/auth-backup file. With this information you can re-apply the permissions to your maps using the new role based permission system.

It is possible to perform the 1.4x to 1.5x (or newer) update manually too but it has not been tested and documented by anyone. So if you like to update your installation manually you will need to do some research. Basically it should be the same as described above (copying custom files to the new locations and merging your settings into nagvis.ini.php. Don't copy this file!).

Once you made some experience in updating NagVis 1.4x to 1.5 or 1.6 manually please let us know so that we can extend this documentation.