Project to migrate Cumulocity Software objects towards new model introduced in v 10.7

About

Tool to migrate the software repository entries prior to Cumulocity v10.7 to the new Software Repository package model including Software Versions. The tool supports the migration of single tenants and a bulk migration of multiple tenants at once.

Usage

  1. Clone the git repositoy to your localhost: git clone https://github.com/ButKor/c8y-sw-migration.git

  2. Jump into cloned project: cd c8y-sw-migration

  3. Build the docker image: docker build -t swmigration .

  4. Run container: docker run --publish 8085:8085 swmigration

  5. Start migration via a POST request to:

Endpoint: https://localhost:8085/tenants/migration
HTTP Method: POST

Body Type: text/plain
Content (sample):

url,user,pass
"https://example1.cumulocity.com","[email protected]","my-super-secret-password"
"https://example2.cumulocity.com","[email protected]","my-other-secret-password"

start-migration

  1. Use below Endpoint to monitor the job execution: GET https://localhost:8085/jobs/status

job-overview

Notes:

  • Above endpoint shows the output for all migration jobs started since the container is running, they will be forgotten once it is restarted

  • The "status" field indicates the job success, if everything went well it is "COMPLETED", in case of issues "COMPLETED_WITH_ERRORS"

  • The error- and warnlog describes all issues across all provided tenants

  • The audit field tells

    • which software entities were actually migrated for each tenant

    • which software entities were found but not migrated (e.g. as they are already in the new model)

  1. Optionally, an endpoint to fetch Logs is available: GET https://localhost:8085/logs, it will respond with error- and runtimelogs as plain text.

logs

In case of issues, feel free to reach out.

App Logic

Essentially the script does:

  1. Fetch all old software objects (once a software object has no childAdditions, it is considered as being the old domain model)
  2. Group these softare objects by name
  3. For each of these groups: 3.1 Create a (new) single software entry with the given software name 3.2 Create a new software version for each 'old' software object with the same name 3.3 Assign the software version to the software package created in 3.1 3.4 "Burry" the old software object by changing its type to c8y_SoftwareDeprecated and adding a migration note to the Inventory Object 3.5 Log action in platforms audit log

Below activity diagram shall illustrate the process:

logicalview-flowdiagram

Rollback

The existing Software Objects are not deleted but only burried by changing it's types. Thus, a rollback is possible at any time. To do so, two things need to be done:

  • The newly created Software Repository entries shall be deleted (either manually or via script)

  • Do the following call to each object of type c8y_SoftwareDeprecated (either manually or via script):

Fetch all deprecated inventory objects

GET https://kobu.latest.stage.c8y.io/inventory/managedObjects?type=c8y_SoftwareDeprecated

For each of them:

PUT /inventory/<<mangedObjectId>>
{
    "type": "c8y_Software",
    "status": null,
    "note": null,
}
Similar Resources

This app is an attempt towards using go lang with graphql data fetch in react front end.

go_movies _A React js + GraphQL supported with backend in GoLang. This app is an attempt towards using go lang with graphql data fetch in react front

Dec 7, 2021

Spawning up Decoy Server in case of any fraudulent activity and directing the intruder towards the decoy. Auto Killing the decoy if it is idle for too long.

Spawning up Decoy Server in case of any fraudulent activity and directing the intruder towards the decoy. Auto Killing the decoy if it is idle for too long.

SecureX Spawning up Decoy Server in case of any fraudulent activity and directing the intruder towards the decoy. Auto Killing the decoy if it is idle

Jul 9, 2022

Application open new tab in chrome when your favourite youtuber add new video.

youtube-opener This application open new tab in Chrome when your favourite youtuber add new video. It checks channel every one minute. How to run go r

Jan 16, 2022

Argus is a lightweight monitor to notify of new software releases via Gotify/Slack messages and/or WebHooks.

Argus Argus will query websites at a user defined interval for new software releases and then trigger Gotify/Slack notification(s) and/or WebHook(s) w

Dec 23, 2022

Code your next Go web project with (a) Mojito! No matter if its an API or a website, go-mojito assists you with dependency injection, simple routing, custom request / response objects and template rendering

 Code your next Go web project with (a) Mojito! No matter if its an API or a website, go-mojito assists you with dependency injection, simple routing, custom request / response objects and template rendering

Go-Mojito is a super-modular library to bootstrap your next Go web project. It can be used for strict API-only purposes as well as server-side renderi

May 1, 2022

Bootstrap a new project from a template.

Go Starter Go-starter allows to bootstrap a new project from a template. It uses Git repositories as templates and is shipped with batch of utilities

Oct 20, 2022

✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

Dec 31, 2022

Broilerplate - A template project for new Go web backend applications

Broilerplate - A template project for new Go web backend applications

Broilerplate A template project for new Go web backend applications. Can be used

Mar 28, 2022

Fab - fabricate a new project from a template... in a fabulous way

fab fabricate a new project from a template... in a fabulous way :-) setup The f

Jun 1, 2022

Conception was an experimental project, looking for ways to make software development more efficient.

Conception was an experimental project, looking for ways to make software development more efficient.

Conception Note: All future development is done in the Go version. Conception is an experimental research project, meant to become a modern IDE/Langua

Jul 21, 2022

Project developed for the course Software Systems Analysis and Design (SSAD) at IU in F21 semester.

Go knowledge yield summary Project description Project developed for the course Software Systems Analysis and Design (SSAD) at IU in F21 semester. Eva

Sep 17, 2022

Moby: an open-source project created by Docker to enable and accelerate software containerization

Moby: an open-source project created by Docker to enable and accelerate software containerization

The Moby Project Moby is an open-source project created by Docker to enable and accelerate software containerization. It provides a "Lego set" of tool

Dec 10, 2021

Ground control - Ground station software for my rover project (Mk II)

Prototype rover ground station code About This is part of a second iteration of a rover vehicle (the first being https://github.com/DanCrank/tank-bot-

Jan 3, 2022

auto generate sql from gorm model struct

gorm2sql: auto generate sql from gorm model struct A Swiss Army Knife helps you generate sql from gorm model struct. Installation go get github.com/li

Dec 22, 2022

A course to build distributed key-value service based on TiKV model

A course to build distributed key-value service based on TiKV model

The TinyKV Course This is a series of projects on a key-value storage system built with the Raft consensus algorithm

Jan 7, 2023

Membin is an in-memory database that can be stored on disk. Data model smiliar to key-value but values store as JSON byte array.

Membin Docs | Contributing | License What is Membin? The Membin database system is in-memory database smiliar to key-value databases, target to effici

Jun 3, 2021

🏛 A scriptable financial ledger, designed to make it easy to model complex financial transactions

🏛 A scriptable financial ledger, designed to make it easy to model complex financial transactions

Numary Ledger Numary is a programmable financial ledger that wants to make building financial apps safe, fun and cheap. Building financial software is

Dec 27, 2022

Collect gtfs vehicle movement data for ML model training.

Transitcast Real time transit monitor This project uses a static gtfs static schedules and frequent queries against a gtfs-rt vehicle position feed ge

Dec 19, 2022
CRUDist Model Driven Web Development. Automagically generate CRUD APIs from your model.

CRUDist - Model Driven API Development Automagicaly create CRUD APIs for your gorm models. Example Model definition type BaseModel struct { ID

Nov 15, 2021
Transmo - Transform Model into another model based on struct for Go (Golang).

Transmo Transmo is a Go library for transform model into another model base on struct. This library detect your field name to copy that into another m

Jan 7, 2022
Functional tools in Go 1.18 using newly introduced generics

functools functools is a simple Go library that brings you your favourite functi

Dec 5, 2022
CLI to migrate Terraform Configuration and State

tfmigrator CLI CLI to migrate Terraform Configuration and State. The migration feature is implemented with tfmigrator/tfmigrator, so please see the do

Dec 14, 2022
Reusable golang-migrate library using cobra utility

shift Reusable golang-migrate library using cobra utility Example Usage package main import ( "sql/db" "github.com/purwandi/shift" "github.com

Dec 16, 2021
Terraform-equinix-migration-tool - Tool to migrate code from Equinix Metal terraform provider to Equinix terraform provider

Equinix Terraform Provider Migration Tool This tool targets a terraform working

Feb 15, 2022
Dabulang is an interpreted object-oriented programming language aimed towards game development.

Dabulang (ダブ言語) Dabulang is an interpreted object-oriented programming language aimed towards game development. The language's standard library has a

Sep 14, 2022
Mmark: a powerful markdown processor in Go geared towards the IETF

title date aliases About 2018-07-22 14:05:51 +0100 /about/ Mmark is a powerful markdown processor written in Go, geared towards writing IETF documents

Dec 30, 2022
Default godoc generator - make your first steps towards better code documentation

godoc-generate Overview godoc-generate is a simple command line tool that generates default godoc comments on all exported types, functions, consts an

Sep 14, 2022
Working towards a control plane for the MiCo Tool and the MiCoProxy

A simple control plane for MiCo This is still largely a work in progress The overall idea is to build a kubernetes DaemonSet that watches kubernetes s

May 4, 2022