engine icon indicating copy to clipboard operation
engine copied to clipboard

Migrate services between instances

Open MattiSG opened this issue 3 years ago • 1 comments

Create a script to migrate some services from one instance to another.

This script must take the configurations of a source storage adapter and a destination storage adapter as well as the list of services to migrate. It must be able to migrate both snapshots and versions and maintain a link between old and new identifiers.

The migration of declarations should not be handled by the script but, in the first instance, must be done manually.

Result of operation

Done by the script:

  • Erase snapshots related to services to migrate from the snapshots source repository.
  • Erase versions related to services to migrate from the versions source repository. The link between versions and snapshots should be preserved.
  • Add snapshots related to services to migrate into the snapshots destination repository.
  • Add versions related to services to migrate into the versions destination repository. The link between versions and snapshots should be preserved.

Done manually:

  • Erase declarations related to services to migrate from the source declarations repository.
  • Move declarations related to services to migrate and its history to the destination declarations repository.
    • If the declaration already exists in the destination, append to the history file in the destination repositories with the erased declaration.
  • Create a tag on the tip of the main branch in the source versions repository in order to preserve links.
  • Create a tag on the tip of the main branch in the source snapshots repository in order to preserve links.
  • Erase the local snapshots and versions copies on both instances.

MattiSG avatar May 03 '22 14:05 MattiSG

  • [x] Unify record IDs when the storage adapter is Git (currently, it is sometimes a long SHA and sometimes a short SHA).
  • [x] Let adapters define the storage mechanism based on the MIME type (currently, the Git adapter needs to get the file extension passed to it).
  • [x] Programmatically add README and LICENSE file, through a separate utils file (not in the Record API as it varies too much by storage mechanism).
  • [x] Expose a way to get all records.
  • [x] Expose a documented Record class to manipulate records.
  • [x] Document the StorageAdapter API.
  • [x] Write a script to migrate all records of a subset of services from one instance to the other, as defined in the message above.

MattiSG avatar May 17 '22 14:05 MattiSG