3.2.6 Create factory reset reference data backups
Provided that the import script in step 3.2.5 Import set up files ran successfully, OpenCRVS is now installed with reference data for your country (administrative divisions and statistics, your civil registration offices, your health facilities and your employees for development or production)
Before you login and start to configure your application using the UI and before you create registrations and an audit trail, we can make a factory reset backup of your databases so that you can restore everything to an empty state with your reference data as it was now.
This is a very helpful backup for iterative development and you can run this command as often as you like to get a snapshot of your databases for restoring.
  1. 1.
    To begin with, OpenCRVS Core must be running, but it is not necessary for your country configuration server to be running. This should be the case already if you have just finished step 3.2.5 Ensure that OpenCRVS Core is running following the steps in 3.1.3 Starting and stopping OpenCRVS.
  2. 2.
    Open a new Terminal window when OpenCRVS Core is running and cd inside your country configuration repo directory. E.G: cd opencrvs-farajaland
  3. 3.
    Ensure that node_modules are installed by running yarn --force
  4. 4.
    Run this command to create new factory reset zips for your future use. yarn db:backup:create When this command completes you will notice new files changed in your country configuration folder here.
  5. 5.
    Commit and push everything up to your repo on Git to save this backup installation.
Note: Our Github actions will automatically restore from these backups in the server deployment commands in OpenCRVS Core. This process is explained in Step 3.3.6 Deploy.
Note: Running the following 2 commands in sequence in the country configuration repo alongside a running OpenCRVS Core instance at any time, will clear out all your databases from whatever state they are in and restore from these backups. So these are destructive actions. Be aware.
yarn db:clear:all
yarn db:backup:restore
Copy link