How to import data from CouchDB to Magento 2

- E-Commerce, Magento 2, Our extensions

Magento 2 CouchDB Data Import

We’ve already described how to move data from Couchbase to Magento 2, and this time it is necessary to explore conditions related to its predecessor – CouchDB. Below, we shed light on how to import a remote CouchDB table to Magento 2 in two absolutely different ways. Let’s get started!

'

The Common Way of Moving CouchDB Tables into Magento 2

As you might have already guessed, the traditional approach to moving CouchDB bases to Magento 2 is based on the same three steps as we mentioned in the article dedicated to the Magento 2 Couchbase integration. Firstly, you have to create a CSV output. Secondly, it is necessary to edit the file. Thirdly, you can finally import the information from CSV to Magento 2.  

CSV Export from CouchDB Database

Below, we explore the first step of moving a remote CouchDB table into Magento 2. Since Magento is limited to CSV files only, you have to create an output file using this file format only. Use the following syntax to export a table to a CSV file:

Note that there is “csv:” before the name of the CSV file. Unfortunately, this snippet is suitable for a relatively flat document structure. You need to export a JSON file that represents far more complex data structures than CSV including arrays and sub-documents. With cbtransfer, you will not unravel those. Thus, exporting to CSV is not an ideal format, but we are exploring the universal approach to moving CouchDB tables to Magento 2 which is bound to this format.

Map Third-Party Attributes to Magento 2 Attributes

Next, you should edit the content of the exported file. First of all, it is necessary to prevent further errors caused by unknown attributes. Since Magento 2 has its standards related to the way data is stored in a database, you need to adapt the external file to them. So open your CSV file and start reviewing and editing it.
Additionally, you can edit attribute values. Otherwise, new designations will appear on your frontend, and you will need to replace them manually from the admin section of your e-commerce store.

Both processes are extremely time-consuming and boring, but they are inevitable if you want to import the generated CSV file successfully.

Import CouchDB Table into Magento 2

The import itself is the easiest part of the process. You can use the default tools to complete the data migration. Note that the process cannot be automated and you have to repeat all the three steps from the very beginning every time a new update is provided. And there is a more efficient way of achieving the same goal. But check the following Magento 2 import guide to discover proper attributes and other nuances of the successful data migration: The Complete Guide to Magento 2 Product Import / Export.

Magento 2 Product Import Export Tutorial

Pros & Cons

Since we are talking about the traditional algorithm of data migration, the pros and cons of this approach to data import are quite obvious, but let’s focus our attention on them once again.

Pros

  1. Magento 2 CouchDB data import.

The only positive aspect here is the completion of our final goal: you establish the connection between the two systems. No matter which way you look at it, but the ability to complete the import process is what led you here. Unfortunately, the default procedure is far from being efficient, intuitive, and user-friendly.

Cons

  1. Limited CSV export capabilities;
  2. Complicated export process;
  3. Time-consuming editing of attributes and their values;
  4. Import capabilities limited by the default Magento 2 functionality;
  5. All the three steps should be re-applied from the very beginning during every update.

These reasons are enough for discovering a more user-friendly way of importing data from CouchDB to Magento 2, and below we’ve prepared one.

The Easy Way of Moving CouchDB Bases into Magento 2

Magento 2 mysql data import

Since all the problems mentioned above are solved by a third-party extension, meet the Improved Import & Export Magento 2 plugin. This tool dramatically enhances the aforementioned procedure of importing data from CouchDB to Magento 2. Thus, you rich the same goal without any sacrifices. At the same time, our extension is oriented towards all possible integrations with external systems becoming your number one time-saver for data transfers.

CouchDB Database Connection

The first significant benefit provided by the Improved Import & Export module is the ability to connect to the database directly. Thus, you eliminate the first two steps of the traditional approach: CSV export and data file editing. What else does the import and export tool offer?

Magento 2 CouchDB Data Import

First of all, it lets you automate all updates. It is possible to create a schedule to launch import processes on the specified time. Additionally, you can select events that will trigger the updates. Both features are described further in this post.

And since the direct connection doesn’t solve the problem of different attributes, the Improved Import & Export Magento 2 extension offers several ways to fix it. You can either apply mapping presets or match external attributes to ones used internally within a user-friendly interface. The ability to map or edit attribute values is provided as well. The corresponding section of this article fully describes these features.

