Hi Simon,
Very strange - generally, there should be a column on archival description exports called referenceCode. This column is ignored on import, since reference codes in AtoM are built using inheritance from parent descriptions and the repository code, etc. How are you running the export - via the command-line, or the user interface? They should be the same, but there is a small chance that for some reason they are not.... you might try running an export from the source you are not currently using (e.g. if you were running CLI exports, try adding some descriptions to the clipboard and exporting via the user interface including all descendants - or vice versa) to compare them.
Given that 2.7.0 and later now should include both the reference code AND the slug on export as Anna was originally looking for in a CSV, one option might be to upgrade to the latest version (2.7.3) - or, if the need isn't urgent, you could until the new year as AtoM 2.8 should be released in early 2024.
Finally, you could try double-checking your settings and running some maintenance tasks once more, to see if it helps. Some considerations:
- If the SLUGS seem more correct than the reference codes, then perhaps there is an issue with the nested set, which helps manage hierarchical relations in the relatively flat, table-like structure of the SQL database. You can try rebuilding the nested set, clearing caches, restarting PHP-FPM, and repopulating the search index to see if it resolves the issue
- If you are using slashes in your reference codes (either forward or backward slashes - / or \ ), these will NOT be recreated when generating the slug, as these are reserved characters in URIs
- Double-check that reference code inheritance is turned on in the settings, and review the docs so you are clear on how it works
- To ensure the closest match between slugs and reference codes, you should probably make sure that the setting to use any valid URI character in slug generation is enabled if it's not already
- Double-check the Generate description permalinks from setting for descriptions as well - there are at least 2 different options for generating from the reference code that can influence the outcome
- Spot check some description hierarchies with your permalink generation setting in mind. Keep in mind that if some intermediary levels of description do not have identifiers, then that will impact how reference code inheritance works, and could lead to unexpected outcomes if there are multiple intermediary levels without identifiers. Similarly, if you are generating permalinks / slugs from the reference code INCLUDING the repository country code and identifier, but your repository record lacks a country in the address or an identifier, this could also lead to a mismatch.
- Make sure you run the nested set rebuild task and have checked your settings before trying the slug generation task again
- When you do run the slug generation task, be sure to use the --delete option - otherwise it will ONLY update records that are missing a slug
That's all I can really think of for now! Apologies if all of the above is obvious and things you have already tried or are aware of - just trying to rule out possible causes. Let us know how it goes!