How to write Production Procedure for Uploading Firmware and Configurations

I am creating a procedure for uploading firmware created in Mongoose OS to an ESP32. The procedure should look like this:

  1. Upload the test firmware.
  2. Test the electronics on a functional tester.
  3. Retrieve the ESP32 MAC number through the testing software using the ‘mos call Sys.GetInfo’ command.
  4. Enable flash encoding.
  5. Upload the production firmware.
  6. Upload my ‘conf5.json’ file with the hardware configuration (we have several hardware versions and one firmware).
  7. Upload the keys to AWS and mDash.
  8. Upload the license key.
  9. Save the production information in our database.
  10. Disable RPC for UART and HTTP.

However, I have a problem with permanently uploading the AWS configuration. Both the ‘aws-iot-setup’ and ‘mdash-setup’ commands save the configuration in the ‘conf9.json’ file, which is deleted when the device is reset to factory settings. Is there a way to save it directly to another file, such as ‘conf6.json’, or do I have to download ‘conf9.json’, rename it to ‘conf6.json’, and then upload it using the ‘mos put conf6.json’ command?

Is there a simpler or better way to do this?