# Upgrade

Upgrading works just like the installation. However, in some major versions or when upgrading Shopware versions, there are some things that should be taken into consideration to avoid issues during the upgrade.

## General Upgrade Process

Upgrading works just like installing, where you can usually upload the file, and then click update in the admin.

Alternatively, you can also install the update via command line input.

### Command Line Update Process

If you prefer using the terminal, the process differs slightly from the initial installation. After uploading the file via the Admin, navigate to your shop's root directory and run the following command:

```bash
bin/console plugin:update b2bsellerscore
```

## Special Instructions

### Upgrading to 4.0.0

{% hint style="info" %}
The manual SQL steps below are only required when upgrading specifically to version 4.0.0. If you are upgrading to version 4.0.1 or higher, these database adjustments are handled automatically and no manual SQL execution is necessary.
{% endhint %}

To avoid errors during the upgrade — specifically if your existing database contains addresses with missing name fields — you must follow these two steps:

Before continuing with the update, run this SQL statement to ensure no NULL values cause a conflict:

```sql
UPDATE `customer_address` SET first_name = '' WHERE first_name IS NULL;
UPDATE `customer_address` SET last_name = '' WHERE last_name IS NULL;
UPDATE `order_address` SET first_name = '' WHERE first_name IS NULL;
UPDATE `order_address` SET last_name = '' WHERE last_name IS NULL;
```

To ensure the checkout functions correctly with empty name fields moving forward, apply the following schema changes:

```sql
ALTER TABLE `customer_address` MODIFY `first_name` varchar(255) NULL;
ALTER TABLE `customer_address` MODIFY `last_name` varchar(255) NULL;
ALTER TABLE `order_address` MODIFY `first_name` varchar(255) NULL;
ALTER TABLE `order_address` MODIFY `last_name` varchar(255) NULL;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2b-sellers.com/b2b-platform/user-guide/setup/upgrade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
