Migrating one Netlify site to another - looking for feedback

Forgive the somewhat vague topic. I’ve got a large blog running on Netlify now using Jekyll. I’ve been working on an Eleventy version tied to a different GitHub repo and running on Netlify as well.

I think I’m ready to fully migrate and I just wanted to confirm some assumptions I have.

First - I assume I should NOT try to edit my existing Netlify site to point to the new repo, use the new build command, etc. If I leave it running, I have a quick way to go back.

Secondly - in theory - I just remove DNS settings from the first site and add it to the second site. Right?

Third - I guess I’ll lose my analytics history, right? I’m fine with that - I can always open up the first site’s analytics tab to look, but is there a way to migrate that too?

Anything I’ve missed?

I’m curious about this too. What are possible up and downsides to switching repos for a site? How does one limit downtime when taking the DNS switching route?

Hi, @cfjedimaster and @tomrutgers. I’ve been thinking about this reply. I researched this a bit (seems like one can alway do more) and here is what I found:

Linking to a new repo:

  • It does keep your build and analytics histories.
  • You need to change or re-enter the build commands (and we prompt for the existing commands when you relink).
  • The UI environment variables won’t change unless you do so manually.
  • The deploy context (branch) settings in the UI are erased on repo change.
  • No DNS or custom domain changes need.

New site:

  • It does not keep your build and analytics histories.
  • You need to enter the build command(s).
  • The UI environment variables must be re-entered.
  • The deploy context (branch) settings in the UI (if any) must be created.
  • DNS and custom domain changes are required.

For the new site you do also need to remove the custom domain from the existing Netlify site and move it to the new one. If using third-party DNS you should also update the CNAME records to point to the new netlify.com (or netlify.app) subdomain. (Technically, it will work even if you don’t as long at it is a subdomain at netlify.com but we don’t promise this so it shouldn’t be counted on.)

Regarding doing it quickly, I would open the two sites in tabs. Delete the custom domain in one with the other already type into the prompt on the other.

I think that covers most of the important issues. If you do run into something or want add something you noticed that I missed, please feel free to do so. Additional discussion is encouraged and appreciated.

1 Like

I’ve decided to go the route of keeping the same site and unlinking GH/relinking to the new repo and changing my build command. I’ll report back. I think it will be fine and I’ll just encounter issues w/ my new site unrelated to migration.

I think I’ll actually do the opposite :sweat_smile: Will let you know how it goes.

@luke a few other moving parts I can think of are forms, functions, identity and large media.
Identity seems obvious: a new site means re-inviting all of your users, so if you have many users you’re better off switching your repo I suppose. Large media is configured at a repository level so I think that won’t cause too much trouble? To be on the safe side it’s probably best if your new site has unique form names. Functions are a bit of a blind spot for me since I never used them in production.

Outside of GitHub having issues, it went fine. Found a few small bugs, fixed, and now I just wait to see if I get lots of 404s for something I missed.

great. keep us posted!

Switching sites went amazingly smooth! The Netlify DNS service picked up the changes immediately so the new site was live as soon as I hit enter.

1 Like