Importing and Exporting Column Mappings
The Column Mapping Form has a feature to help save mappings once they have been created. In a replication, after finishing mapping the source columns to target columns, those mappings can be saved to a file by selecting Mapping -> Export. If something changes in the replication, and you wish to retrieve these saved mappings, you can select Mapping -> Import to bring them back into the replication.
After making changes to the default mappings in a replication, if the source or target table needs to be changed outside of replication, the built mappings can be saved, so the columns can be easily remapped after the change. Here are a few cases where it can save time to import column mappings:
When the target table is changed to a different table that has a similar schema. When pointed to the new target table, the replication will reset to the default column mappings.
When changing the source table results in a new replication.
When you export a mapping, the Column Mapping Form will prompt for a name and location of a file to save the mappings to. The mappings will be saved in a comma separated format, so they can be viewed and changed with a file editor.
To import a mapping, click Mapping -> Import, locate the mapping file you want to import, and press OK. The column mapper will try to apply all the mappings saved in the file to the open column mapping form. When importing, the mappings on the screen will be overwritten by the imported mappings. Columns mapped in the import file that are not on the screen will be added. Column mappings from the import file that cannot be resolved to the source and target table columns will not be added. The validation of the mappings is performed when the "Done" button is pressed on the column mapper, not on import. This gives the user the ability to change a mapping that was imported but has data that is out of date with the new table.
Example
1. A replication has a target table with column mappings that include target column renames and an expression on the source table. The user wants to point the replication source to a different target table. Since that will drop the existing column mappings, before changing the target table in the replication, go into the Column Map form and click Mapping -> Export. Press Done to go back to the main replication screen.
2. After changing the target table on the replication, open the Column map for that replication. The Column map will show the default column mappings. Import the previously exported column mappings by clicking Mapping -> Import and selecting the file you created in 1.
3. Verify that the new mappings from the import are what was desired and select Done to validate the mappings.