UPGRADE.md
This guide helps you safely upgrade your Unopim installation. Follow the manual upgrade steps or use the automated upgrade script for minor patches.
(See change impact classification details)
Exporter (Product/Exporter.php): Added new dependency ProductSource.AbstractExporter class now rely on $exportBuffer, altering the construction and initialization flow.BufferInterface::addData signature changed from:
public function addData($item, $filePath, array $options = []);
public function addData($item);
getResults() flow to handle ElasticSearch-based or generic database exports.flush() in Export.php rather than per-batch.AbstractCursor and AbstractElasticCursor as base cursor classes for streaming exports.ProductCursor to support paginated export via ElasticSearch or DB query.openspout/openspout for efficient streaming file generation (CSV/XLSX).JSONFileBuffer to handle intermediate export buffering for improved performance.prepareProducts()).getNextItemsFromIds())._ as a special character.<a name="manual-upgrade-steps"></a>
Before starting the upgrade process:
mysqldump or your preferred method:mysqldump -u your_db_user -p your_db_name > backup.sql
Make sure to keep these backups safe in case the upgrade process encounters any problem.
.zip file for the latest versionCopy the following files from your existing Unopim project to the newly extracted version:
.env filestorage/ folder (to keep your data intact like images)This ensures your environment settings and any uploaded files stay intact during the upgrade.
Navigate to the extracted folder, and install the necessary dependencies with Composer:
composer install
Run the following command to apply any necessary database schema updates:
php artisan migrate
Ensure that the system is cleared of any cached data and properly linked:
php artisan optimize:clear
php artisan storage:link
This step will optimize your application and create the necessary symbolic link to your storage folder.
If you are using a process manager like Supervisor to manage the queue:work command, restart the relevant service to apply the changes. Replace unopim-worker with your actual worker name, if different:
sudo supervisorctl restart unopim-worker
If Elasticsearch service is running, you must clear and rebuild the indexes to reflect updated structures or data:
php artisan unopim:elastic:clear # Clear existing Elasticsearch data
php artisan unopim:product:index # Re-index all products
php artisan unopim:category:index # Re-index all categories
## ✅ Upgrade Complete!
After following these steps, your Unopim should be successfully upgraded. Test your application thoroughly to make sure everything works as expected.
---
<a name="automated-upgrade-script"></a>
## 🛠️ Automated Upgrade Script
### 1. Backup your project
Although the upgrade script automatically creates the backup of your project as well as the database, For additional safety you can manually keep the backups in case the upgrade process encounters any problems.
Before starting the upgrade process:
* **Backup your full project**
* **Backup your database** using `mysqldump` or your preferred method:
```bash
mysqldump -u your_db_user -p your_db_name > backup.sql
Make sure to keep these backups safe in case the upgrade process encounters any problem.
Place the script in the directory of your Unopim project and execute it from the terminal:
./upgrade.sh
After following these steps, your Unopim should be successfully upgraded. Test your application thoroughly to make sure everything works as expected.