AssetHub Upgrade Guide

Upgrade from AssetHub v1.0.0 to v2.0.0

This guide walks you through updating an existing production installation while keeping your database, uploaded files, and configuration intact. The v2 release is a non-breaking upgrade — your existing single-item assets continue to work exactly as before.

Applies to: v1.0.0 → v2.0.0 Estimated time: 10–20 minutes Main command: php artisan migrate

Overview

AssetHub v2.0.0 adds batch/lot asset tracking, operational reports, a disposals module, and a public QR handover page. None of these changes require a fresh install or data migration script.

Upgrade note: Existing v1 single-item assets are unchanged. After updating the application files, run php artisan migrate — no data loss when done correctly.
Item Action
Application code (app/, routes/, public/build/, etc.) Replace with v2 files
.env Keep your existing file
storage/ (uploads, logs, installed.lock) Keep your existing folder
MySQL database Keep — run incremental migrations only

Before you start

Always back up before upgrading any production system.

1. Back up your database

Export your MySQL database via phpMyAdmin, Adminer, or the command line:

mysqldump -u USERNAME -p DATABASE_NAME > assethub-backup.sql

2. Back up your files

  • .env — database credentials, mail settings, APP_KEY
  • storage/ — asset photos, avatars, company logo, logs
  • storage/app/public/ — all uploaded media

3. Put the site in maintenance mode (optional but recommended)

php artisan down
# ... perform upgrade ...
php artisan up

4. Download v2.0.0 from CodeCanyon

Go to your CodeCanyon Downloads page and download the latest AssetHub v2.0.0 ZIP. Extract the source/ folder on your computer.

Upgrade steps

Follow these steps in order. Do not re-run the web installer at /install.

Running on Hostinger Single? Skip the generic steps below and follow the dedicated Upgrading on Hostinger Single section. The Single plan has no Terminal or SSH — migrations are run via Cron Jobs in hPanel.
  1. Upload v2 application files

    Replace the application files on your server with the contents of the v2 source/ folder. On shared hosting (Hostinger, cPanel, Plesk), zip the source/ contents, upload to your web root (e.g. public_html/), and extract.

    Do not overwrite your existing .env or storage/ folder. If the upload overwrote them, restore from your backup.

    Files to keep from your v1 installation

    • .env
    • storage/ (entire folder, including installed.lock)
    • public/files symlink or folder (if present)
  2. Run database migrations

    Connect via SSH or your hosting terminal, navigate to your application root, and run:

    cd /path/to/your/public_html
    php artisan migrate --force

    Laravel will apply only the 5 new migrations that v2 adds on top of v1. Existing tables and data are not dropped or recreated.

    Important: Use php artisan migrate only. Never use migrate:fresh, migrate:refresh, or migrate --seed on a production database with live data.
  3. Clear and rebuild caches

    php artisan optimize:clear
    php artisan optimize

    This refreshes config, route, and view caches so v2 code runs correctly.

  4. Update permissions (if needed)

    v2 introduces two new permissions for the Disposals module. See the New permissions section below.

  5. Verify the upgrade

    • Log in as admin and confirm existing assets, users, and transactions are intact
    • Check the sidebar for new menu items (Batch assets, Disposals, new reports)
    • Test a QR code — v2 links to the public handover page at /a/{tag}
    • Confirm your cron job still runs php artisan schedule:run every minute

Upgrading on Hostinger Single

This section is for customers who already run AssetHub v1.0.0 on Hostinger Single Web Hosting (~$2.99/month). You do not need SSH, Composer, or a fresh install — your existing database, .env, and uploaded files stay in place.

No Terminal on Single? That is normal. On Hostinger Single, the Advanced menu shows PHP Configuration, Cron Jobs, GIT, etc. — but not Terminal or SSH Access. Use the Cron Jobs method in Step 4 below instead.
Do not visit /install after upgrading. The web installer runs migrate:fresh and will wipe your database. Use the Terminal commands below instead.

