My Blog List


Tuesday, March 18, 2025

Upgrading In Out Management System to v6

 

Upgrading In Out Management System to v6





InOut is an attendance management system integrated with Koha. If you are using InOut v4 and want to upgrade to v6, follow this guide. If you are already on v5, you can skip the database migration steps.

Step 1: Remove Old PHP Version

To ensure compatibility with the latest InOut version, first remove PHP 7.* and install the latest PHP version.

sudo apt remove --purge php7.* -y
sudo rm -rf /etc/php/7.*
sudo apt autoremove -y
sudo apt autoclean

Step 2: Install Latest PHP Version

For Ubuntu 24.04 LTS, install PHP 8.3 along with required extensions:

sudo apt-get install -y git php libapache2-mod-php php-{bcmath,bz2,intl,gd,mbstring,mysql,zip}
sudo a2enmod php8.3
sudo systemctl reload apache2 && sudo systemctl restart apache2

Step 3: Remove Old InOut Version and Clone InOut v6 Repository

Navigate to the OPAC htdocs directory, delete the old InOut folder, and clone the latest InOut version.

cd /usr/share/koha/opac/htdocs/
sudo rm -rf inout
sudo git clone https://github.com/omkar2403/inout.git
sudo chmod 755 -R inout
sudo chown www-data:www-data -R inout

Step 4: Backup Database and Migrate (Only for v4 Users)

If upgrading from InOut v4, first take a backup of your database, if anything goes wrong, we can retain it.:

sudo su
mysqldump -ulibinout -plibinout123 libinout | xz > libinout-$(date +%d-%m-%Y-%H.%M).sql.xz

Then, update the database schema by executing the following SQL queries.

sudo MySQL -uroot -pyourmysqlrootpassword

Run these commands one by one in the MySQL shell:

USE libinout;

ALTER TABLE `inout` CHANGE `cardnumber` `cardnumber` VARCHAR(30) NOT NULL;
ALTER TABLE `inout` CHANGE `loc` `loc` VARCHAR(100) NOT NULL DEFAULT '';
ALTER TABLE `loc` CHANGE `loc` `loc` VARCHAR(100) NOT NULL;

CREATE TABLE `log` (
  `id` int(11) NOT NULL,
  `date` varchar(20) NOT NULL,
  `time` varchar(20) NOT NULL,
  `usertype` varchar(100) NOT NULL DEFAULT '',
  `userid` varchar(20) NOT NULL,
  `action` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `setup` (`var`, `value`)
VALUES
  ('banner', 'false'),
  ('activedash', 'quote');

Step 5: Update Database Credentials

Edit the dbconn.php file to reflect your database connection details.

sudo vim /usr/share/koha/opac/htdocs/inout/functions/dbconn.php

Update the following lines with your database details:

$database = "osmeinout";
$username = "osmeinout";
$password = "osme@123";

Your InOut system is now upgraded to v6 and should be fully functional. If you encounter any issues, check the logs and database connections for troubleshooting. Enjoy the new features of InOut v6!

Thanks to Omkar Kakeru for the awesome application and continued maintenance!

No comments:

Post a Comment