---
title: "Upgrade"
description: "The steps to upgrade from an earlier version of the package."
version: "4.0"
---

> Documentation Index
> Fetch the complete documentation index at: https://migrations.phalcon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade

## Upgrade from 3.x to 4.0

Version 4.0.0 removes the dependency on the Phalcon extension. To upgrade:

1. Use PHP 8.2 or later.
2. Change your PHP configuration file to return an array. See [Create the configuration file](/4.0/quick-start#create-the-configuration-file).
3. If you call `Migrations::run()` in your code, use `Config::fromArray()` for the `config` option. See [Usage example](/4.0/php-api).
4. Update your migration files with the `migrate-files` command.

First, see the files that the command changes:

```
vendor/bin/phalcon-migrations migrate-files --migrations=db/migrations --dry-run
```

Then change the files:

```
vendor/bin/phalcon-migrations migrate-files --migrations=db/migrations
```

`--dry-run=false` is the same as no `--dry-run`: the command changes the files.

The `--migrations` option is required. The path is relative to the current directory. The command reads all the `.php` files in the directory and its subdirectories, and replaces these lines:

| Old line                    | New line                               |
|-----------------------------|----------------------------------------|
| `use Phalcon\Db\Column;`    | `use Phalcon\Migrations\Db\Column;`    |
| `use Phalcon\Db\Index;`     | `use Phalcon\Migrations\Db\Index;`     |
| `use Phalcon\Db\Reference;` | `use Phalcon\Migrations\Db\Reference;` |

:::warning[WARNING]
The command replaces only these exact lines. If a file refers to the `Phalcon\Db` classes in a different way, for example with a fully qualified class name or a grouped `use` statement, change the file manually. If a file uses integer column types instead of the `Column::TYPE_*` constants, change them to the constants.
:::

Migration files that you do not update continue to work if the `Phalcon\Db` classes are available, for example from the Phalcon extension. The package converts the `Phalcon\Db\Column`, `Phalcon\Db\Index` and `Phalcon\Db\Reference` objects when the migration runs.

Source: https://migrations.phalcon.io/4.0/upgrade/index.mdx