How to import data from CouchDB to Magento 2

The data import process from CouchDB to Magento 2 with the help of Improved Import & Export is very straightforward. The default procedure is reduced to the following three steps:

  1. Visit your Magento admin, go to the Improved Import & Export extension, open its import section, and create a new import job there.
  2. Specify parameters required for the connection to the CouchDB database, map attributes, create a schedule, and configure other settings if needed;
  3. Save and launch the profile.

As you can see, the Improved Import & Export extension dramatically decrease the time and effort necessary to connect your Magento 2 website to CouchDB. Since the process is fully automated, you prevent further time expenditures as well!

Pros & Cons

Let’s see what pros and cons the Improved Import & Export module offers when it comes to the Magento 2 CouchDB integration:

Pros

  1. User-friendly Magento 2 CouchDB integration;
  2. The direct connection between the two systems;
  3. No file export/import processes;
  4. No file editing;
  5. Fast attributes matching;
  6. Attribute values matching and editing;
  7. Fully automated data transfers.

Cons

The only drawback is the necessity to install a third-party module. But with our friendly support, this aspect is more related to the pros than cons. Contact us, and the Firebear team will help you solve any difficulties related to the installation. Furthermore, we can even discuss your particular customizations to the module’s functionality and their further implementation!

Below, the Improved Import & Export Magento 2 extension is described in more detail, but let’s take a look at CouchDB’s features first.

Get Improved Import & Export Magento 2 Extension

 

CouchDB Facts

Magento 2 CouchDB Data Import

CouchDB is often compared with MongoDB, Couchbase, and Cassandra. Being a native JSON document store, it is scalable from globally distributed server-clusters down to mobile phones. Let’s take a look at other features of CouchDB:

  • Its developer is Apache Software Foundation;
  • The database exists since 2005;
  • The latest release is 2.2.0, August 2018;
  • The license model behind the database is Open Source;
  • No cloud-based options are offered;
  • The implementation language of CouchDB is Erlang;
  • Server operating systems include Android, BSD, Linux, OS X, Solaris, and Windows.
  • The data scheme is schema-free;
  • There is no support for typing, XML, and SQL;
  • Secondary indexes are represented;
  • APIs and other access methods include RESTful HTTP/JSON API;
  • Supported programming languages include C, C#, Erlang, Java, JavaScript, Objective-C, Perl, PHP, Python, Ruby, and many others;
  • Server-side scripts are represented by view functions in JavaScript;
  • Triggers are available;
  • Partitioning methods include sharding;
  • Replication methods are represented by master-master and master-slave replication;
  • MapReduce is available;
  • Consistency concepts are represented by Eventual Consistency;
  • No foreign keys and transaction concepts are available;
  • Concurrency and durability features are represented in CouchDB;
  • In-memory capabilities are not available;
  • Access rights for users can be defined per database.

Improved Import & Export Magento 2 Extension

Magento 2 oracle import

Now, when you are familiar with the Magento 2 Couchbase integration and know several important facts about the database, we can concentrate on features of the Improved Import & Export extension that significantly improve every data transfer.

Automated Import & Export Processes

As we’ve already mentioned, you can easily automate every integration with the help of our module. It is only necessary to configure the corresponding options of an import or export profile. So, what does Improved Import & Export offer?

Schedules

Due to cron support, our extension lets you create any custom schedule of updates. The default syntax should be used. If you don’t want to deal with it, select one of the predefined intervals which are fully customizable as well.

At the same time, the Improved Import & Export module provides the ability to create profiles that have no schedule. They are especially helpful for one-time migrations or transfers that have no schedule. If you are moving products or customers from your old store, there is no need to create a schedule.

Also, note that every scheduled profile can be launched manually if your partner delayed the update. There is no need to wait until the next planned process – click a few buttons to start the update.

Below, you can see how to configure a schedule section:

Events

Alternatively, the Improved Import & Export extension provides the ability to leverage Magento 2 events and observers to automate data updates. Select a system or custom process that will be used as a trigger. For further information about this feature, follow this link: How to Run Magento 2 Import or Export After Specific System Event or Process.

Advanced Mapping Features

