Skip to content

Commit a1b8aa1

Browse files
committed
README.md: Document schema upgrade procedure
1 parent 480aad2 commit a1b8aa1

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,41 @@ can be displayed by `kcidb-schema`.
7777

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

80+
Upgrading
81+
---------
82+
83+
To upgrade the dataset schema, do the following.
84+
85+
1. Authenticate to Google Cloud with the key file (`~/.kernelci-bq.json`
86+
here):
87+
88+
gcloud auth activate-service-account --key-file ~/.kernelci-bq.json
89+
90+
or login with your credentials (entered via a browser window):
91+
92+
gcloud auth login
93+
94+
2. Create a new dataset (`kernelci02` in project `kernelci` here) with the new
95+
schema:
96+
97+
bq mk --project_id=kernelci kernelci02
98+
# Using new-schema kcidb
99+
kcidb-init -d kernelci02
100+
101+
3. Switch all data submitters to using new-schema kcidb and the newly-created
102+
dataset.
103+
104+
4. Disable write access to the old dataset using BigQuery management console.
105+
106+
5. Transfer data from the old dataset (named `kernelci01` here) to the new
107+
dataset (named `kernelci02` here) using old-schema `kcidb-query` and
108+
new-schema `kcidb-submit`.
109+
110+
# Using old-schema kcidb
111+
kcidb-query -d kernelci01 > kernelci01.json
112+
# Using new-schema kcidb
113+
kcidb-submit -d kernelci02 < kernelci01.json
114+
80115
API
81116
---
82117
You can use the `kcidb` module to do everything the command-line tools do.

0 commit comments

Comments
 (0)