Update to v3.0

Existing CartUser buyers (v2.0 to v2.9) can upgrade in-place via admin panel. The update tool handles backup, file replacement, schema migration, and cache clearing automatically. No CLI required for standard updates.

Always backup before updating
The update tool creates a database backup automatically, but you should also back up files (especially kode/.env and uploaded media in assets/images/) just in case.

Method 1 โ€” Admin panel update (recommended)

What you'll need

Step-by-step

  1. Download the update ZIP from CodeCanyon โ†’ Your Items โ†’ Downloads โ†’ Update file.
  2. Log in to admin panel at https://yourdomain.com/admin.
  3. Navigate to System โ†’ System Updates.
  4. Click "Create Backup" first. This downloads a snapshot of your current files + database.
  5. Click "Upload Update File" and choose cartuser-update-v3.0.zip.
  6. Wait for the upload + processing screen (1-3 minutes). Don't close the browser tab.
  7. You'll see "System updated successfully to v3.0" when done.
  8. Log out and log back in to clear session cache.
  9. Verify โ€” Admin โ†’ Dashboard footer shows v3.0.
Screenshot ยท drop into documentation/screenshots/system_update.png

Admin โ†’ System โ†’ System Updates page.

What the update tool does (automatically)

  1. Validates ZIP โ€” checks file type, rejects ZIP containing .env or .htaccess (safety).
  2. Extracts to storage/app/public/temp_update/.
  3. Reads config.json from ZIP root to get target version.
  4. Version check โ€” only proceeds if uploaded version is newer than current.
  5. Creates database backup via db:backup โ†’ storage/app/backups/.
  6. Copies new files over your existing installation. Preserves .env, .htaccess, uploaded media.
  7. Regenerates composer autoloader โ€” picks up new classes.
  8. Runs schema:fix โ€” adds new columns/tables idempotently (safe to run anytime).
  9. Runs versioned migrations listed in config.json.migrations[3.0].
  10. Runs general migrate --force โ€” picks up any other pending migrations.
  11. Clears all caches โ€” view, config, route, optimize.
  12. Updates app_version setting to 3.0.
  13. Logs the update to update_logs table.

Method 2 โ€” Manual update (CLI)

If you prefer command line or admin panel update fails:

  1. SSH into your server and navigate to your CartUser folder.
  2. Backup database:
    cd /home/user/public_html/kode
    php artisan db:backup
  3. Backup files:
    cd /home/user/public_html
    tar -czf cartuser-files-backup-$(date +%Y%m%d).tar.gz kode/ assets/
  4. Extract the update ZIP locally:
    unzip cartuser-update-v3.0.zip -d /tmp/cartuser-v3
  5. Sync new files (excluding .env and user uploads):
    rsync -av \
        --exclude='.env' \
        --exclude='.htaccess' \
        --exclude='storage/logs/' \
        --exclude='storage/app/public/' \
        --exclude='bootstrap/cache/' \
        /tmp/cartuser-v3/ /home/user/public_html/
  6. Update autoloader + run migrations:
    cd /home/user/public_html/kode
    composer dump-autoload --no-dev --optimize
    php artisan schema:fix
    php artisan migrate --force
    php artisan optimize:clear
  7. Verify version:
    php artisan tinker --execute="echo site_settings('app_version');"
    Should output 3.0.

Post-update verification

Quick smoke test (from CLI)

cd /home/user/public_html/kode
php artisan tinker --execute="
foreach (['products','orders','update_logs','tutorials','campaign_enrollments'] as \$t) {
    echo \$t . ': ' . (Schema::hasTable(\$t) ? 'OK' : 'MISSING') . PHP_EOL;
}
foreach ([['orders','delivery_option'],['orders','currency_id'],['sellers','commission_rate']] as [\$t,\$c]) {
    echo \$t . '.' . \$c . ': ' . (Schema::hasColumn(\$t,\$c) ? 'OK' : 'MISSING') . PHP_EOL;
}
"

All should report OK.

Manual page checks

What's new in v3.0

See the full changelog. Highlights:

If update fails

Update tool shows error mid-process

Check kode/storage/logs/laravel.log for the actual error. Common causes:

Rolling back to v2.9

If something went wrong after update:

  1. Restore your file backup (the .tar.gz you made earlier)
  2. Restore database from storage/app/backups/cartuser_backup_YYYYMMDD_HHMMSS.sql:
    mysql -u username -p database_name < cartuser_backup_20260624_120000.sql
  3. Clear cache: php artisan optimize:clear

"Schema already exists" errors

Safe to ignore. The schema:fix command is idempotent โ€” it checks before adding columns/tables. Just rerun:

php artisan schema:fix
php artisan migrate --force

Updating mobile apps

v3.0 server changes are backward compatible with v2.9 mobile app builds (API endpoints unchanged). New API endpoints added in v3.0:

If you want to use these new features, rebuild your mobile app with the latest CartUser API integration code.