Low commit activity in last 3 years
No release in over a year
Use Redis to record the data migration status
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0.2
>= 4.2.1
 Project Readme

Synchronised Migration

Gem Version Build Status

This gem makes it possible to deploy multiple instances with data migration simultaneously. It uses Redis to ensure that there will be only one migration running.

Usage

Migrating an application

bundle exec synchronised-migration migrate --config=migration.yml --version=1.2.3

Checking lock stats

bundle exec synchronised-migration status --config=migration.yml --version=1.2.3

Clearing locks

If a previous migration has failed a new one will not be allowed to start unless it is first cleared.

bundle exec synchronised-migration clear --config=migration.yml

If you wish to clear all locks, *including the running lock then you must also provide version

bundle exec synchronised-migration clear --config=migration.yml --version=1.2.3 --all

Configuration

Key Description
redis_uri Redis server to use for locking
application Application being migrated
version Version being migrated too
debug Enable additional debug information
command Command to execute for the migration
timeout_milliseconds Timeout to wait for the lock
retry_delay_milliseconds Retry for the lock every x milliseconds

Overriding config file options

You may override certain config options such as the redis-uri and the debug flag by providing them via cli options.

bundle exec synchronised-migration migrate --config=migration.yml --version=1.2.3 --redis_uri=redis://127.0.0.1:6379/0

Release

To publish a new version of this gem the following steps must be taken.

  • Update the version in the following files
      CHANGELOG.md
      lib/synchronised_migration/version.rb
    
  • Create a tag using the format v0.1.0
  • Follow build progress in GitHub actions