Skip to content

Commit

Permalink
README.md: Document schema upgrade procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
spbnick committed Jan 29, 2020
1 parent 480aad2 commit a1b8aa1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,41 @@ can be displayed by `kcidb-schema`.

To cleanup the dataset (remove the tables) use `kcidb-cleanup`.

Upgrading
---------

To upgrade the dataset schema, do the following.

1. Authenticate to Google Cloud with the key file (`~/.kernelci-bq.json`
here):

gcloud auth activate-service-account --key-file ~/.kernelci-bq.json

or login with your credentials (entered via a browser window):

gcloud auth login

2. Create a new dataset (`kernelci02` in project `kernelci` here) with the new
schema:

bq mk --project_id=kernelci kernelci02
# Using new-schema kcidb
kcidb-init -d kernelci02

3. Switch all data submitters to using new-schema kcidb and the newly-created
dataset.

4. Disable write access to the old dataset using BigQuery management console.

5. Transfer data from the old dataset (named `kernelci01` here) to the new
dataset (named `kernelci02` here) using old-schema `kcidb-query` and
new-schema `kcidb-submit`.

# Using old-schema kcidb
kcidb-query -d kernelci01 > kernelci01.json
# Using new-schema kcidb
kcidb-submit -d kernelci02 < kernelci01.json

API
---
You can use the `kcidb` module to do everything the command-line tools do.
Expand Down

0 comments on commit a1b8aa1

Please sign in to comment.