Cave re-labelling from unofficial identifier to official Kataster number

Cave 1623-2015-dl-02 'Chossy Death Slope Höhle'

This cave needs to be "katastered". If you have the new number issued by the Austrians, we can do it now.

Rename the .html files in expoweb

cave_data/1623-2015-dl-02.html
   <kataster_number></kataster_number>
    → <kataster_number>9999</kataster_number>
   <survex_file>caves-1623/2015-dl-02/1.svx </survex_file>
    → <survex_file>caves-1623/9999/9999.svx </survex_file>

entrance_data/1623-2015-dl-02.html

Rename the cave description directory in expoweb


Rename the survex directory in loser

caves-1623/2015-dl-02/

   gmh.svx
   1.svx
   2.log
   2.3d
   3c.err
   3b.svx
   1.3d
   3c.log
   3b.log
   3c.3d
   3a.3d
   1.log
   gmh.3d
   3c.svx
   gmh.log
   3a.svx
   2.svx
   1.err
   gmh-or-shaggedspit.txt
   3a.log
   3b.3d
   gmh.err

Here are all the survex files which are involved with this cave, the first one on this list should be the same as the one shown above. Any others will need fixing manually:
caves-1623/2015-dl-02/gmh.svx
caves-1623/2015-dl-02/1.svx
caves-1623/2015-dl-02/2.svx
caves-1623/2015-dl-02/3a.svx
caves-1623/2015-dl-02/3b.svx
caves-1623/2015-dl-02/3c.svx

Sort out the *fix point(s) in both loser and in expoweb

Without fully parsing the entire survex *include tree (which this code does not do), it is impossible to find the *fix declaration file from the 'station' fields in the entrance_data files. However we conventionally store the *fix in a "known" place, so we try.

Edit these Entrance files:

Check the wallet links to survex files in drawings

Edit these Wallet files

and if any of them are any of these survex files:
caves-1623/2015-dl-02/gmh.svx
caves-1623/2015-dl-02/1.svx
caves-1623/2015-dl-02/2.svx
caves-1623/2015-dl-02/3a.svx
caves-1623/2015-dl-02/3b.svx
caves-1623/2015-dl-02/3c.svx
then the wallet needs editing: do this online (click on the wallet id link above) before you run any of the katastering script. Doing it online will also do all the git commit stuff for you.

If doing this manually, it is much easier to do this using the online wallet edit form than to mess with the raw format of the JSON files, which we never touch and so will be unfamiliar to everyone.

Set the historic alias forwarder in expoweb

This will cause lots of errors until the cave "1623-9999" has been created by a full database reset OR we can do an online rename of the "Cave" object in the database [code yet to be written] by pressing this button [button not yet implemented].

Finally

Ideal scenario

Ideally you do this renumbering on a standalone instance of troggle running on a troggle development laptop and you don't push any of the git commits to the server until you have got all the niggles out of the conversion, i.e. the databaseReset runs locally without any warnings or errors introduced by your renaming and 'cavern' runs without any new survex errors.

Copy this script and edit it to match the directory names on your PC