{"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<p>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<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-ocs-ng-inventory-server-on-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup OCS NG Inventory Server on CentOS 7<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-ocs-ng-inventory-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install OCS-NG Inventory on CentOS 8<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Upgrading Existing OCS NG Server Installation on CentOS<\/h2>\n\n\n\n<p>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<p>The process involves:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Remove installed plugins<\/li>\n\n\n\n<li>back-up existing configs used by OCS<\/li>\n\n\n\n<li>download the latest OCS-NG Inventory server archive<\/li>\n\n\n\n<li>follow through the installation process of OCS-NG<\/li>\n\n\n\n<li>finally restore backed-up OCS configs and access your latest OCS-NG server.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"removing-installed-plugins\">Removing Installed Plugins<\/h3>\n\n\n\n<p>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&nbsp;<em><strong>Extensions<\/strong><\/em>&nbsp;-&gt;&nbsp;<em><strong>Extensions Manager<\/strong><\/em>, select the plugin(s) and click the&nbsp;<strong>X<\/strong>&nbsp;icon to delete the plugin(s).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1830\" height=\"277\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_plugins.png\" alt=\"\" class=\"wp-image-11806\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_plugins.png?v=1646470071 1830w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_plugins-768x116.png?v=1646470071 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_plugins-1536x232.png?v=1646470071 1536w\" sizes=\"(max-width: 1830px) 100vw, 1830px\" \/><\/figure>\n\n\n\n<p>Remove any plugin configurations in&nbsp;<code>\/etc\/ocsinventory-server\/plugins<\/code>&nbsp;as well.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"backup-existing-ocs-configs\">Backup Existing OCS Configs<\/h3>\n\n\n\n<p>Stop webserver service to prevent loss of data after bucking up OCS files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl stop httpd<\/code><\/pre>\n\n\n\n<p>The important files to be backed up for the update process are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>z-ocsinventory-server.conf<\/li>\n\n\n\n<li>zz-ocsinventory-restapi.conf<\/li>\n\n\n\n<li>ocsinventory-reports.conf<\/li>\n\n\n\n<li>dbconfig.inc.php<\/li>\n<\/ul>\n\n\n\n<p>Create a backup directory to make a copy of exesting OCS configaration files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/opt\/backup_ocs &amp;&amp; cd \/opt\/backup_ocs<\/code><\/pre>\n\n\n\n<p>The first three files mentioned above are located in<code>conf.d<\/code>&nbsp;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<pre class=\"wp-block-code\"><code>cp -r \/etc\/httpd\/conf.d \/opt\/backup_ocs<\/code><\/pre>\n\n\n\n<p>Make a backup of Database configs as well;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp \/usr\/share\/ocsinventory-reports\/ocsreports\/dbconfig.inc.php \/opt\/backup_ocs\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"backup-ocs-database\">Backup OCS Database<\/h3>\n\n\n\n<p>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<pre class=\"wp-block-code\"><code>mysqldump -u ocs -p &#91;ocsdb] &gt; \/opt\/backup_ocs\/ocsdbbackup.sql<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-the-existing-ocs-server-installation\">Update the existing OCS Server installation<\/h3>\n\n\n\n<p>Download the latest release of&nbsp;<a href=\"https:\/\/github.com\/OCSInventory-NG\/OCSInventory-ocsreports\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">OCS from Github.<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>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<p>Unpack the archive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xzf OCSNG_UNIX_SERVER-2.9.2.tar.gz <\/code><\/pre>\n\n\n\n<p>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&nbsp;<strong>ENTER<\/strong>&nbsp;to accept the defaults.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd OCSNG_UNIX_SERVER-2.9.2\nsh setup.sh <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"restore-backed-up-configuration\">Restore backed up configuration<\/h3>\n\n\n\n<p>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<pre class=\"wp-block-code\"><code>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<p>Remove installation script<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv  \/usr\/share\/ocsinventory-reports\/ocsreports\/install.php{,.remove}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"access-updated-ocs-ng-server\">Access updated OCS NG Server<\/h3>\n\n\n\n<p>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<pre class=\"wp-block-code\"><code>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<p>Start apache webserver<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start httpd<\/code><\/pre>\n\n\n\n<p>Access OCS web interface&nbsp;<a href=\"http:\/\/server-hostname-or-IP\/ocsreports\" target=\"_blank\">http:\/\/server-hostname-or-IP\/ocsreports<\/a>&nbsp;on the browser. <\/p>\n\n\n\n<p>If prompted to update the database on the web interface, proceed to update by clicking&nbsp;<strong>update<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1550\" height=\"208\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_upgrade-process.png\" alt=\"\" class=\"wp-image-11807\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_upgrade-process.png?v=1646470215 1550w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_upgrade-process-768x103.png?v=1646470215 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/ocs_upgrade-process-1536x206.png?v=1646470215 1536w\" sizes=\"(max-width: 1550px) 100vw, 1550px\" \/><\/figure>\n\n\n\n<p>This brings us to the end of our guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reference<\/h3>\n\n\n\n<p><a href=\"https:\/\/wiki.ocsinventory-ng.org\/03.Basic-documentation\/Updating-the-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">Updating OCS-NG Server<\/a><\/p>\n\n\n\n<p>Other tutorials<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-ocs-inventory-agent-on-debian-10-ubuntu-18-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install OCS Inventory Agent on Debian 10\/Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-ocs-ng-inventory-on-fedora-30-fedora-29\/\">Install OCS-NG Inventory on Fedora<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<\/p>\n","protected":false},"author":5,"featured_media":11497,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[4676,4677,4678,4675,4674],"class_list":["post-11805","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-how-to-upgrade-ocs-ng","tag-ocs-ng-upgrade","tag-ocs-server","tag-update-existing-ocs-server","tag-upgrade-ocs-server","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/11805"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=11805"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/11805\/revisions"}],"predecessor-version":[{"id":21599,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/11805\/revisions\/21599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/11497"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=11805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=11805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=11805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}