Version upgrades are usual process in software life cycle, below are the steps, i had used to migrate my existing site.
What i am doing is sort of migrating my existing site from root domain to a subdomain, so in a way previous version is also active for reference purposes.
Existing Current site : bobbydreamer.com
New Proposed Site : localhost:8000
After this migration process, current site would become archived site and new proposed site would become the current site
Archived site : v2.bobbydreamer.com
# Steps i took in migrating the site
-
Created a new bucket in GCS with settings multi-regional and permissions
fine-grained
access control. -
Since the current site is hosted from Cloud Storage, i am just moving all the files from current bucket
www.bobbydreamer.com
towww.v2.bobbydreamer.com
. I don’t have to do this but it will reduce confusion in future. Open Cloud Shell and enter the below commandsFirst command :
gsutil -m cp -r gs://www.bobbydreamer.com/* gs://www.v2.bobbydreamer.com
copies files from one bucket to another- -m for parallel(multi-threaded/multi-processing) copy
- -r for recursive to copy entire directory tree
Second command :
gsutil defacl set public-read gs://www.v2.bobbydreamer.com
to make entire bucket public -
Did you note the highlighted text in the image in point(1). Sort of, Domain ownership verification required. Since everything is in Planet Google, its easy for me. I am already logged in google account, now i have to go to Search console, type in new URL( www.v2.bobbydreamer.com ) to verify ownership.
-
Adding custom resource records in Google Domains.
Go to Google Domains → My Domains → DNS → Add the below custom record -
After waiting for 10mins everything is set.
-
As a final step i have deleted the “Custom resource records” related to www.bobbydreamer.com with data “c.storage.googleapis.com.”