Now, when your data transfers are automated, we should solve the problem of different attribute standards to eliminate possible errors.

Mapping Presets

First of all, the Improved Import & Export Magento 2 extension allows you to apply mapping presets. You only have to select a scheme suitable for your integration. Next, the module will analyze the input data and match all third-party attributes to ones used in your database. Below, you can see how this feature works as exemplified by the migration from Magento 1 to Magento 2:

Matching Interface

If a certain preset is not available, the Improved Import & Export extension provides the ability to match attributes manually right within your Magento 2 admin. Select a third-party designation and specify a native one in front of it. The following gif image illustrates how simple the process is:

And note that it is possible to add a hardcoded value that is attached to all items related to the attribute.

Attribute Values Mapping

The logic described above can be applied to attribute values as well. Select an external designation and map it to the one used internally. Thus, you will prevent yourself from a further headache caused by manual values editing in the admin interface. For further information about the feature, follow this link: Attribute Values Mapping.

Attribute Values Editing

To increase the efficiency of your routine related to data transfers, we’ve also introduced the ability to edit attribute values in bulk. First of all, the Improved Import & Export Magento 2 extension lets you improve external designation by adding a prefix to them. At the same time, you can edit multiple values by specifying a suffix that should be added to them. Both tools can be applied simultaneously.

Furthermore, if multiple attribute values are merged, you can create rules to split them. The opposite process is possible as well. The following article explains attribute values editing in more detail: How to Modify Attribute Values During Import and Export in Magento 2.

Category Mapping

Moving product data often forces you to face with absolutely different catalogs and categories unrelated to yours. Usually, it is necessary to spend hours of time after such import editing the occasionally modified catalog. Luckily, the Improved Import & Export Magento 2 extension offers a reliable solution: you can match external categories to the ones used internally. The following gif image illustrates the process:

At the same time, it is possible to create new categories on the fly. Select a parent category and specify a name of a new one. Both features are described here: Category Mapping.

Attributes On The Fly

If any data is unavailable, create attributes on the fly. The Improved Import & Export Magento 2 module enables you to specify parameters necessary to do that via the following general form:

Attribute|attribute_property_name:attribute_property_value|…

The full algorithm of attributes on the fly creation is described here: Product attributes import.

Extended Connectivity Options

Although the Magento 2 CouchDB integration is based on the direct connection, we should also say a few words about the extended connectivity options of our module. There are several more options that make the extension much more flexible.

Multiple File Standards

First of all, the Improved Import & Export Magento 2 extension essentially increases the number of supported file formats. While the Magento platform is bound to CSV only, our tool adds support for XML, JSON, ODS, and Excel. You can freely import and export data in these formats. Note that all the extension’s features are equally suitable for all these formats.

Multiple File Sources

When it comes to file transfers, it is also necessary to mention that the Improved Import & Export Magento 2 module supports numerous sources that can be utilized as a point of data exchanges. You can rely on the FTP/SFTP connection that lets you use a local or remote server as a point of transfers. The same functionality is provided via a Dropbox account.

When it comes to import processes only, the Improved Import & Export module enables the ability to import files via a direct URL. It is also worth mentioning that all compressed data is unzipped automatically. Thus, you no longer have to unpack archives manually before every update.

Alternative Ways of Import & Export

Besides, the Improved Import & Export extension offers two alternative ways of data transfers. Firstly, you can use various online sheets to establish the connection between Magento 2 and external systems. Google Sheets, Office 365 Excel, and Zoho Sheet are supported. The Google Sheets integration looks as follows:

Magento 2 Google Sheet import

Secondly, It is possible to establish a direct API connection with the help of the Improved Import & Export Magento 2 extension. Use REST, SOAP, and GraphQL integrations to synchronize your Magento 2 store with any third-party platform.

Watch the following video to see the extension in action:

Final Words

As you can see, the Improved Import & Export extension dramatically improved the Magento 2 CouchDB integration. It provides the ability to create a direct connection between your store and the database avoiding multiple unnecessary processes. Furthermore, the problem of different attribute standards can be solved in a few clicks. And you automate data transfers entirely. For further information about our module and the integration, follow the link below and contact the support:

Get Improved Import & Export Magento 2 Extension

'