Skip to content

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 : 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 : 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 to 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://* gs://
    3gsutil defacl set public-read gs://

    First command : gsutil -m cp -r gs://* gs:// 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:// 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( ) 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 with data ""

# Related articles

  1. How i made this gatsby site