Today, we are going to introduce you to the Magento 2Google Drive integration. The following article sheds light on how to import and export entities between Magento 2 and Google Drive with the help of the Improved Import & Export extension. It explains how to synchronize Magento 2 and Google Drive. After that, we shed light on the general facts related to transferring data between our favorite e-commerce platform and the popular file storage. Next, the material proceeds to the core steps of the integration preparation. You will discover how to install Google API libraries and get Google Drive API credentials.
After that, the article focuses on establishing the connection between Magento 2 and Google Drive. You will learn to configure a Service Account and share a Google Drive folder. The last chapters are dedicated to configuring import and export jobs for Magento 2 and Google Sheets integration and exploring use cases. Since the integration incorporates Improved Import & Export, you will also find its features described below.
Google Drive is a well-known cloud service that allows storing data of various formats and provides user-oriented tools for synchronizing files between multiple devices. Google Drive is fully functional and has proven itself as the most comfortable service for both personal and corporate usage. If you adhere to managing your files via the application, we have great news for you. Now Improved Import and Export enables the direct integration between Magento 2 and Google Drive.
Google Drive introduces the most comprehensive practices of working with a cloud service. You create an account to keep your data safely on the Internet, and the data storage becomes accessible to you anywhere anytime through a desktop app, phone, tablet, etc.
How does Magento 2 Google Drive import and export benefit your data transfers? The service as an import source allows you to keep all the files related to the procedure in a single place. No more worries you would mess up or lose any crucial piece of information. Up to 15 GB of storage space is available for a free account. More opportunities can be achieved with more investments in the account upgrade.
Official Google API enables seamless import and export of Magento 2 data from and to Google Drive with the help of the FireBear extension.
Both Improved Import and Export and Google Drive support a variety of data formats, including CSV, XML, XLSX, Json, ODS, ZIP, and TAR.
You can upload any multimedia files to Google Drive to provide external files to your import table, like images, video, audio, etc.
All the data retrieved from files in Google Drive can be easily mapped with the Improved Import and Export functionality.
How to Import & Export Data Between Magento 2 & Google Drive
While Magento 2 doesn’t let you exchange data using Google Drive as a connection point between your e-commerce store and external systems, you can enable the missing data transfer functionality with the help of the Improved Import & Export Magento 2 module.
It can help you integrate Google Drive and Magento as follows.
Install Google API Libraries
To start using Google Drive as a data source, you need to install the native Google API libraries in your store.
1. Navigate to your store root folder in the SSH console of your server:
1
cd path_to_the_store_root_folder
2. Run the next commands:
1
composer require google/apiclient:"^2.0"
1
composer update
Now Magento 2 is ready to retrieve API requests from Google Drive during the integration.
Get Google Drive API Credentials
API activation and configuration are performed on the Google Drive side. You can enable the API for both new projects and existing ones at the Google Cloud Platform console.
1. Create a new project or select an existing one at the blue console panel at the top of the page.
Click the ‘Enable’ button for API activation.
Connect Magento 2 & Google Drive
Credentials for the API connection are generated for each new project. Improved Import and Export requires a service account key in a JSON file format to proceed with the synchronization. The service account key is downloaded to your device automatically; it will be inserted later into an import or export job as an identification method (make sure not to lose the file as it can not be restored). Once the service account key and an account email are obtained, you can configure an import job.
Open the ‘Share’ settings for the specific folder.
Click the ‘Advanced’ button.
Enter the Service Account email you’ve previously got from the Google Console in the ‘Invite People’ input.
Uncheck the ‘Notify People’ checkbox.
Click the ‘OK’ button.
Note that the Improved Import and Export functionality processes files from Google Drive folders with granted access to their content.
Mind the sharing mode: the folder with the import files must be open for editing.
All the media files must be kept in the very same folder.
Magento 2 Google Drive Import
Now it’s time to set up Google Drive import from the Magento 2 side. Go to System > Improved Import/Export > Import Jobs. Here, you can add a new job or edit the existing ones right in the dynamic grid.
You can find four essential configuration sections on a job page (the number may differ based on the import entity, but the required settings count four steps).
General Settings
General settings allow naming the job and scheduling automatic cron updates for constant database refreshment.
Import Entity
In the import settings section, you need to select an entity for import. The entity type defines the logic following which the Magento 2 and Google Drive connector processes the import data.
Import Behavior
The selected import behavior helps you control the pattern of data implementation — whether to add, update, replace, or delete data.
Import Source
The import source section is where you need to apply the credentials from Google Drive.
Start by choosing the format of your import table.
Specify Google Drive as an import source.
Provide the path to the import file in the shared folder at Google Drive (note that the file name must not contain white spaces!)
Upload a service account key that has been downloaded from the Google Cloud console previously.
Validate the data file after you finish the configuration.
Additionally, you can map values for attributes and categories during an import run if there’s a need to modify data upon entering the database. The Improved Import and Export functionality provides the ability to translate product descriptions, round prices, assign store views to imported content, and many more.
Magento 2 to Google Drive Export
An export job configuration is standard for Improved Import and Export. You can enable export run based on the cron schedule or Magento 2 events, and even perform a consecutive export following the previous data extraction procedure.
Once the entity type for export is specified, select the desired file format and Google Drive as a target database for export.
Export to Google Drive also requires a service account key and a file path in the shared folder. If the file with the specified name is not found in Google Drive, the extension will create a new file with the name in the selected data format.
Magento 2 Google Drive Use Case
The sharing settings of the Google Drive data can give access to the files to multiple users. Thanks to the feature, you can delegate the import file updates to your store employees, let Improved Import and Export retrieve any changes automatically, and save time for more pressing matters.
Export data to a Google Drive folder with the ‘Date Format’ setting and keep multiple export files to follow the store updates. Improved export to Google Drive includes both extractions to a new data file and updates of an existing file so that any user can access a file they need for their goals.
Improved Import & Export Magento 2 Extension Features
While we’ve just described how to transfer data between your Magento 2 store and Google Drive with the help of Improved Import & Export, it is also necessary to shed light on how our extension enhances multiple other aspects of import and export processes.
Below, you can find the module’s features designed to simplify the way you exchange data between your e-commerce website and external systems via Google Drive, alternative file storage, or other connection types.
Automated Import & Export Processes
As we’ve already mentioned, automation is one of the most important features when it comes to the Magento 2 Google Drive integration. The more data transfers you need to perform, the less free time you’ll get unless your import/export solution provides the ability to automate all the transfers. The Improved Import & Export Magento 2 module offers two ways to establish automation: schedules and event-based triggers. Furthermore, other extension features also help to achieve this goal, but we will focus on them a little bit later.
Schedules
The Improved Import & Export Magento 2 extension lets you use cron to create fully independent update schedules for transferring data between Google Drive and Magento 2. Specify any custom interval or select one of the predefined values which are fully customizable.
At the same time, the module allows using profiles with no schedules. You may argue that they are not very efficient in the case of continuous integrations, but it is possible to leverage them when one transfer is enough or some asynchronous actions are required.
You can launch every scheduled profile manually whenever you want with asynchronous data transfers. Thus, if a partner uploads a file to Google Drive after a scheduled update, transfer it into your database manually. The gif below illustrates the simplicity of the configuration process:
Events
Multiple event-based triggers can be created. Note that they work in a slightly different manner than cron schedules. Let’s explore a simple export case to illustrate the feature:
Now, it is necessary to describe the mapping opportunities of the Improved Import & Export Magento 2 extension, which dramatically simplifies every data transfer between Magento 2 and Google Drive, Dropbox, Box, and other file storages and connection points by solving the problem of different attribute standards in the most user-friendly manner. Without the help of our module, you have to spend hours of time editing attributes and their values manually. It means that you should open each data file in an editor and change its content right in the data file. Since different attribute standards cause multiple huge problems, we want to shed light on how our plugin solves them.
Mapping Presets
The most natural cure for pain is represented by mapping presets. The Improved Import & Export extension lets you match external attributes to the corresponding ones used internally in just a few clicks. It is only necessary to select and apply a preset related to your integration. Next, the module will do all the work for you.
Our extension analyzes the input file and matches its attributes to the internal ones used in Magento. Thus, presets help to save lots of time and effort since you avoid the default editing process which is based on manual interaction with data files and should be done every time a new update is provided. Apply a predefined matching scheme, and it will be used for further updates automatically. The configuration process looks as follows:
Matching Interface
You can do everything manually in a matching interface replacing a file editor. The Improved Import & Export Magento 2 extension allows mapping external attributes to the corresponding internal ones right within the Magento admin. If your business case cannot be satisfied with a preset or you want to take full control over the process, utilize the corresponding section of the import or export profile. Although more in-depth manual interaction is required, everything is still very straightforward:
As for the third column from the image above – “Default Value” – It is designed to specify default (hardcoded) values that are provided to all items related to a corresponding attribute. The feature is especially helpful when you import products to a single store view from different ones. Instead of multiple edits, specify a hardcoded value for the “_store” attribute and get all items where you want them to be.
Attribute Values Mapping
With the Improved Import & Export Magento 2 extension, you can match not only attributes but also attribute values. Although they don’t prevent import processes usually, some exceptions cause errors. At the same time, even if incorrect values don’t stop the transfer, they consume lots of time when you apply changes to the imported items. Luckily, you can prevent headaches right before data is imported. The process of attribute values mapping is exceptionally straightforward: choose a third-party value and specify the internal one in front of it. Do that until all external designations are replaced with internal ones. This procedure entirely replicates attribute matching described above. For further information, follow this link: Attribute Values Mapping.
Attribute Values Editing
Additionally, the Improved Import & Export extension lets you modify attribute values via bulk actions. You can apply the following rules:
Add a prefix to multiple attribute values;
Add a suffix to multiple attribute values;
Split multiple attribute values;
Merge multiple attribute values.
Combine these rules and create conditions to apply changes to attribute values more efficiently. Thus, you will dramatically increase the efficiency of editing. Follow this link to get more about attribute values editing: How to Modify Attribute Values During Import and Export in Magento 2.
Category Mapping
If you are going to import products from Google Drive to Magento 2, the Improved Import & Export Magento 2 extension will dramatically improve your routine. Our module allows you to match external product categories to ones used in your catalog.
Since an external catalog may have a completely different structure, you need to consider that before running the import process. Otherwise, you won’t organize new products according to the order used on your website.
While manual editing solves the problem but is far from being very efficient, the Improved Import & Export extension offers something more user-friendly and fast. With our module, you can match external product categories to ones used internally as follows:
Note that it is possible to create new categories on the fly. Select a parent category and specify a new one. Next, a missing section will be added to your catalog. Both features are described here: Category Mapping.
Attributes On The Fly
Another problem that often occurs during the import process, even if you transfer data from Google Drive to Magento 2, is the lack of attributes in a data file. But the Improved Import & Export Magento 2 extension lets you solve it with the ability to create attributes on the fly. Use the following general form:
Now, we’d like to draw your attention to the extended connectivity options of the Improved Import & Export Magento 2 module. With our extension, you can transfer Magento 2 entities not only with the help of Google Drive but in multiple other ways.
It’s not a secret that Magento is very limited when it comes to data transfers. You can exchange data via CSV files only. But our extension completely changes the situation. The module not only provides several more alternative ways of data transfer but also offers an extended range of supported file formats.
Multiple File Standards
If you want to increase the number of supported file formats dramatically, use the Improved Import & Export Magento 2 extension. With our plugin, you will transfer data between Magento 2, Google Drive, and other external systems via XML, JSON, ODS, and Excel files.
Multiple File Sources
Additional flexibility for data transfers is added with the support for multiple file sources. The following connection options are provided:
FTP/SFTP. Transfer files using a local or remote server.
Dropbox. A Dropbox account can be used instead. Alternatively, you can rely on Box, Google Drive, One Drive, iCloud, and Amazon Drive.
URL. In the case of import processes, you can just specify a file URL.
And if data files are provided in an archive, you don’t need to unpack it since the Improved Import & Export module will do it automatically.
Alternative Ways of Import & Export
Two alternative ways of import and export can also be utilized. The Improved Import & Export Magento 2 extension allows replacing data exchanges via files with API connections and intermediary services. Our module lets you integrate your e-commerce store with any external systems via REST, SOAP, and GraphQL APIs. Enhance API connections with mapping, scheduling, and other extension features. Thus, you will automate data transfers even for the most complicated integration.
As for intermediary services, they are represented by Google Sheets:
Watch the following video to see the extension in action:
Magento 2 Google Drive Integration FAQ
Below, we share several more facts about transferring data between Magento 2 and Google Drive.
How to import and export customers between Magento 2 and Google Drive?
To transfer customers between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Customers as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move customers between Magento 2 and Google Drive without any headaches. Note that you can transfer all customer data, including passwords.
How to import and export products between Magento 2 and Google Drive?
To transfer products between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Products as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move products between Magento 2 and Google Drive without any headaches. Our module works with all product types: simple, configurable, grouped, bundle, virtual, downloadable, and even gift cards!
How to import and export orders between Magento 2 and Google Drive?
To transfer orders between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Orders as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move orders between Magento 2 and Google Drive without any headaches. You can transfer orders along with all the related documents.
How to import and export categories between Magento 2 and Google Drive?
To transfer categories between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Categories as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move categories between Magento 2 and Google Drive without any headaches. Our module lets you map imported categories to ones that are already represented in your category tree.
How to import and export prices between Magento 2 and Google Drive?
To transfer advanced pricing between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Products as your import or export entity in the corresponding import settings section, transferring advanced and tier prices along with them. Note that it is necessary to edit the product data table in a specific manner to enable the price update. Next, the Improved Import & Export extension lets you move prices between Magento 2 and Google Drive without any headaches.
How to import and export product attributes between Magento 2 and Google Drive?
To transfer product attributes between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Product Attributes as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move product attributes between Magento 2 and Google Drive without any headaches. Note that the module provides the ability to move product attributes, attribute sets, and attribute groups as dedicated entities.
How to import and export newsletter subscribers between Magento 2 and Google Drive?
To transfer newsletter subscribers between Magento 2 and Google Drive, you need to establish a connection between the two systems following the instructions from this article. Next, choose Newsletter Subscribers as your import or export entity in the corresponding import settings section. That’s it! The Improved Import & Export extension lets you move newsletter subscribers between Magento 2 and Google Drive without any headaches. Thus, you can subscribe the existing customers to your new newsletter as well as add new subscribers.
How to import and export data between Magento 2 and Google Drive automatically?
You can use the Improved Import & Export extension to automate your data synchronization between Magento 2 and Google Drive. The extension uses a cron scheduler, providing the ability to choose or create intervals for automated data transfers. Specify a period of updates, and the module will do everything for you.
How to import data with third-party attributes from Google Drive to Magento 2?
While Magento 2 doesn’t let you import data with unsupported attributes, you can easily achieve this goal with Improved Import & Export. The extension offers a mapping section where you match the unsupported attributes to the ones used in Magento 2. Thus, you teach the system what designations to use to replace the unsupported data and seamlessly run the import process.
Final Words
As you can see, the Magento 2 Google Drive integration is no longer a problem if you use the Improved Import & Export extension. You can easily exchange data between the two systems automating the updates. For further information, follow the link below and contact our support: