Migrate from a Partner Dashboard-managed app to Shopify CLI
If you've been using the Partner Dashboard to manage your app, then you should consider importing it and using Shopify CLI to manage it instead for the following reasons:
- You can use familiar version control (like Git) to manage changes to your configuration over time because your app configuration is defined in code,
- CLI-managed apps can can use features like extensions or Shopify functions.
- Certain elements of app configuration can only be managed using the CLI, such as handles.
- You don't need to port your web app and focus only on app configuration.
- If you have multiple apps for different environments, such as staging and production, you can manage everything in a single local project.
Anchor to RequirementsRequirements
- You've installed Shopify CLI
- The latest version of Chrome or Firefox
Anchor to What you'll learnWhat you'll learn
In this tutorial, you'll learn the following:
- How to set up a new local project for an existing app
- How to add Shopify CLI as a project dependency
Anchor to Step 1: Create a new appStep 1: Create a new app
Set up a new local project using Shopify CLI.
Terminal
Create a new app and choose Build an extension-only app in the set up process.
This empty app is an extension-only app, which doesn't have an app home. You can change the configuration to add an app home later.
Anchor to Step 2: Import the configuration from your existing appStep 2: Import the configuration from your existing app
Connect the new app project to your existing app.
Terminal
- Run the
shopify app config link
command and select connect it to an existing app. - Inspect the
shopify.app.toml
file to make sure you have correctly imported the configuration from your existing app. You can always run the command again to link to a different app.
If you have multiple apps representing different environments, then select a staging or development app at this point because shopify.app.toml
acts as a default target for commands. You can add the production app later.
You've successfully moved your app to Shopify CLI. Instead of going to the Partner Dashboard, you can now make changes by updating the shopify.app.toml
file and then running the shopify app deploy
command. This command releases a new app version to app users.
Terminal
Find out more about deploying and releasing app versions.
Anchor to Next stepsNext steps
You now have a local project that's linked to your existing Shopify app. What's next?
Anchor to Manage multiple environmentsManage multiple environments
If you have multiple apps that represent different environments, you can manage these through a single app project. Run the shopify app config link
command, select connect it to an existing app, and choose the additional environment. You can give the imported app.toml
config file a different name.
You can switch between multiple configuration files that represent different environments by providing the --config
flag to CLI commands, or using the shopify app config use
command to set the default environment.
Find out more about managing multiple app configurations and environments.
Anchor to Add your first extensionAdd your first extension
With a local project set up with Shopify CLI, you can start to introduce app extensions. You can build a checkout or storefront customization, or Shopify function. You can add your first extension by running shopify app generate extension
. To preview your extension during development, run shopify app dev
.
Find out more about app extensions.