How to Migrate from Ionic 4 To Ionic 5

You must have heard that Ionic Framework has released Ionic 5 which has many new features and performance upgrades. So you may be concerned that if your project is compatible to Ionic 5 or can it be migrated to Ionic 5.

Here is the great news, yes, it can be easily migrated to Ionic 5 without changing minimum amount of code if your app is not so big or not using so many third party plugins. You just need your Ionic CLI to be updated to the latest Ionic version globally, then we are good to go.

It’s all about two commands to update to latest Ionic CLI

sudo npm uninstall -g ionic

This command will uninstall the global Ionic CLI
Then run this command, it will install the latest Ionic CLI

sudo npm install -g ionic@latest

If you do so, your environment is ready for updating the app to latest ionic version

Now what you should do is, create a new ionic 5.1.1 app and port our existing app to new app

Then you manually install the plugins you used in Ionic 4 project and finally try run the newly ported project. You will get all the errors you have to fix in terminal. Once you fixed all of those errors, you can check your full app and see if it is functioning properly.

This is the most convenient way to move from Ionic 4 to 5.

But if you don’t like above way, want to migrate the app from app base without creating a new app then please follow this tutorial here