Answers.Body: <p>Assuming your location types and phone types etc have the same ids, you should just be able to copy over the two tables, <code>mysqldump &lt;dbname&gt; civicrm_mapping civicrm_mapping_field &gt; somefile</code> and then import the file into the other site's mysql database. But note that will **** <strong>OVERWRITE</strong> **** any mappings that you had already set up in the new site.</p>
  
  <p>As noted in the comments there's some constraints so there's some extra steps:</p>
  
  <ol>
  <li>If using mysqldump, use <code>--skip-add-drop-table</code> and <code>--no-create-info</code>. In phpmyadmin uncheck the option to drop/create tables.</li>
  <li>In the new system do <code>TRUNCATE TABLE civicrm_mapping_field</code> then <code>TRUNCATE TABLE civicrm_mapping</code>.</li>
  <li>Import civicrm_mapping first, then civicrm_mapping_field.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T17:02:38.657Z
Answers.Text: 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.
Answers.UserDisplayName: gebseng
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T17:23:59.157Z
Answers.Text: 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.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-02T21:44:56.077Z
Answers.LastActivityDate: 2020-03-06T17:31:51.030Z
Answers.LastEditDate: 2020-03-06T17:31:51.030Z
Answers.UserDisplayName: Demerit
Body: <p>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.</p>
  
Tags: <import><field-mapping>
Title: Migrate Import/Export Mappings
ThreadText: # Migrate Import/Export Mappings
  
  (Asked by: username_0 on 2020-03-02)
  
  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.
  
  **Tags:** import, field-mapping
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-02. Score: 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  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.
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_1**: 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.  
  
  ---
  
  