...
- After 1st sync it is required to enter secrets value represented by Tokens (in Versions Settings option).
Current list of secrets: - Instead of entering values in Tokens, it is possible to copy values from sources TeamCity instances as follows:
Search for credentialsJSON
settings in repository with settings
Code Block |
---|
|
grep -R 'credentialsJSON:' .teamcity/ | \
sed -r 's|(.):.param name="(.)".value="(.)" .|\1 :: \2=\3|' | \
sed -r 's| spec=.||' |
Search for occurrences of UUIDs in <source-teamcity-host>:/<teamcity-data-dir>/config/project
Code Block |
---|
|
cd /<source-teamcity-data-dir>/config/project
find . -name credentials.json | while read file; do
echo "${file}"
grep --color -E '(<UUID-1>|UUID-2|...|<UUID-n>)|$' "${file}"
done |
- Remove not matched UUIDs (they will not be colored) by editing files manually.
Copy updated credentials.json
files to some folder
Code Block |
---|
|
cd /<source-teamcity-data-dir>/config/project
mkdir -pv /tmp/credentialsJSON
find . -name credentials.json | while read file; do
cp -v --parents "${file}" /tmp/credentialsJSON
done |
Pack secrets in archive
Code Block |
---|
|
cd /tmp/credentialsJSON
zip -r ../credentialsJSON.zip * |
- Copy archive to target TeamCity instance
<source-teamcity-host>:/<teamcity-data-dir>/config/project
Find local secrets and remove them
Code Block |
---|
|
cd /<target-teamcity-data-dir>/config/project
find . -name credentials.json -exec rm -v {} \;
unzip credentialsJSON.zip * |
Restart TeamCity instance
Code Block |
---|
|
cd /<target-teamcity-server-dir>
bash bin/teamcity-server.sh stop
...
bash bin/teamcity-server.sh start |
- Check
/<target-teamcity-server-dir>/logs/teamcity-server.log
that TeamCity instance started correctly
Users / Groups / Roles
Synchronization of users, groups and roles requires separate export and import procedure.
Dump specific tables from source TeamCity database
Code Block |
---|
|
mysqldump --no-tablespaces -u teamcity -p teamcity ids_group \
ids_group_entity_id \
project \
project_mapping \
user_blocks \
user_build_parameters \
user_build_types_order \
usergroup_notification_data \
usergroup_notification_events \
usergroup_roles \
usergroups \
usergroup_subgroups \
usergroup_users \
usergroup_watch_type \
user_notification_data \
user_notification_events \
user_projects_visibility \
user_property \
user_roles \
users \
user_watch_type \
vcs_username > teamcity.sql |
- Copy
/<source-teamcity-data-dir>/config/roles-config.xml
Pack dump and configuration fail into archive
Code Block |
---|
|
zip -r users-groups-roles.zip teamcity.sql roles-config.xml |
- Copy archive to target TeamCity instance
<source-teamcity-host>
Unpack archive
Code Block |
---|
|
unzip users-groups-roles.zip |
- Place roles-config.xml to
/<target-teamcity-data-dir>/config/roles-config.xml
Restore specific tables (TeamCity and/or DB service stop is not required)
Code Block |
---|
|
mysql -u teamcity -p teamcity < teamcity.sql |
...
Travis CI
...
Backlog issues
- TC: Introduce automated instructions for preparing Linux and Windows agents.
- TC: Remove obsolete secret tokens.
- TC: Introduce Kotlin DSL based settings (instead of XML).