Sent email announcement to openqa.suse.de. Saving backup of all job templates with openqa-dump-templates --full --json --host openqa.suse.de > openqa_templates_osd-$(date +%F).json && openqa-dump-templates --full --host openqa.suse.de > openqa_templates_osd-$(date +%F).pl
, saved in https://w3.nue.suse.com/~okurz/openqa_osd_backup_job_templates_before_switch_to_yaml_poo57845/
I did a dry-run of the migration with
for i in $(ssh openqa.suse.de "sudo -u geekotest psql --no-align --tuples-only --command=\"select id from job_groups where template is null order by id;\" openqa") ; do curl -s http://openqa.suse.de/api/v1/job_templates_scheduling/$i | openqa-client --json-output --host http://openqa.suse.de job_templates_scheduling/$i post --form schema=JobTemplates-01.yaml preview=1 template="$(cat -)"; done | tee migration_preview.log 2>&1
and have received entries like
{
"id" : 1,
"preview" : 1
}
for all job groups. I guess this is a good sign.
And a live change with
for i in $(ssh openqa.suse.de "sudo -u geekotest psql --no-align --tuples-only --command=\"select id from job_groups where template is null order by id;\" openqa") ; do curl -s http://openqa.suse.de/api/v1/job_templates_scheduling/$i | openqa-client --json-output --host http://openqa.suse.de job_templates_scheduling/$i post --form schema=JobTemplates-01.yaml template="$(cat -)"; done | tee migration.log 2>&1
All done. Database query select count(id) from job_groups where template is null;
returns 0 job groups left. The ids of all job groups converted can be found in https://w3.nue.suse.com/~okurz/openqa_osd_backup_job_templates_before_switch_to_yaml_poo57845/ as well.