Step 1 — Back up via hPanel

  1. Login to Hostinger hPanelHosting → Manage for your domain.
  2. Database backup: go to Databases → phpMyAdmin → select your AssetHub database → tab Export → choose Quick → click Go. Save the .sql file to your computer.
  3. File backup: open Files → File Manager → navigate to public_html/.
  4. Enable Settings → Show hidden files so you can see .env.
  5. Download these to your computer:
    • .env
    • The entire storage/ folder (right-click → Compress → download the ZIP)

Step 2 — Check PHP version

  1. In hPanel, go to Advanced → PHP Configuration.
  2. Set PHP to 8.2 or 8.3.
  3. Confirm these extensions are enabled: OpenSSL, PDO, PDO_MySQL, Mbstring, GD, Tokenizer, XML, Ctype, JSON, Fileinfo.

Step 3 — Upload v2 files (keep your data)

  1. On your computer, extract the v2 CodeCanyon ZIP and zip the contents of the source/ folder (not the folder itself).
  2. In File Manager, open public_html/ — this is where your v1 AssetHub already lives.
  3. Upload assethub-v2.zip into public_html/.
  4. Right-click the ZIP → Extract. Allow files to overwrite when prompted (app/, public/, vendor/, etc.).
  5. Critical — restore protected files: if extraction overwrote them, re-upload your saved copies:
    • .env — keeps your DB credentials, mail settings, and APP_KEY
    • storage/ — keeps uploads, logs, and installed.lock
  6. Delete the uploaded ZIP file after extraction to save disk space.
  7. Verify public_html/ still contains artisan, .htaccess, and your storage/installed.lock file.
Tip: If you are unsure whether .env or storage/ were overwritten, always re-upload your backups from Step 1. Never use the default .env from the v2 package on a live site.

Step 4 — Run migrations (no Terminal needed)

Hostinger Single does not provide SSH or a web Terminal. The recommended way to run php artisan migrate is through a temporary Cron Job — the same tool you already use for scheduled email alerts.

Method A — Temporary Cron Job (recommended for Single)

  1. In hPanel, open Advanced → Cron Jobs.
  2. Click Create Cron Job.
  3. Type: Custom (not "PHP").
  4. Command — replace uXXXXXX with your Hostinger username (find the full path: File Manager → right-click artisanProperties):
    /usr/bin/php /home/uXXXXXX/public_html/artisan migrate --force
  5. Schedule: Every minute (* * * * *) — only for a short time.
  6. Click Save.
  7. Wait 1–2 minutes, then open storage/logs/laravel.log in File Manager or try logging in to AssetHub. If the site loads and v2 menus appear, migrations succeeded.
  8. Delete this temporary cron job immediately — you only need it to run once. Keep your existing schedule:run cron job untouched.

Optionally, create two more one-time cron jobs (same steps, delete after they run once):

/usr/bin/php /home/uXXXXXX/public_html/artisan optimize:clear
/usr/bin/php /home/uXXXXXX/public_html/artisan optimize
Expected result: After migrate --force runs, Laravel applies 5 new migrations (batch tracking, allocations, disposals). Running migrate again is safe — it will report "Nothing to migrate".

Method B — One-time PHP script (alternative)

If Cron Jobs are unavailable or you prefer a browser-based trigger:

  1. In File Manager, create a new file public_html/upgrade-migrate.php.
  2. Paste the script below. Change YOUR-SECRET-KEY-HERE to a long random string before saving.
  3. Visit https://yourdomain.com/upgrade-migrate.php?key=YOUR-SECRET-KEY-HERE once in your browser.
  4. You should see migration output ending with "Done".
  5. Delete upgrade-migrate.php immediately — leaving it on the server is a security risk.
<?php
// DELETE THIS FILE IMMEDIATELY AFTER USE
$secret = 'YOUR-SECRET-KEY-HERE';
if (($_GET['key'] ?? '') !== $secret) { http_response_code(403); exit('Forbidden'); }

define('LARAVEL_START', microtime(true));
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

Illuminate\Support\Facades\Artisan::call('migrate', ['--force' => true]);
echo Illuminate\Support\Facades\Artisan::output() . "\n";

Illuminate\Support\Facades\Artisan::call('optimize:clear');
echo Illuminate\Support\Facades\Artisan::output() . "\n";

Illuminate\Support\Facades\Artisan::call('optimize');
echo Illuminate\Support\Facades\Artisan::output() . "\n";

echo "Done. DELETE upgrade-migrate.php now.\n";

Method C — SSH / Terminal (Premium, Business, or VPS only)

If your plan includes SSH Access or a web Terminal (not available on Single), you can run commands directly:

cd ~/public_html
php artisan migrate --force
php artisan optimize:clear
php artisan optimize

Step 5 — Add new Disposals permissions

On Hostinger, the easiest safe option is to assign permissions through the admin UI (no Terminal needed):

  1. Login to AssetHub as Admin.
  2. Go to Users & Roles → edit the roles that need access to Disposals.
  3. Grant manage disposals and/or approve disposals.

Alternatively, if you have not customized role permissions and have SSH/Terminal access (Premium+), run:

php artisan db:seed --class=RolePermissionSeeder --force

See New permissions for details on the seeder caution.

Step 6 — Verify cron job (usually unchanged)

If you already set up a cron job during v1 installation, it should keep working after the upgrade. Confirm in hPanel:

  1. Go to Advanced → Cron Jobs.
  2. Find your existing entry — it should look like:
    /usr/bin/php /home/uXXXXXX/public_html/artisan schedule:run
  3. Check the Last run column after a few minutes. If empty, edit the job and verify the artisan path via File Manager → Properties.
  4. Schedule must be every minute (* * * * *).
Document root set to public_html/public/? Your Laravel code still lives at public_html/ root — the cron path remains /home/uXXXXXX/public_html/artisan (do not add /public/).

Step 7 — Test the upgrade

  • Open https://yourdomain.com and login — confirm existing assets, users, and transactions are intact.
  • Check the sidebar for new v2 items (Batch assets, Disposals, new reports).
  • Scan a QR code — v2 links to the public page at /a/{tag}.
  • Confirm uploaded images still display (avatars, asset photos).

Hostinger-specific notes

Uploaded images (/files/ not /storage/)

AssetHub serves uploads via public/files/ (symlink to storage/app/public/) because Hostinger Single may block /storage/* URLs via mod_security. If symlink creation fails, the app falls back to a PHP route — both work. Do not delete your storage/app/public/ folder during upgrade — that is where your images live.

"500 Internal Server Error" after upload

  • Confirm .htaccess exists at public_html/ root (enable Show hidden files).
  • Confirm PHP is 8.2 or 8.3 in hPanel (Advanced → PHP Configuration).
  • Run optimize:clear via a temporary Cron Job or the PHP script in Step 4.
  • Check storage/logs/laravel.log in File Manager for the exact error.
  • Set folder permissions: right-click storage/ and bootstrap/cache/Permissions755 recursively.

Where is Terminal / SSH?

Hostinger Single does not include them — your hPanel Advanced menu typically shows only: PHP Configuration, DNS Zone Editor, Cron Jobs, PHP Info, Cache, GIT, etc. This is expected. Use Method A (Cron Job) or Method B (PHP script) in Step 4. To get SSH, upgrade to Premium or Business, or contact Hostinger support.

QR scanner requires HTTPS

Enable free SSL in hPanel → SSL → Manage (Let's Encrypt). Camera access will not work over plain HTTP.

Hostinger Single upgrade checklist

  • Export database via phpMyAdmin
  • Download .env and storage/ from File Manager
  • Set PHP to 8.2 or 8.3
  • Upload and extract v2 ZIP into public_html/
  • Re-upload .env and storage/ if overwritten
  • Run migrate via temporary Cron Job (Step 4, Method A)
  • Run optimize via temporary Cron Job or PHP script
  • Assign Disposals permissions in admin UI
  • Verify cron job Last run timestamp
  • Login and confirm data + new v2 features
  • Do not visit /install

Database migrations

When you run php artisan migrate, Laravel applies these 5 new migrations (v1 installations that are already up to date will only run these):

Migration What it does
add_bulk_tracking_to_assets_table Adds tracking_type (default single), quantity (default 1), and unit columns. All existing v1 assets remain single-item records.
create_asset_allocations_table New table for batch/lot allocation tracking (assign, return, reconcile quantities).
add_quantity_to_transactions_table Adds a quantity column to transaction logs for batch moves.
create_disposal_batches_table New table for formal write-off batches (Q1–Q4, yearly, ad-hoc).
create_disposal_items_table New table for individual items within a disposal batch.

New permissions

v2.0.0 adds two permissions that are not created automatically by migrate alone:

  • manage disposals — create and edit disposal batches
  • approve disposals — approve or reject disposal batches (separation of duty)

Option A — Run the permission seeder (simplest)

If you have not customized role permissions, run:

php artisan db:seed --class=RolePermissionSeeder --force

This creates the new permissions and assigns them to the default roles (Admin gets all; IT Manager and Accountant get disposal management permissions).

Caution: The seeder uses syncPermissions, which resets each role to the default permission set. If you have customized role permissions, use Option B instead.

Option B — Assign manually (recommended if roles are customized)

Log in as Admin → Users & Roles → edit each role that should access Disposals → grant manage disposals and/or approve disposals as needed.

What's new in v2.0.0

After upgrading, these features become available without affecting your existing v1 data:

  • Batch / lot assets — track identical items by quantity (e.g. 10 chairs as one record); allocate, return, and reconcile in real time
  • 4 operational reports — Employee Assignments, Department/Location, Inventory Reconciliation, Damaged Assets (Excel + PDF)
  • Disposals module — formal write-off batches with separation-of-duty approval and printable minutes PDF
  • Public QR asset page at /a/{tag} — printable handover page with photo and quantity breakdown; visibility: public / login / disabled
  • Updated legacy reports — now show asset count + total units
  • QR codes — link to the public handover page; transaction log records quantity on batch moves

For full feature documentation, open documentation/index.html included in your v2 download package.

Do NOT do this

The following actions will erase or corrupt your production data. Avoid them during an upgrade:

Action Why it's dangerous
Visit /install again The web installer runs migrate:fresh, which drops all tables and recreates them empty.
Delete storage/installed.lock and reinstall Same result — triggers a fresh install that wipes the database.
php artisan migrate:fresh Drops every table and re-runs all migrations from scratch.
php artisan migrate --seed May insert demo/sample data into your production database.
Replace .env with the default v2 copy You'll lose DB credentials, mail config, and your APP_KEY (invalidating sessions).
Data loss warning: If you accidentally ran the installer or migrate:fresh, restore from your database backup immediately. There is no undo without a backup.

Quick checklist

Print or copy this list when performing the upgrade:

  • Back up MySQL database
  • Back up .env and storage/
  • Download AssetHub v2.0.0 from CodeCanyon
  • Upload v2 source/ files to server
  • Keep existing .env and storage/
  • Run php artisan migrate --force
  • Run php artisan optimize
  • Seed or assign new Disposals permissions
  • Log in and verify existing data + new features
  • Do not visit /install

Troubleshooting

Migration fails with "Nothing to migrate"

Your database may already be up to date, or migration files were not uploaded correctly. Verify that the v2 database/migrations/ folder contains the 5 new migration files listed above.

500 error after upload

php artisan optimize:clear
chmod -R 775 storage bootstrap/cache

Check storage/logs/laravel.log for the exact error message.

Disposals menu missing or "Unauthorized"

Run the permission seeder or manually assign manage disposals / approve disposals to the relevant roles. See New permissions.

Images or uploads not showing

Ensure your storage/ folder was not replaced. The app serves uploads from storage/app/public/ via the public/files symlink or fallback route.

Hostinger Single issues

See the Upgrading on Hostinger Single section for hPanel-specific fixes (500 errors, Terminal, cron path, /files/ uploads, SSL).

Need more help?

Open documentation/index.html in your v2 package for the full user guide (including the Hostinger fresh-install guide), or contact the author through the CodeCanyon item support tab.