Upgrade Guide
This guide covers how to update Open Core Business Suite to a new version. Since this is a source-code product, upgrades involve replacing application files with the new release and running a few commands to apply database changes.
Always create a full backup of your database and files before upgrading. See Step 1 below.
Upgrade Overview
Upgrading consists of four main steps:
- Back up your database and files
- Replace application files with the new release
- Run database migrations and clear caches
- Verify the upgrade
Step 1: Backup Your System
Database Backup
Via command line (SSH):
mysqldump -u your_db_user -p your_database_name > backup_$(date +%Y%m%d_%H%M%S).sql
Via cPanel:
- Open phpMyAdmin from cPanel
- Select your database
- Click Export and choose Quick export method
- Click Go to download the SQL file
Via System Backup Module:
If you have the System Backup module enabled:
- Navigate to System Backup in the admin panel
- Create a new backup that includes the database
- Download the backup file to your local machine
File Backup
Back up your entire application directory:
# VPS / Dedicated Server
cd /var/www
tar -czf html_backup_$(date +%Y%m%d).tar.gz html/
Via cPanel:
- Open File Manager
- Navigate to your application directory
- Select all files and click Compress
- Download the resulting archive
Critical Files to Preserve
Before replacing files, save copies of these files separately -- they contain your custom configuration:
| File | Purpose |
|---|---|
.env | Environment configuration (database credentials, keys, etc.) |
modules_statuses.json | Which modules are enabled/disabled |
storage/ | Uploaded files, logs, and cached data |
public/storage | Symbolic link to storage (may need recreation) |
Step 2: Replace Application Files
Download the New Release
Download the latest release package from your purchase dashboard on czappstudio.com.
Replace Files
VPS / Dedicated Server (SSH):
cd /var/www
# Extract the new release to a temporary directory
unzip opencorebs-v*.zip -d html_new/
# Preserve your environment file
cp html/.env html_new/.env
# Preserve your module statuses
cp html/modules_statuses.json html_new/modules_statuses.json
# Preserve uploaded files
cp -r html/storage/app html_new/storage/app
# Rename directories
mv html html_old
mv html_new html
cPanel / Shared Hosting:
- In File Manager, rename your current application folder (e.g.,
public_htmltopublic_html_old) - Upload and extract the new release ZIP to the original location
- Copy your
.envfile from the old folder to the new folder - Copy
modules_statuses.jsonfrom the old folder to the new folder - Copy the
storage/appfolder from the old folder to the new folder (this contains your uploaded files)
Do not overwrite .env or modules_statuses.json with the files from the new release. Your existing files contain your database credentials and module configuration.
Step 3: Run Post-Update Commands
Install Dependencies
If the release does not include the vendor directory, run Composer:
composer install --no-dev --optimize-autoloader --ignore-platform-reqs
Run Database Migrations
This applies any new database changes from the update:
# Run core migrations
php artisan migrate --force
# Run module migrations for all active modules
php artisan module:migrate --force
The --force flag is required to run migrations in a production environment.
Clear All Caches
php artisan optimize:clear
This clears the configuration cache, route cache, view cache, and compiled files. It is equivalent to running:
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear
Rebuild Frontend Assets
If the release includes pre-built assets in public/build/, skip this step.
If you need to build assets:
npm install
npm run build
For servers with limited memory (4-8GB RAM):
npm install
npm run build:server:optimized
Recreate Storage Link (If Needed)
If the storage symlink was lost during the file replacement:
php artisan storage:link
Regenerate Autoloader (If Needed)
If you installed new addon modules as part of the update:
composer dump-autoload
Step 4: Verify the Upgrade
- Open your application in a browser and log in
- Check the dashboard loads correctly
- Navigate to Addons (accessible at
/addons) and verify modules are listed with their correct versions - Test key features your organization uses (attendance, leave, payroll, etc.)
- Check
storage/logs/laravel.logfor any errors
Set Correct Permissions (VPS)
After replacing files, ensure permissions are correct:
sudo chown -R www-data:www-data /var/www/html
chmod -R 775 storage bootstrap/cache
Set Correct Permissions (cPanel)
- Right-click the
storagefolder and set permissions to775 - Right-click the
bootstrap/cachefolder and set permissions to775 - Right-click the
Modulesfolder and set permissions to775 - Set the
modules_statuses.jsonfile permissions to664
Upgrading Addon Modules
Individual addon modules can be upgraded separately from the main platform.
Replacing Module Files Manually
- Download the new addon package from your purchase dashboard
- Back up the existing module folder (e.g.,
Modules/Payroll/) - Delete the old module folder from
Modules/ - Extract the new module files into
Modules/ - Run migrations and clear caches:
php artisan module:migrate ModuleName --force
php artisan optimize:clear
composer dump-autoload
Replace ModuleName with the actual module folder name (e.g., Payroll, TaskSystem, Recruitment).
Installing New Addon Modules via Admin Panel
New addon modules can also be installed through the admin panel:
- Navigate to Addons (accessible at
/addons) - Click Upload Module
- Select the addon ZIP file
- The system will automatically extract files, run migrations, and enable the module
The upload feature installs new modules. To update an existing module to a newer version, replace the module files manually as described above.
Handling Customizations
If you have made custom modifications to the source code, upgrading requires extra care.
Before Upgrading
- Document all files you have modified
- Use a diff tool (such as
diff, VS Code, or a file comparison tool) to track your changes - Consider maintaining a list of customized files for future reference
After Upgrading
- Re-apply your customizations to the new files
- Review the release changelog -- changes in the new version may conflict with your modifications
- Test thoroughly after re-applying customizations
If you use Git to track your installation, you can use git diff to see exactly what changed between your customized version and the new release. This makes re-applying customizations much easier.
Troubleshooting Upgrades
Migration Errors
If migrations fail with a "table already exists" error:
# Check migration status
php artisan migrate:status
# If a specific migration was already applied manually,
# you may need to mark it as run:
php artisan migrate --force
If a module migration fails:
# Run migration for a specific module
php artisan module:migrate ModuleName --force
500 Error After Upgrade
- Check
storage/logs/laravel.logfor the specific error - Ensure
.envfile was preserved correctly - Clear all caches:
php artisan optimize:clear - Verify file permissions on
storage/andbootstrap/cache/
Missing CSS or JavaScript
- Check that
public/build/exists and contains compiled assets - If missing, rebuild assets:
npm install
npm run build - Clear browser cache
Module Not Working After Upgrade
- Check
modules_statuses.jsonto verify the module is set totrue - Run the module's migrations:
php artisan module:migrate ModuleName --force - Clear caches:
php artisan optimize:clear - Regenerate autoloader:
composer dump-autoload
Queue Workers Not Processing
If you use Supervisor for queue workers, restart them after upgrading:
sudo supervisorctl restart opencorebs-worker:*
Rollback
If the upgrade causes critical issues, restore from your backup:
Restore Files
# VPS
cd /var/www
rm -rf html
mv html_old html
Restore Database
mysql -u your_db_user -p your_database_name < backup_YYYYMMDD_HHMMSS.sql
After Restoring
php artisan optimize:clear
Need Help?
- Documentation: Browse the full documentation for specific module guides
- Support: Contact [email protected]
- Professional Installation: Buy installation assistance