Developer-favorite hosting platform Netlify recently announced a major change affecting end users on their free service tier: effective September 30, 2022 websites hosted in private organization repositories must move the their paid "Pro" hosting tier https://www.netlify.com/pricing/private-org-repo-faq/?_ga=2.48367394.50871513.1660645843-1993254338.1660645843
Options for Avoiding the Pro Version
The FAQ linked above describes the move and options for developers who need to avoid the pro version.
If you are not ready for the NEW Netlify Pro--like the author--you have to determine the option right for you and your client.
I prefer the simplicity of Netlify's automated builds so moving to a CLI option was not for me.
I am not keen on opening my website source to the public and my clients are not contributing to the organization-owned repository, so the solution that seems right is moving the sites to private repos on my GitHub account.
I was able to accomplish the migration fairly simply.
Moving Netlify Sites to Private Personal GitHub Repositories
- Create new repository on personal account
- Set privacy
- Copy repository URL
- Change remote URL in local repository
- Push to new repository
- Change repository in Netlify Site Settings
- Confirm successful build
Create a New Repository
Log in to your GitHub account. Instead of using an organization, create a NEW repository in your own account. You will be pushing your existing repository to this one so do not add README.md or anything else.
Set Privacy
The whole reason for migrating from the organization account is that you want to keep your repository private, so set the privacy before you publish your new repo.
Copy Repository URL
Once the new empty repository opens up copy the URL.
Change the Remote URL in Local Repository
First, make sure your local repository is up to date with your production. If not, merge those. Then change the remote URL in your local repository. The following code works in terminal:
git remote set-url origin https://github.com/username/link-to-repo.git
Push to New Repository
Now you are ready to push your code to your new empty private repo on your account.
git push origin master
Change Repository in Netlify Site Settings
Now go to Netlify. In your site Settings under "Build and Deploy" select the "Manage repository" button to "Link to a different repository". Here, you'll select your new repository (you are also given other git hosts).
Confirm Successful Build
Once you configure your build you'll be able to trigger a new build. Watch the dialog to confirm your build was successful. If all goes well you have successfully migrated your website and redeployed with zero downtime and you are free from the upgrade fees.
Top comments (0)