How to restart the fabric composer without losing the existing data?

The startFabric.sh under fabric-dev-servers (formerly fabric-tools) does more than just start the Fabric – it removes existing Fabric Containers and recreates new Containers from the Docker Images. The impact of this is that you lose all your data and your Business Network from the Fabric. All Business Network Cards except PeerAdmin@hlfv1 are now useless.

If you want to stop and start your Fabric after you have created it, retaining your Business Network and data follow these commands:

  • Change to the directory where the docker-compose.yml file is (e.g. /home/<user>/fabric-tools/fabric-scripts/hlfv1/composer)
  • Run docker-compose stop to top the Fabric Containers
  • Run docker-compose start to restart where you left off.

It is necessary to be in the correct folder before using the docker-compose command.

VERSION UPDATE

With Composer v0.20.x (for Fabric 1.2) the folders’ names/version have changed:

/home/<user>/fabric-dev-servers/fabric-scripts/hlfv12/composer

With Composer v0.19.x (older, for Fabric v1.1) the folders names/versions have changed:

/home/<user>/fabric-dev-servers/fabric-scripts/hlfv11/composer

Leave a Comment