Migrating from Vuex to Pinia: A Practical Guide
Pinia is now the recommended state library for Vue 3. Here's how to migrate from Vuex incrementally without breaking working code.
Pinia is the state management library that ships as the default in Vue 3 land. If you are still on Vuex, the migration is not urgent — Vuex 4 still works — but it is worth doing. The mental model is simpler, the TypeScript story is better, and the API is half the size.
What changes
Pinia drops the namespace and module concept that Vuex had. Each store is a flat file with state, getters, and actions. There are no mutations — actions mutate state directly. You define a store with defineStore() and import it in any component that needs it.
Migrate store by store
Both libraries can coexist in a project. Install Pinia alongside Vuex, then convert one store at a time. The order I usually pick: smallest, most isolated stores first (settings, UI state); largest, most-coupled stores last (auth, user, cart).
For each store, port the state and getters first (they translate almost directly), then the actions. Mutations collapse into actions — you do not need a separate concept for synchronous changes.
Updating components
ts// Vuex
this.$store.dispatch('cart/addItem', item)
this.$store.getters['cart/itemCount']
// Pinia
import { useCartStore } from '@/stores/cart'
const cart = useCartStore()
cart.addItem(item)
cart.itemCountThe Pinia version is more direct — and far better for TypeScript inference. Methods on cart are typed; in Vuex, this.$store.dispatch is mostly stringly-typed and your editor cannot help much.
What to leave alone
If a Vuex store is large, well-tested, and not actively changing, migration is busywork. Migrate the stores you actively touch and leave the rest until they need changes. Pinia's compatibility is fine for years of dual existence.
About the author

Richard Gamora
Fullstack developer based in the Philippines, working mostly with Laravel and Vue.js, with eight years of production experience across web and mobile.
More on Vue & Nuxt
January 28, 2026
Vue 3 Composition API: Patterns That Scale
The Composition API is more flexible than the Options API but easier to misuse. Here are the patterns that hold up as components grow.
January 14, 2026
Nuxt 3 SSR vs SSG: How to Decide for Your Site
Nuxt 3 supports server rendering, static generation, and hybrid modes per route. Here's a clear way to choose for content sites, SaaS apps, and marketing pages.
January 7, 2026
Vue 3 Reactivity Gotchas Every Developer Hits
Vue 3's reactivity is powerful but has rules. Here are the gotchas that catch most teams — destructuring, array indices, and reactivity loss across boundaries.