Is there a way to migrate the saved Import/Export Mappings to a different CiviCRM installation? It seems there is no way to export them. I already tried copying the .php files located at /bin/migrate, but the settings did not show up when I tried to import something in the new installation.

1 Answer 1


Assuming your location types and phone types etc have the same ids, you should just be able to copy over the two tables, mysqldump <dbname> civicrm_mapping civicrm_mapping_field > somefile and then import the file into the other site's mysql database. But note that will **** OVERWRITE **** any mappings that you had already set up in the new site.

As noted in the comments there's some constraints so there's some extra steps:

  1. If using mysqldump, use --skip-add-drop-table and --no-create-info. In phpmyadmin uncheck the option to drop/create tables.
  2. In the new system do TRUNCATE TABLE civicrm_mapping_field then TRUNCATE TABLE civicrm_mapping.
  3. Import civicrm_mapping first, then civicrm_mapping_field.
  • Thanks! Since I don't have SSH access, I tried doing this with phpMyAdmin. I first exported the two tables to two separate files (civicrm_mapping.sql.gz and civicrm_mapping_field.sql.gz). But when I tried to import the tables to the new SQL database in phpMyAdmin, I first got a "table already exists" error. I then deleted the two (empty) tables and then tried to import the two tables again from the files. This time, I got "#1215 - Cannot add foreign key constraint" errors. I tried to uncheck the "Enable foreign key checks" Option while importing, but that did not help either.
    – gebseng
    Commented Mar 6, 2020 at 17:02
  • At a minimum your location types and relationship types will need to be the same in both systems, with the same internal ids. Are they the same? Also the mapping table would need to be imported before the mapping_field one, since the second depends on the first.
    – Demerit
    Commented Mar 6, 2020 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.