# How upgrade database since v12?

**URL:** <https://community.directus.com/t/how-upgrade-database-since-v12/2380>\
**Category:** Help\
**Tags:** v12, upgrade\
**Created:** [July 2, 2026, 9:32am UTC](https://community.directus.com/t/how-upgrade-database-since-v12/2380 "2026-07-02T09:32:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_O](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/david_o/32/649_2.png) [@David\_O](https://community.directus.com/u/David_O)\
**Post date:** [July 2, 2026, 9:32am UTC](https://community.directus.com/t/how-upgrade-database-since-v12/2380/1 "2026-07-02T09:32:41Z")

</div>

Now Directus is on a hardened docker image, what’s the correct way to upgrade the database following a container update?

My flow used to be:

```auto
docker compose pull
docker compose down
docker compose run --rm {directus} npx directus database migrate:latest
docker compose up -d

```

but now npx and database modules ‘cannot be found’.

What should I do instead to bring my postgres database up-to-date following a Directus upgrade?

Thanks.

---

<div class="post-metadata">

**Author:** ![jogchum](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/jogchum/32/107_2.png) [@jogchum](https://community.directus.com/u/jogchum)\
**Post date:** [July 6, 2026, 10:54am UTC](https://community.directus.com/t/how-upgrade-database-since-v12/2380/3 "2026-07-06T10:54:36Z")

</div>

Just like before the dhi containers, in the official image migrations are part of the boot proces.

So if you update Directus (for example going from 12.1.0 to 12.1.1), booting the new image should run the migrations automatically. No manual step needed.

---

<div class="post-metadata">

**Author:** ![Beth](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/beth/32/30_2.png) [@Beth](https://community.directus.com/u/Beth)\
**Post date:** [July 6, 2026, 9:19am UTC](https://community.directus.com/t/how-upgrade-database-since-v12/2380/2 "2026-07-06T09:19:21Z")

</div>

Hey @David_O, I hope you’ve been well! I’m checking you saw Matt’s post: [Heads up! We're moving to a hardened Docker image. Here's what that means](https://community.directus.com/t/heads-up-were-moving-to-a-hardened-docker-image-heres-what-that-means/2363)
