Issue exporting and importing Contacts / Membership data
We had a similar problem importing from an old (non CiviCRM system) and I wanted to make the old membership numbers the Contact ids on the new CiviCRM system. Fortunately membership numbers 1 &amp; 2 were not in use so no clash with the initial admin and organisation contact records. There were some gaps in the old membership numbers and I was also quite happy that new Contact ids would also include none members. All I needed was for them to be unique and increasing.

In my contact import file, I added dummy records for all the missing Contact ids (except 1 &amp; 2) and added an "ZZZZ" in the last name field with the rest of the fields in a valid format, but meaningless. I imported real and dummy records matching Contact Id as (new) External Id and then deleted the records with "ZZZZ" in the last name. All the kept new records have the same Contact Id as the old system membership numbers (or old Conact Id in your case.

If the expanded import file is very large, you will probably need to split it to avoid timeouts.

You can then use the Contact Id to match the membership records.

Hope that helps.