Manual Updates on Linux Server
Manual Updates on Linux Server
Posted on : 07 Dec, 2024 | Last Update - 1 year ago
How to Update the Web-Based Inventory System on Linux Debian/Ubuntu Server
Updating the Web-Based Inventory System ensures that your application is equipped with the latest features, security patches, and bug fixes. Follow this guide to safely update the application on a Linux Debian/Ubuntu server.
Step 1: Backup Your Current Files and Database
Before updating, always create a backup to prevent data loss in case of errors:
# Backup files
sudo tar -czvf /backup/inventory_backup_$(date +%F).tar.gz /var/www/inventory
# Backup database
mysqldump -u inventory_user -p inventory_db > /backup/inventory_db_backup_$(date +%F).sql
Step 2: Download the Latest Version
Download the updated version of the application from the official repository:
# Navigate to a temporary directory
cd /tmp
# Download the latest version
wget https://github.com/YuukioFuyu/Inventaris-Barang/archive/refs/heads/main.zip
# Unzip the downloaded file
unzip main.zip
Step 3: Update Application Files
Replace the current application files with the new ones:
# Replace files
sudo rm -rf /var/www/inventory/*
sudo mv Inventaris-Barang-main/* /var/www/inventory/
# Set proper permissions
sudo chown -R www-data:www-data /var/www/inventory
sudo chmod -R 755 /var/www/inventory
Step 4: Check for Database Updates
If the update includes database changes, import the updated schema:
# Import database updates
mysql -u inventory_user -p inventory_db < /var/www/inventory/database/update.sql
Note: Ensure the "update.sql" file exists and is part of the update package.
Step 5: Test the Updated Application
Access your application through the browser to verify the update. Check for any errors and ensure the new features are working as expected.
# Test in browser
http://yourdomain.com
Cara Update Sistem Inventarisasi Barang Berbasis Web di Linux Debian/Ubuntu Server
Melakukan update pada Sistem Inventarisasi Barang Berbasis Web memastikan aplikasi Anda memiliki fitur terbaru, patch keamanan, dan perbaikan bug. Ikuti panduan ini untuk memperbarui aplikasi di server Linux Debian/Ubuntu dengan aman.
Langkah 1: Backup File dan Database Anda
Sebelum melakukan update, selalu buat cadangan untuk mencegah kehilangan data jika terjadi kesalahan:
# Backup file
sudo tar -czvf /backup/inventory_backup_$(date +%F).tar.gz /var/www/inventory
# Backup database
mysqldump -u inventory_user -p inventory_db > /backup/inventory_db_backup_$(date +%F).sql
Langkah 2: Unduh Versi Terbaru
Unduh versi terbaru aplikasi dari repository resmi:
# Masuk ke direktori sementara
cd /tmp
# Unduh versi terbaru
wget https://github.com/YuukioFuyu/Inventaris-Barang/archive/refs/heads/main.zip
# Ekstrak file yang diunduh
unzip main.zip
Langkah 3: Update File Aplikasi
Ganti file aplikasi saat ini dengan file baru:
# Ganti file
sudo rm -rf /var/www/inventory/*
sudo mv Inventaris-Barang-main/* /var/www/inventory/
# Atur izin file
sudo chown -R www-data:www-data /var/www/inventory
sudo chmod -R 755 /var/www/inventory
Langkah 4: Periksa Update Database
Jika update mencakup perubahan database, impor skema yang diperbarui:
# Impor update database
mysql -u inventory_user -p inventory_db < /var/www/inventory/database/update.sql
Catatan: Pastikan file "update.sql" tersedia dan merupakan bagian dari paket update.
Langkah 5: Uji Aplikasi yang Telah Diperbarui
Akses aplikasi melalui browser untuk memverifikasi update. Periksa apakah ada error dan pastikan fitur baru berfungsi sebagaimana mestinya.
# Uji di browser
http://yourdomain.com