---
title: Updating Klevu Modules
slug: klevu-magento-v4/updating-klevu-modules
docTags: 
createdAt: 2024-09-20T14:35:55.567Z
---

All updates should be completed and tested in a non-production environment.

## Non-Production Environment

### Step 1 - Update v4.x packages

Update the modules via composer.&#x20;

```javascript
composer update "klevu/*"
```

### Step 2 - Update Magento

Enable modules, update the database, compile code, generate static content and clear caches.

```shell
bin/magento module:status | grep Klevu_ | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:enable
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:flush
```

### Step 3 - Test

Ensure everything is working as expected in a non-production environment.

## Production Environment

**Follow your usual deployment processes**, the steps in this section are provided as a guide only (assumes `composer.lock` file is committed to your git repository).

- Enable Maintenance Mode `bin/magento maintenance:enable`
- Install the modules via `composer install`
- Enable all Klevu modules `bin/magento module:status | grep Klevu_ | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:enable`
- Upgrade Magento `bin/magento setup:upgrade`
- Compile code `bin/magento setup:di:compile`
- Deploy static content `bin/magento setup:static-content:deploy`
- Clean caches `bin/magento cache:clean`
- Disable Maintenance Mode `bin/magento maintenance:disable`

****

