15 min read

How to migrate your website from Magento 2 to Shopify

Shape April 2022 HR 191
Contents
Updated on 04 Mar 2024

After a client enquired at Shape wanting assistance migrating their Magento 2 website to Shopify, I began researching the available options. After previous experience with Magento, I knew this wouldn't be a straightforward task.

Why don’t you check out why we use Shopify here at Shape.

Migrating a website from Magento to Shopify

Migrating a website from one platform to another isn't always a simple task; you must ensure you move every single piece of data, including all SEO data, without losing a single piece. Due to the size of the e-commerce website, manually copying over the data wasn't an option, which sent me down the automatic migration route.

Automating the migration process is the best way to reduce human error, and data migration tools are a cost-effective way to assist in transferring from one platform to another effectively.

Data migration tool - Matrixify

After extensive research into Shopify data migration tools, I opted to use Matrixify. Matrixify is a migration tool that assists in transferring data from one website to another, over multiple platforms, including Magento and Shopify. It also allows the import and export of your data in bulk using human-readable Excel and CSV files, giving you the flexibility to manipulate any data as you please.

Matrixify has some great features to assist you with the migration, including automatic image downloads, redirect list generation, and the possibility of creating smart collections (categories) from the product data. But that's not all; no matter your website's size or the migration's complexity, Matrixify has affordable pricing tiers that are charged monthly, helping reduce costs. With excellent reviews and documentation on migrating from Magento, I knew this was the tool I was looking for.

Create a backup of your Magento 2 store

Before starting the migration process, it is vital to backup the data on your current website should anything go wrong in the migration. Luckily, Magento makes it easy to do this by going to the admin sidebar, then navigating to System -> Tools -> Backups. From there, you can choose the type of backup you want to do: System Backup (a complete backup of your database and file system), Database and Media Backup (your customer's information, websites photos, etc.), and Database Backup (database file - you'll need the database file backup to import some of the data into Shopify).

Set up a Shopify account

Now that the backup has been made, you'll need to set up a Shopify account to begin the migration. Shopify is a powerful e-commerce platform that has three pricing plans:

  • Basic - £19 per month
  • Shopify - £49 per month
  • Advanced - £259 per month

