Ready to get started?

Learn more about CData Sync or sign up for a free trial:

Learn More

Automated Continuous USPS Replication to MySQL

Use CData Sync for automated, continuous, customizable USPS replication to MySQL.

Always-on applications rely on automatic failover capabilities and real-time data access. CData Sync integrates live USPS data into your MySQL instance, allowing you to consolidate all of your data into a single location for archiving, reporting, analytics, machine learning, artificial intelligence and more.

Configure MySQL as a Replication Destination

Using CData Sync, you can replicate USPS data to MySQL. To add a replication destination, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select MySQL as a destination.
  3. Enter the necessary connection properties. To connect to MySQL, set the following:
    • Server: The IP address or domain name of the server you want to connect to.
    • Port: The port where the server is running.
    • User: The username of a user with read/write access to the database.
    • Password: The password of a user with read/write access to the database.
    • Database: The name of the database.
  4. Click Test Connection to ensure that the connection is configured properly.
  5. Click Save Changes.

Configure the USPS Connection

You can configure a connection to USPS from the Connections tab. To add a connection to your USPS account, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select a source (USPS).
  3. Configure the connection properties.

    To authenticate with USPS, set the following connection properties.

    • PostageProvider: The postage provider to use to process requests. Available options are ENDICIA and STAMPS. If unspecified, this property will default to ENDICIA.
    • UseSandbox: This controls whether live or test requests are sent to the production or sandbox servers. If set to true, the Password, AccountNumber, and StampsUserId properties are ignored.
    • StampsUserId: This value is used for logging into authentication to the Stamps servers. This value is not applicable for Endicia and is optional if UseSandbox is true.
    • Password: This value is used for logging into Endicia and Stamps servers. If the postage provider is Endicia, this will be the pass phrase associated with your postage account. It is optional if UseSandbox is true.
    • AccountNumber: The shipper's account number. It is optional if UseSandbox is true.
    • PrintLabelLocation: This property is required to use the GenerateLabels or GenerateReturnLabels stored procedures. This should be set to the folder location where generated labels should be stored.

    The Cache Database

    Many of the useful task available from USPS require a lot of data. To ensure this data is easy to input and recall later, utilize a cache database to make requests. Set the cache connection properties in order to use the cache:

    • CacheLocation: The path to the cache location, for which a connection will be configured with the default cache provider. For example, C:\users\username\documents\uspscache

    As an alternative to CacheLocation, set the combination of CacheConnection and CacheProvider to configure a cache connection using a provider separate from the default.

  4. Click Connect to ensure that the connection is configured properly.
  5. Click Save Changes.

Configure Replication Queries

CData Sync enables you to control replication with a point-and-click interface and with SQL queries. For each replication you wish to configure, navigate to the Jobs tab and click Add Job. Select the Source and Destination for your replication.

Replicate Entire Tables

To replicate an entire table, click Add Tables in the Tables section, choose the table(s) you wish to replicate, and click Add Selected Tables.

Customize Your Replication

You can use the Transform feature to customize your replication. The Transform feature allows you to specify which columns to replicate, rename the columns at the destination, and even perform operations on the source data before replicating. To customize your replication, click the Transform button in the Tables section and customize the replication.

Schedule Your Replication

In the Schedule section, you can schedule a job to run automatically, configuring the job to run after specified intervals ranging from once every 15 minutes to once every month.

Once you have configured the replication job, click Save Changes. You can configure any number of jobs to manage the replication of your USPS data to MySQL.