I didn't get much time into this tonight.
I am only doing Exports from the PE.
1. Exported DB, copied annex_a1.csv and annex_magsEx.csv to a separate location for later comparison as annex_a1_Export_01.csv and annex_magsEx_Export_01.csv.
2. Exported DB again without changing anything in the PE. Copied annex_a1 and mags again this time as Export_02.
3. Compared the csv files, no changes. So this at least means the export isn't totally random.
4. Added one item to the first ship's magazine (an ordnance pallet to the end of the magazine list entries for ship id 2048 wielingen.
5. Exported DB, copied a1 and mags to Export_03.
6. Compared the 02 files to the 03 files, the renumbering in a1 makes total sense, magazine inserted and magazine numbers adjusted. magsEx did not make sense, ordering seems all messed up.