Copying Rates between Databases using ZIP Files
CSVUtil can be used to copy a rate offering, along with all of its prerequisite parent and child data from one database to another.
- Create a csvutil.ctl File for Exporting:
You create a CSVUtil control file containing commands, and then place it in a zip file whose name ends with .bg.zip; for example: exp_rate_offering.bg.zip. When the zip file name ends with “bg.zip”, it knows to run the export job in the background. Here are the contents of the csvutil.ctl file to export an entire rate offering:
-dataFileName rate_geo_out.csv -command xcsvwpcd -tableName RATE_GEO -whereClause "rate_offering_gid = 'MDIETL.ASDF'" -excludePublic N -mailTo customername@example.com -mailFrom customername@example.com -subject zipFileProcessDone -message hello -smtpHost mail.example.com
Note: There may only be two lines of text in the above example.- Place the csvutil.ctl file in a zip file called name.bg.zip, where name can be anything.
- The xcsvwpcd (export CSV with parent and child data) command will export the rate_geo records, and will recursively export all parent and child records. This can take a while (up to 8 hours).
- The -excludePublic N option means that referenced PUBLIC data will also be exported. If you are sure that your target database has all the required public data, then you can change this to Y, which will save some time on the export.
- Upload the Zip File Created in Step 1:
Use the Integration Upload Screen to upload the exp_rate_offering.bg.zip file. In response to your upload, you immediately receive a message indicating that your export job has been submitted to run in the background. You receive an email when the job completes. The email includes an HTML link to allow you to download the resultant zip file containing your multi-table export.
- Download the Rate Offering Zip File:
When you receive the email, download the zip file containing the rate offering and extract the rate_geo_out.csv file.
- Create a csvutil.ctl File for Importing:
Similar to step 1, you create another csvutil.ctl file for importing in the background. For example:
-dataFileName rate_geo_out.csv -command ii -mailTo customername@example.com -mailFrom customername@example.com -subject zipFileProcessDone -message hello -smtpHost mail.example.com
- Create Another Background Zip File:
Now create another zip file which will contain the csvutil.ctl file from the previous step, as well as the rate_geo_out.csv file which was exported during step 2. The zip file should again end with “bg.zip”.
- Upload the Zip File from Step 5 to the Target:
To import to the target instance, again use the integration upload screen to upload the background zip file to target instance. You again receive a response indicating that you will get an email when the job completes. The email will again contain a link to allow you to download a results zip file which contains a log file. You will need to examine the log file to see how the import did.
Note: If you are exporting from a migrated database to a fresh database, use the -removeUndefinedColumns option.This will tell CSVUtil to ignore deprecated columns.