Local Development with Craft Nitro
Migrating an existing project to Nitro is probably going to be the most common scenario you run into, assuming you move all of your projects over instead of just using Nitro for new projects.
Migrating an existing project to Nitro is probably going to be the most common scenario you run into, assuming you move all of your projects over instead of just using Nitro for new projects. Where possible, I would recommend moving all actively developed projects over so you don’t have to jump between development environments.
The site we’re going to move to Nitro is the sample site I used frequently on CraftQuest, Downlink. We learned about Downlink in the Flexible Twig Templates in Craft course.
I already have this project running locally, so I don’t need to clone anything or download any code.
In the project directory, we will use the nitro add
command to add a new project. Nitro assumes that we are going to do it within the context of the current working directory.
After that, we walk through the Nitro project setup process, choosing the Docker container configuration we need.
Finally, I want to get the database imported into the Nitro MySQL container I have running from the installation process. To do that we use nitro db import
and then the name of the database export file.
nitro db import ~/Downloads/downlink.sql
Nitro will prompt us to choose which database we want to use for the import and then import the database dump file.
Now we are ready to test the migrated project in the web browser and check that everything is working as expected!
Local Development with Craft Nitro is made up of the following videos: