This article describes how to set up and update a UVC-NVR if updating via the UniFi Video user interface is not working, which is the case if the NVR is on a very old version. The NVR has the singularity that when reset back to factory defaults, it will go back to the original firmware, sometimes going back to versions that are more than five years old. Because of this, depending on the version it goes back to, different upgrade processes must be followed. This article provides a script that will allow any NVR to be brought to the most current version possible.
NOTES & REQUIREMENTS:
The article is applicable for airVision-C, UVC-NVR, and UVC-NVR-2TB. Accessing the NVR via SSH will be needed during this article. To learn how to SSH into a device please take a look at this article: Intro to Networking - How to Establish a Connection Using SSH.
Table of Contents
When setting up an NVR for the first time, or after performing a factory reset, the NVR operating system should be updated, credentials secured, and the video software installed from scratch (rather than upgrading). The steps in the following section will guide you through that process. If you have not reset your NVR but it is still running an old version of UniFi Video, you may also use the scripts below, using the
non-destructive.sh script if possible. See step 5 of the following section to read about the three different options available.
WARNING: Please note that for older NVR versions, the scripts used (
non-destructive.sh script is only applicable to UniFi Video installations running v3.1.5 or above (excluding betas). It will attempt to perform all the actions of the previous scripts without "destroying" anything. Due to the many versions between 3.1.5 and current, there is a possibility that some data loss could take place, so it is strongly recommended to make a configuration backup for all versions (if the current UniFi Video install supports that), and to download any critical recordings prior to running the scripts.
Download any critical recordings and create a backup if the UniFi Video version supports that feature. See this article for options: UniFi Video - Backup Options and Best Practices. Each script gives a brief description of what users should expect, and the warning must be accepted before the script can continue.
How to Perform UVC-NVR Setup
1. SSH into the NVR using a CLI application (such as Command Prompt or Terminal, for example). Follow this article to learn how to make an SSH connection. Since the NVR has been reset to defaults (or is new) the username to be used for the SSH session will be root, and the default password will be ubnt. The IP address requested is the NVR's IP. There are several ways to find out the NVR's IP address which will vary, one way is to use the Ubiquiti Device Discovery Tool.
2. Download the correct firmware for the NVR by running the following command once the SSH session has been established. Hover and click on the Click to copy pop-up and then paste the command on the CLI application, hitting enter to run each of the following commands:
3. Check the MD5 checksum of the downloaded file by running the following command:
The output should be c9ef7f0a4dc772d04aaf4b0aebca125f.
4. Decompress the file by running the following command:
tar -xvf update_nvr.tar
5. There will now be 3 additional files:
for_latest.shUse this script on step 6 to upgrade to the latest UniFi Video version that has been released as stable (official current version). The version will vary depending on current release.
for_aircams.shUse this script on step 6 for deployments using airCams. The last version of UniFi Video to support airCams is v3.1.5 so, after all other packages are updated, 3.1.5 is downloaded and installed.
non-destructive.shUse this script on step 6 if the UniFi Video version on the NVR is equal to or greater than v3.1.5 and has a long-running system with managed cameras, recordings, etc. The script will attempt to update all of the essentials for the operating system as well as UniFi Video. Remember to make a configuration backup (if the current UniFi Video install supports it), and to download any critical recordings prior to running the script.
6. Run the
chmod 700 command followed by the appropriate .sh file from the three described above to make the script executable. Run only one of the following:
chmod 700 for_latest.sh
chmod 700 for_aircams.sh
chmod 700 non-destructive.sh
7. Run one of the following commands to execute the script, using the same .sh file used in step 6.
8. Read the warning and enter y to accept.
9. Wait while the process completes. This process can take more than thirty minutes depending on the script selected (
non-destructive.sh takes considerably longer) and the internet connection. If there is an error, a message will appear in the CLI application. If there is no error, let it continue running without interruption.
10. If there is an error, find the log in your system under /root/update.log and send it to email@example.com so they can troubleshoot what went wrong. Include the NVR version, and any other pertinent information.
11. If everything went well and UniFi Video is reachable at the URL provided in the script, and you are successfully logged in to the web interface, you may opt to remove all the files by running the following command:
rm for_latest.sh for_aircams.sh non-destructive.sh update_nvr.tar update.log
12. Exit the SSH session by typing out the following command and hitting enter: