ALWAYS Back Up Before Upgrading

Before starting any upgrade, always create a full backup of your database and files. While the upgrade process is designed to be safe and non-destructive, having a backup ensures you can recover in case of unexpected issues (server crash during migration, disk full, etc.).

Table of Contents

  1. How Updates Work — What Changes and What Doesn't
  2. Your Data Is Safe — Detailed Guarantee
  3. Before You Start — Pre-Upgrade Checklist
  4. Method 1: Automatic Update (Recommended)
  5. Method 2: Manual Update via SSH
  6. Method 3: Artisan Upgrade Command
  7. What's New in v1.4.0 — Complete Change Summary
  8. Database Changes — Tables, Permissions, and Seeders
  9. Post-Upgrade Verification
  10. Rollback — How to Revert If Something Goes Wrong
  11. Version Upgrade Path — From Any Version
  12. Frequently Asked Questions

1. How Updates Work — What Changes and What Doesn't

Understanding what the upgrade process does is the key to feeling confident about it. Here's the complete picture:

What DOES Change (Code & Structure)

ComponentWhat HappensYour Data Affected?
PHP source codeAll app/, routes/, config/ files are replaced with the new versionNo — your data is in the database, not in PHP files
JavaScript / CSSAll resources/js/ and compiled public/build/ files are replacedNo — UI code doesn't store data
Database schemaNew tables are CREATED (never dropped). New columns are ADDED to existing tables (never removed)No — existing data is untouched
PermissionsNew permissions are ADDED. Existing permissions remain unchangedNo — your custom role assignments are preserved
SaaS PlansDefault plans are created if they don't exist. Existing plans are NOT overwrittenNo — if you already customized plans, they stay as-is

What Does NOT Change (Your Data)

Your DataStatusExplanation
Shipments100% SafeThe shipments table is never touched by migrations. All your tracking numbers, statuses, and history remain exactly as they are.
Clients / Customers100% SafeThe customers table is never modified. Names, addresses, phone numbers — all preserved.
Invoices100% SafeAll invoices, payments, and billing history remain in the invoices table unchanged.
Users & Passwords100% SafeUser accounts, hashed passwords, and profile data are never touched. Users can log in normally after the upgrade.
Settings / Configuration100% SafeThe settings table stores your company profile, branding, SMTP config, API keys, etc. This table is NEVER modified by migrations.
Branches100% SafeAll branch data (names, addresses, codes) remains unchanged.
Notification Channels100% SafeYour SMTP, Twilio, UltraMsg configurations in notification_channels are preserved. New channels are only added if they don't exist yet.
Uploaded Files100% SafeLogos, labels, attachments in storage/app/ are never deleted during upgrade.
.env File100% SafeYour environment configuration (database credentials, APP_KEY, mail settings) is never overwritten.
Custom Roles100% SafeIf you created custom roles, they remain. The seeder only updates the 5 default roles (super-admin, admin, employee, driver, customer).

2. Your Data Is Safe — Technical Explanation

Here's why your data is safe, from a technical perspective:

Migrations are Additive Only

Every migration in Deprixa Plus uses Schema::hasTable() checks before creating tables. If the table already exists, the migration is skipped entirely. There are zero DROP TABLE or TRUNCATE statements in any migration. New columns are added with Schema::table()->addColumn() — never by dropping and recreating.

Seeders use firstOrCreate / updateOrCreate

The RolesAndPermissionsSeeder uses Permission::firstOrCreate() — if a permission already exists, it's not duplicated. If you've modified a default role's permissions, your changes are preserved because the seeder only adds new permissions, it doesn't remove existing ones from roles.

Laravel Migration Tracking

Laravel tracks which migrations have already run in the migrations table. If you upgrade from v1.3.1 to v1.4.0, only the migrations that haven't run yet will execute. Migrations from v1.3.1 won't run again — Laravel knows they already completed.

Settings table is never seeded

Your company profile, branding colors, SMTP configuration, API keys — all stored in the settings table — are never touched by any migration or seeder. These are your custom data, and the upgrade process has no reason to modify them.

Think of it like a mobile app update

When you update WhatsApp on your phone, your chats don't disappear. The same principle applies here — the code (application logic, UI) is updated, but your data (stored in the database) remains exactly where it is.

3. Before You Start — Pre-Upgrade Checklist

Step 1: Create a Full Backup

This is the most important step. Create a backup of both your database and files.

Database Backup (via command line):

# Replace with your actual database credentials
mysqldump -u your_db_user -p your_database_name > backup_v1.3.1_$(date +%Y%m%d_%H%M%S).sql

# Verify the backup file was created and has content
ls -lh backup_v1.3.1_*.sql

Database Backup (via phpMyAdmin):

  1. Open phpMyAdmin in your browser
  2. Select your Deprixa Plus database
  3. Click "Export" tab
  4. Select format: SQL
  5. Click "Go" to download the .sql file
  6. Save this file in a safe location outside your server

Files Backup:

# Backup the entire application directory
cp -r /var/www/deprixa-plus /var/www/deprixa-plus-backup-v1.3.1

# Or create a compressed archive
tar -czf deprixa-plus-backup-v1.3.1.tar.gz /var/www/deprixa-plus

Critical Files to Preserve

Make sure your backup includes: .env (environment config), storage/app/ (uploaded files, logos, labels), and the database dump. These three contain all your custom data.

Step 2: Check System Requirements

Verify your server meets the requirements for the new version:

ComponentRequiredCheck Command
PHP8.2+php -v
MySQL8.0+ (or MariaDB 10.6+)mysql --version
Composer2.6+composer --version
Node.js20+ LTSnode -v
Disk SpaceAt least 500 MB freedf -h

Step 3: Note Your Current Version

# Check your current version
php artisan about | grep -i version

# Or check in the browser at:
# Settings → Updates → Current Version

Step 4: Inform Your Team

If other people use the system, let them know you're about to upgrade. The system will be in maintenance mode for 2-5 minutes during the upgrade. Active sessions will not be lost, but users won't be able to access the app during that window.

4. Method 1: Automatic Update (Recommended)

The easiest way to upgrade. Done entirely from the browser — no SSH or command line needed.

Step-by-Step:

  1. Log in as Super Admin
    Only Super Admin users can access the update module. Navigate to Settings → Updates.
  2. Activate Your License (if not already done)
    Enter your Envato Purchase Code and your name as registered on CodeCanyon. Click "Activate License". The system validates your purchase code against the license server.
  3. Check for Updates
    Click the "Check for Updates" button. If a new version is available, you'll see a banner with:
    • Current version vs. new version number
    • Download size
    • Summary of changes from the changelog
  4. Click "Apply Update"
    The system automatically:
    1. Downloads the update package from the update server
    2. Enables maintenance mode (users see a "Maintenance" page)
    3. Replaces application files (PHP, JS, CSS)
    4. Runs database migrations (creates new tables, adds new columns)
    5. Syncs permissions and SaaS plans via seeders
    6. Clears all caches
    7. Disables maintenance mode
  5. Verify
    The progress terminal shows each step in real time. When complete, the current version badge updates to the new version. Navigate around the app to confirm everything works.

The automatic update pre-compiles JS/CSS

The update package includes pre-compiled public/build/ files. You do NOT need to run npm install or npm run build when using the automatic update method.

5. Method 2: Manual Update via SSH

For users who prefer full control, or if the automatic update fails due to server restrictions (some shared hosts block exec() or proc_open()).

Step 1: Download the New Version

Download the latest version from CodeCanyon (your Envato Downloads page). You'll receive a ZIP file like deprixa-plus-v1.4.0.zip.

Step 2: Enable Maintenance Mode

cd /var/www/deprixa-plus
php artisan down --secret="upgrade-secret-token"

# You can still access the app via:
# https://yourdomain.com/upgrade-secret-token

Step 3: Replace Application Files

DO NOT Replace These Files/Folders

When extracting the ZIP, do NOT overwrite: .env, storage/app/, storage/logs/, storage/framework/sessions/. These contain your data and configuration.

Replace these directories with the new version:

# Extract the new version to a temporary directory
unzip deprixa-plus-v1.4.0.zip -d /tmp/deprixa-new

# Replace application code (preserving .env and storage)
rsync -av --exclude='.env' \
          --exclude='storage/app/' \
          --exclude='storage/logs/' \
          --exclude='storage/framework/sessions/' \
          --exclude='storage/framework/cache/' \
          /tmp/deprixa-new/ /var/www/deprixa-plus/

# Alternative: Replace folder by folder
cp -r /tmp/deprixa-new/app/ /var/www/deprixa-plus/app/
cp -r /tmp/deprixa-new/config/ /var/www/deprixa-plus/config/
cp -r /tmp/deprixa-new/database/ /var/www/deprixa-plus/database/
cp -r /tmp/deprixa-new/public/ /var/www/deprixa-plus/public/
cp -r /tmp/deprixa-new/resources/ /var/www/deprixa-plus/resources/
cp -r /tmp/deprixa-new/routes/ /var/www/deprixa-plus/routes/
cp /tmp/deprixa-new/composer.json /var/www/deprixa-plus/composer.json
cp /tmp/deprixa-new/composer.lock /var/www/deprixa-plus/composer.lock

Step 4: Install Dependencies

cd /var/www/deprixa-plus

# Install PHP dependencies
composer install --no-dev --optimize-autoloader

# If JS is NOT pre-compiled in public/build/, also run:
# npm install && npm run build

Step 5: Run Database Migrations

# Run pending migrations (creates new tables, adds columns)
php artisan migrate --force

# This is SAFE — it only runs migrations that haven't run yet
# Your existing data is NOT affected

Step 6: Sync Permissions and SaaS Plans

# Add new permissions to the system (does NOT remove existing ones)
php artisan db:seed --class=RolesAndPermissionsSeeder --force

# Add new SaaS plans (does NOT overwrite existing plans)
php artisan db:seed --class=SaasPlansSeeder --force

Step 7: Clear Caches and Optimize

# Clear all caches
php artisan optimize:clear

# Rebuild optimized cache
php artisan optimize

# Clear compiled views
php artisan view:clear

Step 8: Set Permissions and Go Live

# Fix file permissions (Linux)
chown -R www-data:www-data /var/www/deprixa-plus
chmod -R 755 /var/www/deprixa-plus/storage
chmod -R 755 /var/www/deprixa-plus/bootstrap/cache

# Disable maintenance mode
php artisan up

6. Method 3: Artisan Upgrade Command

Deprixa Plus includes a built-in upgrade command that automates steps 5-8 of the manual process. Use this after you've already replaced the files (steps 1-4).

# Run the complete upgrade sequence
php artisan deprixa:upgrade

This single command performs 6 automated steps:

StepActionWhat It Does
1Maintenance Mode ONPuts the app in maintenance mode with a secret token so you can still access it
2Run MigrationsExecutes php artisan migrate --force — creates new tables, adds new columns
3Sync PermissionsRuns RolesAndPermissionsSeeder — adds new permissions (102 total), updates default role assignments
4Sync SaaS PlansRuns SaasPlansSeeder — adds default SaaS plans (5 total) if they don't exist
5Clear & Rebuild CacheRuns optimize:clear + optimize — clears stale config, route, and view caches
6Maintenance Mode OFFBrings the app back online

After completion, the command outputs a summary table:

+------------------+---------------------+
| Component        | Status              |
+------------------+---------------------+
| Migrations       | Applied             |
| Permissions      | 102 synced          |
| SaaS Plans       | 5 synced            |
| Cache            | Cleared + rebuilt   |
| Maintenance      | Disabled            |
+------------------+---------------------+

Upgrade complete!

Force Mode

If the command asks for confirmation, use the --force flag: php artisan deprixa:upgrade --force. This is required when running in production environments.

7. What's New in v1.4.0 — Complete Change Summary

If you're upgrading from v1.3.x, here's everything that changed:

New Modules

Full SaaS Billing Engine

Complete multi-tenant subscription system with 5 plans (Free, Starter, Growth, Pro, Enterprise), wallet-based billing, auto-renewal, grace periods, and read-only enforcement. Subscription lifecycle: trial → active → grace_period → read_only → suspended.

Contracts Module

Create, edit, sign, and manage customer contracts. Attach files, link to rate cards, track expiration dates. Full CRUD with status workflow (draft → active → expired → cancelled).

Commissions Module

Configure commission rules (percentage or fixed) per user, branch, or zone. Automatic commission calculation on shipment creation. Approval and payment workflow for commission payouts.

New Payment Gateways

Paystack Integration

Accept payments via cards, bank transfers, USSD, and mobile money. Full webhook integration with HMAC SHA-512 verification. Popular in Africa (Nigeria, Ghana, South Africa, Kenya).

Stripe Improvements

Enhanced webhook signature verification, test mode support, and integration with the SaaS wallet recharge system.

New Notification Channel

UltraMsg WhatsApp API

Alternative to Twilio for WhatsApp notifications. Simple HTTP API, cheaper than Twilio. System prioritizes UltraMsg first, falls back to Twilio if UltraMsg fails. Notifications dispatched as background jobs with retry logic.

Permissions & Security

102 Permissions (was 97)

5 new SaaS permissions added: saas.billing.admin, saas.plans.manage, saas.subscriptions.manage, saas.wallets.manage, saas.invoices.manage. Plus new permissions for contracts and commissions modules.

API Keys Encrypted at Rest

All payment gateway credentials (Stripe, PayPal, Paystack) and notification channel tokens (Twilio, UltraMsg) are now encrypted using Laravel's Crypt::encryptString() before storing in the database.

Bug Fixes & Improvements

Responsive Design

Fixed all tables and forms for 1024x768 square monitors. Horizontal scroll on data tables, auto-collapsible sidebar, adaptive grid layouts on all 16+ pages.

Full Internationalization (i18n)

All hardcoded strings replaced with translation keys. Multi-language support via i18n JSON files. Currently includes English and Spanish.

Collapsible Sidebar Navigation

Parent menu items with children now expand/collapse properly. Collapsed mode shows hover popovers rendered via React Portal to prevent clipping issues.

Date Formatting

All dates now use the configured locale format via fmtDate() helper instead of raw ISO strings.

8. Database Changes — v1.3.x to v1.4.0

The database went from 79 tables to 80 tables. Here is exactly what was added:

New Tables Created

Table NamePurposeRecords Seeded
contractsCustomer contracts with rate cards, terms, signatures0 (empty)
commission_rulesCommission configuration per organization0 (empty)
commissionsIndividual commission transactions linked to shipments0 (empty)
saas_plansSubscription plan definitions with limits5 default plans
saas_subscriptionsOrganization subscription records with status lifecycle0 (empty)
saas_walletsOrganization wallet balance0 (empty)
saas_wallet_transactionsWallet credit/debit ledger0 (empty)
saas_invoicesSaaS billing invoices0 (empty)
notificationsLaravel DatabaseNotifications (UUID primary key)0 (empty)
personal_access_tokensExtended Sanctum API tokens with org scoping0 (empty)
integrationsThird-party service configurations0 (empty)

Important: All new tables are created with Schema::hasTable() checks — if the table already exists (e.g., from a partial previous upgrade), it is skipped safely.

Permissions Changes

CategoryNew Permissions
SaaS (5 new)saas.billing.admin, saas.plans.manage, saas.subscriptions.manage, saas.wallets.manage, saas.invoices.manage
Contracts (3 new)contracts.view, contracts.create, contracts.manage
Commissions (2 new)commissions.view, commissions.manage

These permissions are automatically added to the super-admin and admin roles by the seeder. Your custom roles will need to be manually updated if you want them to access the new modules.

Tables NOT Modified

The following tables are never touched during the upgrade — your data remains exactly as-is:

shipments, customers, invoices, invoice_items, users, settings, branches, services, rates, rate_zones, shipment_statuses, notification_channels, notification_rules, notification_logs, activity_log, organizations, and all other existing tables.

9. Post-Upgrade Verification Checklist

After upgrading, verify these items to confirm everything works correctly:

#CheckHow to Verify
1Login worksLog in with your admin account. Verify the dashboard loads correctly.
2Version number updatedGo to Settings → Updates. The current version should show the new version.
3Existing shipments visibleNavigate to Shipments. Verify your existing shipments are listed with correct data.
4Settings preservedGo to Settings → Company. Verify your company name, logo, and contact info are unchanged.
5Branding intactCheck your logo in the sidebar, primary color, and login page appearance.
6SMTP worksGo to Settings → Notifications. Send a test email to verify SMTP is still configured.
7Users can log inAsk a team member to log in with their existing credentials.
8New modules appearCheck the sidebar for new items: Contracts, Commissions (under Finance).
9Roles & PermissionsGo to Settings → Roles & Permissions. Verify new permissions appear (SaaS, Contracts, Commissions).
10Create a test shipmentCreate a new shipment to verify the full workflow still works end-to-end.

10. Rollback — How to Revert If Something Goes Wrong

If the upgrade causes issues, you can revert to the previous version using your backup:

Restore Files

# Put the app in maintenance mode
php artisan down

# Restore from backup
cp -r /var/www/deprixa-plus-backup-v1.3.1/* /var/www/deprixa-plus/

# Or extract from archive
tar -xzf deprixa-plus-backup-v1.3.1.tar.gz -C /var/www/

Restore Database

# Drop and recreate the database, then import
mysql -u your_db_user -p your_database_name < backup_v1.3.1_20260511.sql

Go Live

# Clear caches and bring the app online
php artisan optimize:clear
php artisan up

Data Created After Upgrade Will Be Lost

If you created new shipments, invoices, or users after the upgrade and then rollback, those new records will be lost because you're restoring a pre-upgrade database snapshot. This is why it's important to verify the upgrade works immediately — before creating new business data.

11. Version Upgrade Path — From Any Version

You can upgrade directly from any previous version to the latest. You do NOT need to install intermediate versions one by one.

From VersionTo VersionMethodNotes
v1.0.xv1.4.0Manual (Method 2) or AutomaticDirect upgrade. All intermediate migrations run automatically in sequence.
v1.1.xv1.4.0Manual or AutomaticDirect upgrade. Same process.
v1.2.xv1.4.0Manual or AutomaticDirect upgrade. Same process.
v1.3.0v1.4.0Manual or AutomaticDirect upgrade. Same process.
v1.3.1v1.4.0Manual or AutomaticDirect upgrade. Most common scenario for CodeCanyon buyers.
v1.3.2v1.4.0Manual or AutomaticDirect upgrade. Minimal changes needed.

Why Direct Upgrades Work

Laravel's migration system tracks every migration that has run in the migrations table. When you upgrade from v1.0 to v1.4, all 50+ migrations between those versions run in order. Each migration checks if the table/column already exists before creating it, so there are no duplicate errors.

12. Frequently Asked Questions

Will I lose my shipments?

No, absolutely not. Your shipments are stored in the shipments table in the database. The upgrade process never drops, truncates, or modifies this table. All your shipment records, tracking numbers, statuses, and history are 100% preserved.

Will my company settings be overwritten?

No. Your company name, logo, branding colors, SMTP configuration, API keys, and all other settings in the settings table are never touched by the upgrade process. No migration or seeder writes to the settings table.

Will my users' passwords change?

No. User accounts and hashed passwords in the users table are never modified. All users can log in with their existing credentials after the upgrade.

Will my custom roles be deleted?

No. The RolesAndPermissionsSeeder uses firstOrCreate — it only creates roles and permissions that don't exist yet. If you created custom roles (e.g., "Warehouse Manager"), they remain untouched. The seeder only updates the 5 default roles.

Do I need to re-configure Stripe/PayPal/SMTP after upgrading?

No. All your payment gateway and notification channel configurations are stored in the database and are not affected by the upgrade. Your API keys, webhook secrets, and SMTP credentials remain in place.

What if the upgrade fails halfway through?

The app will remain in maintenance mode. You can either: (a) Fix the issue and re-run php artisan deprixa:upgrade, or (b) Restore from your backup. Common causes of failure: insufficient disk space, MySQL timeout on large databases, or missing PHP extensions.

Do I need SSH access for the upgrade?

For Method 1 (Automatic) — No, it's done entirely from the browser. For Method 2 (Manual) and Method 3 (Command) — Yes, SSH access is required. If your host doesn't offer SSH, use Method 1.

How long does the upgrade take?

Typically 2-5 minutes depending on your server speed and database size. The maintenance window is brief — users will see a maintenance page during this time.

Do I need to run npm install or npm run build?

No. The update package includes pre-compiled JavaScript and CSS in the public/build/ directory. Node.js is not required on the production server for upgrades.

Can I skip versions? (e.g., v1.1 directly to v1.4)

Yes. You can upgrade directly from any version to the latest. Laravel's migration system runs all pending migrations in order. You do not need to install v1.2, then v1.3, then v1.4 — a single upgrade handles everything.

What happens to new modules I don't use?

New modules (Contracts, Commissions, SaaS Billing) are installed but empty. They appear in the sidebar only if the user's role has the corresponding permissions. If you don't need them, simply don't assign the permissions and they won't be visible to your team.

Will the upgrade change my .env file?

No. The .env file is never modified by the upgrade process. Your database credentials, APP_KEY, APP_URL, and all environment variables remain unchanged. However, the new version may support additional optional .env variables — check the changelog for details.

Need Help?

If you encounter any issues during the upgrade, contact support with: your current version, the error message, and a screenshot of the terminal output (if using SSH). Check the Changelog for the full list of changes in each version.