Each plan has different features to fit your e-commerce store needs; we used the basic plan for this project. However, if you want to try out Shopify, they offer a 14-day free trial with no credit card details required.

    Shopify price plan

    Download the automatic migration app - Matrixify

    Once your Shopify store is set up, head to the Shopify app store and download the Maxtrixify app. Once the app is installed, you should decide which pricing plan suits your needs or continue with the demo plan for testing. With a 50k product limit, we opted for the 'Big' plan for the task at hand. If at any point you want to upgrade your pricing plan, you can easily do this in the app's settings dashboard in Shopify. One of Matrixify's best features is "Shop Sponsoring," which allows you to add an additional store on the same plan for free. This is particularly helpful when you have a testing environment/sandbox and want to test imports before deploying them to the production environment (or you have two stores)! To do this, go to Matrixify App -> Settings and scroll down to the "Shop Sponsoring" section. Fill out the "Shopify Domain" box by typing your other shops .myshopify.com domain. Click on the "Save" button to save any changes. If you need to remove a shop sponsoring store at any time, you can do this.

    Matrixify price plan

    Migration Process

    It's essential to have a process when migrating a website from one platform to another, ensuring the switch goes as smoothly as possible by planning each stage of the migration. Migrating to Shopify is no different; I knew from experience that to successfully import the orders in Shopify, for example, I would need to have already imported the products and customers. In Shopify, these are linked by line items in the product's SKUs. Therefore I decided to tackle the Migration by splitting it out into the following steps:

    • Product import
    • Customers import
    • Orders import
    • Category import
    • Blog post import
    • Page import (all other pages)

    Breaking the Migration down into smaller steps reduced the possibility of any mistakes or complications during the import. Once the website is ready to be switched over to Shopify, you will need to complete a final import of the above to ensure no data is lost during the switch. This drastically reduces any downtime the current website needs to have during the launch of the new site.

    Migrate Products

    To migrate your products, you'll need to export the current product listing from your Magento admin to a .csv format.

    To do this, log in to your Magento admin panel and go to System -> Data Transfer -> Export. Here you will find an Entity Type dropdown in the Export Settings where you can select specific products. Next, you'll need to ensure the Export File Format is set to .csv and check all the fields you need are present, then click continue. This will trigger the export, which will run in the background and be ready to download from the System -> Data Transfer -> Export section once you are notified.

    After downloading the products.csv from Magento, you will need to rename the file to contain the words 'Magento' and 'products', allowing Maxtrixify to detect that the data needs to be reformatted automatically. The Magento export will download with a name similar to this catalog_product_20221108_015149.csv; we recommend renaming it to the following format magento_products_20221108_015149.csv in order go to meet Shopify's naming requirements.

    Next, load the Magento products .csv into the Matrixify app to detect how many products, smart collections (categories), and redirects are present within the file. Once this is complete, you can configure your import.

    Adding your Magento store URL into the 'Old server URL' field allows the app to generate image URLs enabling your product images to be migrated to Shopify products. Automatically detect URL changes using the 'generate redirects' function, so you don't have to worry about the redirects for products and product categories.

    I highly recommend you choose the "Dry run" option for the first run. This runs through the file conversion process without importing any products and generates the 'Import Results' in Matrixify's file format (it will show an estimate of how long this will take - typically minutes). It will highlight any issues with the import allowing you to make any changes necessary to fit Matrixify's file format. If unsure, Maxtrixify provides a beneficial breakdown explaining the different columns in their structure.

    After running my dry run migration, I found 31 warnings and one failed product out of 5000+ products. The file also provided helpful Conversion Comments, which allowed me to identify the changes required. The differences detected included:

    • Changed an invalid meta field option as it has too few characters (minimum is 3)
    • Added the correct Magento folder to all the image URLs
    • Removing Magento’s /default-category/ from all collections URLs

    After updating the excel file, you can import the final version into the Maxitrify app again. The import duration was around 3 hours for 5000 products with no issues. You can close the app/browser once the import has started allowing it to run in the background while you carry on with the rest of the development. One thing to be aware of as you go through the process is Shopify's API limit of how many calls you can do a day; this is explained in Maxtrixify's documentation.

    Once the import is complete, you will get a summary of any failed products allowing you to download these results and reimport after making the changes. You can find all migration history in the app's dashboard.

    That's your products imported! Go to your Shopify store page and see all the new products migrated.

    Migrate Customers

    Migrating your customers is a vital part of any e-commerce site migration process, and Maxtrixify makes it a simple task. To get started, export your customers from Magento. These will be split into two files:

    • Customers Main files
    • Customer Addresses

    In Magento, go to System -> Export, and choose the following from the settings:

    • Entity Type: Customers Main File
    • Export File Format: CSV
    • Fields Enclosure: (checked)

    Repeat this process for the Customer Addresses. You should now have two CSV exports called something like customer_20220117_175758.csv and customer_address_20220117_175947.csv. Zip both files into one and rename to Magento_Customers.zip. Upload the zipped file to Matrixify, following the same steps you took with the products. Again, I recommend doing a Dry run to clean up the data and ensure the file aligns with the Maxtrixify format. You should also "Check if the items with the same Handle already exist"; this will prevent duplicate customers from being imported. Once ready, run the import.

    You can now review the customer's data and update/remove any fields that might not be necessary for Shopify. An example is the 'Tags' column containing information like Gender:Male, Magento Group:3, etc.

    After reviewing the customer's data, import the final customer file using the app. The import duration for 3000+ customers took around 20 minutes to complete. Once the import is complete, you will get a quick summary of the number of new customers, updated customers, and any failed customers. Out of 3000+, only eight failed.

    Similar to the product import, you can re-upload following the same process once any errors are updated. Issues can include:

    • The wrong address and province format
    • Email addresses containing invalid domain names (essentially fake customer accounts)

    Using the Import Comments column and the Maxtrixify customer's import sheet breakdown, you can rectify these issues and reimport the remaining customers.

    Migrate Orders

    Once you have imported the products and customers, move on to the orders. As these are all linked by the line items' SKU, you must import products and customers first.

    Exporting the data needed for orders is a bit more complex than for products and customers, as you will need to export specific database tables out of Magento. To do this, you'll need to use a database client app; I use Sequel Ace for Mac, but any database client will work (Transmit, DBeaver etc.).

    Using your database client, connect and export the following tables:

    1. sales_order.csv
    2. sales_order_item.csv
    3. sales_order_address.csv
    4. sales_order_payment.csv
    5. sales_shipment_track.csv
    6. sales_order_status_history

    Before exporting to CSV files, ensure that the database client configures the export to the following CSV requirements:

    1. Include column headings.
    2. Column separator: , (comma)
    3. Quotes symbol: " (regular double-quotes)
    4. Escape symbol: " (regular double-quotes)
    5. Newline symbol: \n (proper newline character)
    6. NULL values to be empty.

    Now you have six separate CSV files exported from the database; it's important to zip these files and rename them to: 'magento_orders'. This way, the app will know it needs to convert the following orders using the Magento format.

    Upload the zipped CSV to the app and let Maxtrixify automatically detect how many orders there are. Once uploaded, run a dry import run to convert the file into Maxtrixify format and detect any formatting errors that may occur.

    This is a great time to double-check the order information and improve customer data, including international phone codes for all phone numbers.

    Before uploading the final orders CSV, make sure you disable notifications from Shopify or else you will receive a notification every time an order is created. To do this, go to Admin -> Settings -> Notifications and disable 'Staff order notifications'.

    Do a sample import of a few orders first to catch any potential issues early instead of restarting the import all over again, as this will be the longest import you'll do.

    Once you are happy, upload the final Orders CSV file to the app and start the import process. As a guide, it took 4-4.5 days to import 23,000 orders. Be sure to factor this into your migration timeline, as this could catch you out towards the end of a project. Once uploaded, an import summary will be shown, including the number of new, updated, and failed orders. It will also give warnings about orders that were imported successfully but specific information didn't carry across properly due to an issue. The next step is to download the results, rectify any problems, and repeat this upload process.

    One thing to note - each pricing plan has order limits. The 'Big' plan limits you to 10,000 orders per import, which meant I had to use a simple SQL command to split my orders into three parts not to hit the limits the plan offers. To do this, run a command on the sales_order.csv:

    SELECT * FROM sales_order WHERE created_at >= '2022-01-01;

    This will select all the orders greater than or equal to orders after 01/01/2022, and then you can export that to a CSV through your database client. Zip that file with the other five exported tables and start your import.

    That's the migration of orders completed from Magento to Shopify.

    Migrate Categories

    After importing the products, Maxtrixify automatically creates all the smart collections (categories) based on the current product information from Magento, creating a new CSV file. The file shows you how many collections it will create and offers a dry run option which I recommend checking. One thing I found is that Magento uses /default-category/ as its top-level category by default; however, in Shopify, it's not needed. I had to go through each category and remove it from the structure.

    Upload the final CSV to the app to generate each smart collection and assign the products using Shopify's automated collection type. All the products are now categorised with the product structure in place. How do you import the categories' content?

    There are two options, manual, best for a small number of collections, or via data import with some manual data transfer later. With over 100 smart collections going down, the import route was the most efficient option. For this, export the created smart collections and use the CSV template to align the content to each category. To help, Maxtrixify has a breakdown of what each column title means and its requirements. Using a database client and exporting the 'catalog_category_entity_text' table into a CSV file will give you all the smart collections content. Match the content to the collection by comparing both CSV templates and rerun the import process using the 'Update' tag command. All collections will update, and the content will be uploaded to your Shopify store.

    Migrate Blog Posts

    In Magento, there isn't a native export for the blog posts meaning you will have to retrieve the data from the database tables and import them into Shopify using the Maxtrixify app.

    To get started, manually create the latest blog post from the Magento website into Shopify and copy over all its information, including any SEO data. You can then export the single blog post using Maxtrixify to create a base CSV template in the correct format.

    Export the Magento blog data using a database client similar to when exporting orders. Following the same process, export the 'blog_posts' table into a CSV format and open both CSVs in your choice of spreadsheet software (Google sheets, Excel, etc.). Compare both sets of data and start to copy across each piece of data into the correct Maxtrixify column. There is a breakdown in Maxtrixify's documentation to help with this.

    You will have to go through a couple of manual processes and check the images that need importing from the Magento store. Ensure any inline images and thumbnail images (Image Src column in the spreadsheet) are valid URLs. Magento uses its own syntax when displaying images in text, e.g. {{media url= "wysiwyg/Images/image.jpg"}} but this is not a valid format for Shopify/Matrixify. As long as Maxtrixify can find a valid URL for an image, it will automatically download and import the image.

    Once the CSV is finalised, upload and import. Again, I'd recommend running the dry run option first to catch any errors before performing the import; however, as the duration for this import is the smallest of all, it is not necessary. With the import process complete, the app will display a summary of how many blog posts were: New, Updated, and failed. If any blog posts fail, you can download the import results file, amend any errors, and follow the import process again.

    If you go to your Shopify store and head to Online Store -> Blog Posts, you should see all the blog posts you imported in this section.

    Migrate Pages

    The final part of the migration is to import the pages from Magento to Shopify, following the same process for blog posts as Magento has no native export for pages. We must export the 'cms_page' table into CSV format using our database client this time. Again manually creating one of your pages in Shopify, including all data such as SEO meta, and exporting that page using the Maxtrixify app will give you a formatted CSV template to work with.

    Using your choice of spreadsheet software, you can easily compare both data sets and copy it across from the cms_page.csv to your newly created Maxtrixify CSV. At this point, it's a great time to review any content and check for possible errors that may occur using the documentation of the Maxtrixify page.

    Once the checks have been completed, the pages CSV will be ready to import, where I'd recommend using the dry run function provided to catch any errors before performing the import. Once you are happy, you can import the pages CSV where the app will display a summary of how many pages were: New, Updated, and failed. If any pages fail to import, you can download the import results file, amend any errors, and follow the import process again.

    The import is now complete. If you go to your Shopify store and head to Online Store -> Pages, you should see all the pages you imported in this section

    Migrating from Magento 2 to Shopify doesn't have to be a daunting task. Using the correct tools, you can create a smooth transitional experience for any client who wishes to migrate platforms. I'd highly recommend using an automatic migration app like Maxtrixify to make the process as efficient and cost-effective as possible while creating a pleasant migration period for all parties involved.

    Do you need to migrate your website to a new platform? Here at Shape, we've got you covered.