Moving your FastStore project to a new GitHub repository
In this guide, you'll learn how to move your FastStore project from one repository to another. This works for the following cases:
- FastStore projects hosted in the
vtex-sitesorganization using WebOps that you want to move to the GitHub organization of the account. - FastStore projects hosted in their own organization on GitHub using WebOps that you want to move to a new organization or repository.
For FastStore projects hosted in thevtex-sitesorganization and not using WebOps (FastStore v1), open a ticket with VTEX Support to move your project to your account's GitHub organization.
Before you begin
Have a FastStore project using WebOps
Make sure the FastStore project you want to move uses WebOps.
Upgrade @faststore/cli package
Update the
@faststore/cli package in your project to the latest version. To do so, follow the instructions in Updating the @faststore/cli package version.Have a GitHub organization
Make sure you have created a GitHub organization where you want to move your project. Learn how to do so in the GitHub guide Creating a new organization from scratch.
Have a GitHub repository
Make sure you have created the GitHub repository where you want to move your FastStore project. Learn how to do so in the GitHub guide Creating a new repository.
Instructions
Step 1 - Moving your store code to the new GitHub organization
To move your store code to the new GitHub organization, follow these steps:
Remember to replace the curly brackets according to your scenario.
-
Clone the current repository to your local environment:_10git clone https://github.com/{oldOrganizationName}/{oldRepositoryName}.git_10cd {oldRepositoryName}
-
Add the new repository to your local environment:_10git remote set-url origin https://github.com/{newOrganizationName}/{newRepositoryName}.git
-
Verify your remote configuration:_10git remote -vYou should see your remote listed with the new URL.
-
Push the codebase to the new GitHub organization:_10git push -u origin main
After completing these steps, you should see your code, files, and commit history in the new repository when you visit it on GitHub.
Step 2 - Installing the FastStore WebOps in the new GitHub organization
You already have FastStore WebOps installed in your account, but the app has not been installed in your new GitHub organization yet.
To install the FastStore WebOps in the new GitHub organization, follow the steps below:
-
Access the FastStore WebOps installation page on GitHub.
-
Click
Configure. -
Click the organization where you want to move your project.
-
Specify whether WebOps should be enabled for all repositories in the new GitHub organization or only selected repositories.
-
Click
Installing & Authorizingto install the FastStore WebOps in your new GitHub organization.You'll see the message{"status":"pending","message":"Could not find installation intent. If you started this installation outside FastStore WebOps, follow the FastStore Cloud migration guide to finish linking your project."}, which means the migration process is not complete yet.
Step 3 - Identifying the FastStore WebOps installation ID
This step is performed in the GitHub organization where you want to move your project. For example, if you're moving your FastStore project fromcurrent-orgtonew-org, you must follow this step in thenew-orgorganization on GitHub.
To identify the installation ID of the app you set up in the previous step, follow the steps below:
-
Go to the settings of the GitHub organization.
-
Click
GitHub AppsunderThird-party Access. -
Search for FastStore WebOps, then click
Configurenext to the app name. -
Check the URL to get the app installation ID. The URL follows this pattern:
https://github.com/organizations/{organizationName}/settings/installations/{installationId}, where{organizationName}is the name of your organization and{installationId}is the app installation ID.
Step 4 - Identifying the repository ID
This step is performed in the repository hosted in the new GitHub organization.
To identify the ID of the repository where you want to move your project, follow these instructions:
-
Access the GitHub repository page where you want to host your FastStore project. The URL follows this pattern:
https://github.com/{newOrganizationName}/{newRepositoryName}. Replace the curly brackets according to your scenario. -
Open the console in your browser.
-
Run the following command in the console. The response is the repository ID._10$("meta[name=octolytics-dimension-repository_id]").getAttribute('content')
Step 5 - Opening a ticket with VTEX Support
Open a ticket with VTEX Support and share the following information:
- Account: Name of your account.
- Link to the old repository: URL of the repository where your project is currently hosted.
- Link to the new repository: URL of the repository where you want to move your project.
- Repository ID: The unique identifier of the repository you want to migrate. See how to get this ID in Identifying the repository ID section.
- App installation ID (
installationId): The unique identifier of the FastStore WebOps installation on GitHub. See how to get this ID in Identifying the app installation ID.
The Support team will work on your request and notify you when the process is complete.
Don't publish or make changes to the code in the new repository before the process is complete.