Skip to content

Commit c110acc

Browse files
authored
Update tcie-3.x-migrating-db-from-2.x-to-3.x.md
1 parent b335b74 commit c110acc

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

user/enterprise/tcie-3.x-migrating-db-from-2.x-to-3.x.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@ This document describes the steps necessary for database migration from an exist
88

99
## Overview
1010

11-
The TCIE 3.x runs over Postgresql v11 and features a bit different database schema, synchronized with Travis CI Hosted solution. Since TCIE 3.x is deployed as Kubernetes cluster, PostgreSQL is now one of the pods (TCIE 2.x had every dependency embedded in one large Docker image).
11+
The TCIE 3.x runs over Postgresql v11 and features a slightly different database schema, synchronized with the Travis CI Hosted solution. Since TCIE 3.x is deployed as a Kubernetes cluster, PostgreSQL is now one of the pods (TCIE 2.x had every dependency embedded in one large Docker image).
1212

1313
The main schema differences are:
1414
* In TCIE 3 databases for *logs* and *main* are now separated.
1515
* The *_configs* schema in the new TCIE 3 *main* database is a bit different from the one in TCIE 2.2, and thus, this part will not be migrated during the following process; that means for builds done before the migration, the users won't have the `.travis.yml` contents relevant to these builds available in the Web User Interface.
1616

1717
## Migration Preparation
1818

19-
1. First, but optional step is removing unnecessary data to make your dump lighter. You can do it using [travis-backup gem](https://rubygems.org/gems/travis-backup). We recommend running the following commands after installing the gem:
19+
1. The first but optional step is removing unnecessary data to make your dump lighter. You can do it using [travis-backup gem](https://rubygems.org/gems/travis-backup). We recommend running the following commands after installing the gem:
2020
- to remove orphaned data: `travis_backup 'postgres://your_db_url' --remove_orphans`
2121
- to remove requests, builds, jobs, and logs older than 6 months: `travis_backup 'postgres://your_db_url' --threshold 6`
22-
2. You will need to dump existing TCIE 2.x (single docker image) PostgreSQL database into two files:
23-
1. main database which should be a copy of current existing DB from Travis CI Enterprise 2.2.x (TCI E 2.2.x - one docker solution)
24-
2. logs database which should contain only two tables: logs and log_parts from the main database
22+
2. You will need to dump the existing TCIE 2.x (single docker image) PostgreSQL database into two files:
23+
1. main database, which should be a copy of the current existing DB from Travis CI Enterprise 2.2.x (TCI E 2.2.x - one docker solution)
24+
2. logs database, which should contain only two tables: logs and log_parts from the main database
2525
3. For both aforementioned databases you need to have following credentials which will be used during Travis CI Enterprise 3.0.x (TCI E 3.0.x - k8s solution) installation process:
2626
- DB name
2727
- DB user
2828
- DB password
2929
- DB host
3030
- DB port
31-
4. You will need encryption key which can be found in current TCI E 2.2.x installation:
31+
4. You will need an encryption key, which can be found in the current TCI E 2.2.x installation:
3232
- ssh to platform
3333
- call:
3434
```bash
3535
travis bash call: cat /usr/local/travis/etc/travis/config/travis.yml | grep -A 1 "encryption:"
3636
```
37-
- note it down on a piece of paper or at different computer
37+
- note it down on a piece of paper or a different computer
3838

39-
> Before migrating the DB, we **strongly recommend** to store a DB snapshot or make additional copy of DB dump.
39+
> Before migrating the DB, we **strongly recommend** storing a DB snapshot or making an additional copy of the DB dump.
4040

4141
## Migration Example
4242

@@ -68,7 +68,7 @@ scp [email protected]:/TCI_E_2_0_db_schema_dump_logs_table
6868

6969
As a result, you should have both database files available for further processing.
7070

71-
> This is the last moment you can make a backup of the dump files!
71+
> This is the last moment you can back up the dump files!
7272

7373
### Alter the Database Dumps
7474

@@ -80,9 +80,9 @@ sed -i '' 's/OWNER TO travis/OWNER TO postgres/g' TCI_E_2_0_db_schema_dump_main_
8080
```
8181

8282
**PLEASE NOTE**:
83-
1. Please reconfirm existing database owner name directly via PSQL query or command line tool. If required, unify/change it to a single user using psql tooling/queries before any further operation is executed.
84-
1. If you use external database (not from the Travis CI Enterprise 2.2 release) and wish to continue so: you do not have to perform above step. Just use the database owner credentials from Travis CI Enterprise 2.2 in Travis Ci Enterprsie 3.x configuration.
85-
2. If you use external database (not from the Travis CI Enterprise 2.2 release) and wish to cease to do so and use database delivered as a pod in Travis CI Enterprsie 3.3, in above bash commands change following fragments
83+
1. Please reconfirm the existing database owner name directly via PSQL query or command line tool. If required, unify/change it to a single user using psql tooling/queries before any further operation is executed.
84+
1. If you use an external database (not from the Travis CI Enterprise 2.2 release) and wish to continue so you do not have to perform the above step. Just use the database owner credentials from Travis CI Enterprise 2.2 in Travis CI Enterprise 3.x configuration.
85+
2. If you use an external database (not from the Travis CI Enterprise 2.2 release) and wish to cease to do so and use a database delivered as a pod in Travis CI Enterprise 3.3, in the above bash commands, change the following fragments
8686

8787
`Owner: travis` to `Owner: {your external tcie 2.2 database owner}`
8888

@@ -96,7 +96,7 @@ Make your dump files available under any `http` address visible for your target
9696

9797
### Install TCIE 3.x Providing the Dumps and Key
9898

99-
Make sure you have provided the encryption key from existing TCIE 2.x installation in the TCIE 3.x GUI:
99+
Make sure you have provided the encryption key from the existing TCIE 2.x installation in the TCIE 3.x GUI:
100100

101101
![TCIE 3.X Install GUI: Encryption key input](/images/tcie-3.x-input-for-encryption-key.png)
102102

@@ -111,11 +111,11 @@ SQL Schema from 2.2 -> set to yes ->
111111
Once the installer completes the work, your database should be successfully migrated.
112112

113113
> Important!
114-
Due to the fact that TCIE 3.x uses original configs `raw_configs` (as in `.travis.yml`) and there is no way to restore such `raw_configs` from the old normalized versions from `[request|build|job]_configs` - these will be not migrated. The drawback is that no historical configs are available in the travis-web app for the end user.
114+
Because TCIE 3.x uses original configs `raw_configs` (as in `.travis.yml`) and there is no way to restore such `raw_configs` from the old normalized versions from `[request|build|job]_configs` - these will be not migrated. The drawback is that no historical configs are available for the end user in the travis-web app.
115115

116116
## Summary
117-
- main DB from TCI E 2.X is split into two databases in TCIE 3.x: *main* and *logs*
118-
- old configs from logs, builds, requests (column: `config`) are not migrated into new tables `[request|build|job]_configs`
119-
- old not used config columns from `[requests|builds|jobs]` are dropped
120-
- new tables are created for configs for future build runs: `[request|build|job]_configs`
121-
- new table for raw config is created for future build runs `request_raw_configs`
117+
- main DB from TCI E 2.X is split into two databases in TCIE 3.x: *main* and *logs*.
118+
- old configs from logs, builds, and requests (column: `config`) are not migrated into new tables `[request|build|job]_configs`.
119+
- old not used config columns from `[requests|builds|jobs]` are dropped.
120+
- new tables are created for configs for future build runs: `[request|build|job]_configs`.
121+
- new table for raw config is created for future build runs `request_raw_configs`.

0 commit comments

Comments
 (0)