Recovery from Lost Master Key

If you accidentally delete or replace the sgtech_config.json file, then the master key is lost and the Spatial Studio application will throw an error.

The sgtech_config.json file includes a master seed property which contains the master key value that enables decryption of encrypted items such as database passwords. It is therefore recommended to backup your sgtech_config.json file in a safe location.

However, if you lose the sgtech_config.json file, then it is possible to recover from a lost master key by performing the following steps:

  1. Stop the Spatial Studio instance by running the following command from the application installation directory:
    ./stop.sh

    If you installed the application from the Cloud Marketplace, then use the following command:

    sudo systemctl stop spatialstudio
  2. Run the following command in your Spatial Studio repository using a SQL client (such as Database Actions, SQL Plus or SQL Developer):
    DELETE
        "SGTECH_OBJECT"
    WHERE
        "TENANTID" = 'GLOBAL'
        AND (
            "ID" IN ('id__sgtech.safe_text.magicword', 'id__sgtech.key_pair.rsa')
            OR "OBJECTTYPE" IN ('access_token', 'fileset_token')
        );
    COMMIT;
  3. Start Spatial Studio by running the following command from the application installation directory:
    ./start.sh

    If you installed the application from the Cloud Marketplace, then use the following command:

    sudo systemctl start spatialstudio
  4. Log into Spatial Studio as the admin user.
  5. Navigate to the Connections page.
  6. Right-click on each connection, select Edit, and re-enter the password for each connection.
  7. Optionally, if you had created a custom basemap with a separate API key, then re-enter the API Key by editing the required custom basemap.
    Click Basemaps under Settings to view and edit your custom basemap.
  8. Optionally, if you had created a 3D scene basemap with a separate API key, then re-enter the API Key by editing the required 3D scene basemap.
    Click 3D Scene basemaps under Settings to view and edit your 3D scene basemap.
Make sure to back up the sgtech_config.json configuration file safely this time so you do not have to repeat this process in the future.