Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With firebase hosting how do I change the domain name

I have previously configured firebase hosting successfully but now want to change the domain name I am using.

It appears you can Edit the current domain name but this doesnt seem to do anything that I can see when I enter a new domain name.

Not sure how to proceed.

Thanks, Craig.

like image 634
CPP Avatar asked Apr 21 '15 10:04

CPP


People also ask

How do I add Godaddy domain to Firebase Hosting?

Go to the console.firebase.google.com, choose the project. And click on the hosting tab. It would look something like this. Click on the add custom domain button.


1 Answers

So I sent an email to firebase support and this process involves removing your current domain and adding a new domain which involves some downtime whilst they procure a new SSL certificate, etc.

If anyone is attempting to do this and does not want to incur any downtime its not too difficult. The highlevel process I have followed to move from olddomain.com to newdomain.com without downtime is detailed below:

  1. Procure another temp server (i.e. amazon or whatever) and bring up nginx
  2. Deploy your static files (css, js, html, jpg, etc) to this temporary server
  3. Procure a cert for olddomain.com and deploy it on your server. You can get some free ones for a month if you have a search (dont want to endorse any particular product here)
  4. Ensure the site is running as olddomain.com on your temp server (hack you hosts file to force your domain name to point at the new temp server.
  5. If all good, modify your DNS for olddomain.com so it points at your temp server.
  6. Wait a few hours to ensure all traffic going to your temp server (look at w3c style logs to ensure traffic is coming in)
  7. You can now safely remove your olddomain.com and setup newdomain.com under firebase hosting without losing traffic to olddomain.com
  8. Once newdomain.com setup and running on firebase hosting, configure olddomain.com to do a redirect to newdomain.com. May want to leave this up for a while depending upon how much traffic you are expecting to olddomain.com.
  9. Job done without any downtime :)

Hope these steps are of use to others.

Thanks.

like image 115
CPP Avatar answered Jan 01 '23 00:01

CPP