[#1792] Fix get_all_resources_ids_in_datastore() on legacy mode