Skip to content
bobby_dreamer

Archiving current site to a subdomain

web-development, GCP, hosting, GoogleDomains, GCS1 min read

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 Google Cloud Storage

New Proposed Site : localhost:8000 Google Cloud Storage

After this migration process, current site would become archived site and new proposed site would become the current site

Archived site : v2.bobbydreamer.com Google Cloud Storage

# Steps i took in migrating the site

  1. Created a new bucket in GCS with settings multi-regional and permissions fine-grained access control. Google Cloud Storage

  2. Since the current site is hosted from Cloud Storage, i am just moving all the files from current bucket www.bobbydreamer.com to www.v2.bobbydreamer.com. I don't have to do this but it will reduce confusion in future. Open Cloud Shell and enter the below commands

    1gsutil -m cp -r gs://www.bobbydreamer.com/* gs://www.v2.bobbydreamer.com
    2
    3gsutil defacl set public-read gs://www.v2.bobbydreamer.com

    First 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

  3. 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.

  4. Adding custom resource records in Google Domains.
    Go to Google Domains -> My Domains -> DNS -> Add the below custom record

    Google Domains

  5. After waiting for 10mins everything is set. Google Cloud Storage

  6. As a final step i have deleted the "Custom resource records" related to www.bobbydreamer.com with data "c.storage.googleapis.com."

# Related articles

  1. How i made this gatsby site