{"id":11805,"date":"2021-12-05T12:01:59","date_gmt":"2021-12-05T09:01:59","guid":{"rendered":"https:\/\/kifarunix.com\/?p=11805"},"modified":"2024-03-18T07:57:17","modified_gmt":"2024-03-18T04:57:17","slug":"upgrade-existing-ocs-ng-server-installation-on-centos","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/upgrade-existing-ocs-ng-server-installation-on-centos\/","title":{"rendered":"Upgrade Existing OCS NG Server Installation on CentOS"},"content":{"rendered":"\n
Follow through this tutorial to learn how to upgrade existing OCS NG server installation on CentOS 7\/CentOS 8. In our previous guides we covered how to install OCS-NG Inventory;<\/p>\n\n\n\n
Install and Setup OCS NG Inventory Server on CentOS 7<\/a><\/p>\n\n\n\n Install OCS-NG Inventory on CentOS 8<\/a><\/p>\n\n\n\n So if you have an earlier installation of OCS NG server it can be upgraded to the latest version. This guide will cover upgrade existing OCS NG server installation.<\/p>\n\n\n\n The process involves:<\/p>\n\n\n\n Before running the update\/installation its adviced to delete any existing plugins to avoid breaking of the update process. To delete a plugin navigate to Extensions<\/strong><\/em> -> Extensions Manager<\/strong><\/em>, select the plugin(s) and click the X<\/strong> icon to delete the plugin(s).<\/p>\n\n\n\n Remove any plugin configurations in Stop webserver service to prevent loss of data after bucking up OCS files:<\/p>\n\n\n\n The important files to be backed up for the update process are:<\/p>\n\n\n\n Create a backup directory to make a copy of exesting OCS configaration files.<\/p>\n\n\n\n The first three files mentioned above are located in Make a backup of Database configs as well;<\/p>\n\n\n\n Its a good practice to create a backup of OCS database incase the installation breaks or update gods bail on you.<\/p>\n\n\n\n Download the latest release of OCS from Github.<\/a><\/p>\n\n\n\n Unpack the archive:<\/p>\n\n\n\n Run the installation script and follow through the prompts to install latest version of OCS-NG inventory as covered on our previous installation guides. Press ENTER<\/strong> to accept the defaults.<\/p>\n\n\n\n Once the installation of latest OCS NG server is completed succesfully, restore the ocs configuration files that were backed up.<\/p>\n\n\n\n Remove installation script<\/p>\n\n\n\n First update\/set the proper permissions and ownership of OCS configuration files and adjust SELinux permissions on web server configuration files<\/p>\n\n\n\n Start apache webserver<\/p>\n\n\n\n Access OCS web interface http:\/\/server-hostname-or-IP\/ocsreports<\/a> on the browser. <\/p>\n\n\n\n If prompted to update the database on the web interface, proceed to update by clicking update<\/strong>.<\/p>\n\n\n\n This brings us to the end of our guide.<\/p>\n\n\n\n Updating OCS-NG Server<\/a><\/p>\n\n\n\n Other tutorials<\/p>\n\n\n\n Install OCS Inventory Agent on Debian 10\/Ubuntu 18.04<\/a><\/p>\n\n\n\nUpgrading Existing OCS NG Server Installation on CentOS<\/h2>\n\n\n\n
\n
Removing Installed Plugins<\/h3>\n\n\n\n
<\/figure>\n\n\n\n
\/etc\/ocsinventory-server\/plugins<\/code> as well.<\/p>\n\n\n\n
Backup Existing OCS Configs<\/h3>\n\n\n\n
systemctl stop httpd<\/code><\/pre>\n\n\n\n
\n
mkdir \/opt\/backup_ocs && cd \/opt\/backup_ocs<\/code><\/pre>\n\n\n\n
conf.d<\/code> directory of Apache webserver root configuration directory. Lets create a back up of the directory incase of any additional configurations done;<\/p>\n\n\n\n
cp -r \/etc\/httpd\/conf.d \/opt\/backup_ocs<\/code><\/pre>\n\n\n\n
cp \/usr\/share\/ocsinventory-reports\/ocsreports\/dbconfig.inc.php \/opt\/backup_ocs\/<\/code><\/pre>\n\n\n\n
Backup OCS Database<\/h3>\n\n\n\n
mysqldump -u ocs -p [ocsdb] > \/opt\/backup_ocs\/ocsdbbackup.sql<\/code><\/pre>\n\n\n\n
Update the existing OCS Server installation<\/h3>\n\n\n\n
wget https:\/\/github.com\/OCSInventory-NG\/OCSInventory-ocsreports\/releases\/download\/2.9.2\/OCSNG_UNIX_SERVER-2.9.2.tar.gz<\/code><\/pre>\n\n\n\n
tar xzf OCSNG_UNIX_SERVER-2.9.2.tar.gz <\/code><\/pre>\n\n\n\n
cd OCSNG_UNIX_SERVER-2.9.2\nsh setup.sh <\/code><\/pre>\n\n\n\n
Restore backed up configuration<\/h3>\n\n\n\n
mv \/etc\/httpd\/conf.d{,.clninstall}\ncp -r \/opt\/backup_ocs\/conf.d\/ \/etc\/httpd\/\nmv \/usr\/share\/ocsinventory-reports\/ocsreports\/dbconfig.inc.php{,.orig}\ncp \/opt\/backup_ocs\/dbconfig.inc.php \/usr\/share\/ocsinventory-reports\/ocsreports\/<\/code><\/pre>\n\n\n\n
mv \/usr\/share\/ocsinventory-reports\/ocsreports\/install.php{,.remove}<\/code><\/pre>\n\n\n\n
Access updated OCS NG Server<\/h3>\n\n\n\n
chmod -R 766 \/usr\/share\/ocsinventory-reports\nchown -R apache:apache \/usr\/share\/ocsinventory-reports\nchown -R apache:apache \/var\/lib\/ocsinventory-reports\nchcon -R -t httpd_sys_rw_content_t \/usr\/share\/ocsinventory-reports<\/code><\/pre>\n\n\n\n
systemctl start httpd<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
Reference<\/h3>\n\n\n\n