{"id":86173,"date":"2026-11-01T03:48:12","date_gmt":"2026-11-01T08:48:12","guid":{"rendered":"https:\/\/litextension.com\/blog\/?p=86173"},"modified":"2026-11-12T02:34:59","modified_gmt":"2026-11-12T07:34:59","slug":"import-sample-data-in-magento-2","status":"publish","type":"post","link":"https:\/\/litextension.com\/blog\/import-sample-data-in-magento-2\/","title":{"rendered":"Import Sample Data in Magento 2 &#8211; The Comprehensive Guide in 2026"},"content":{"rendered":"<p style=\"text-align: justify;\">When setting up a new Magento 2 store, starting from a blank site can be overwhelming. You may want to explore how the platform works, test a theme, or check how your extensions behave. In these cases, learning how to <strong>import sample data in Magento 2<\/strong> can help you save time and effort.<\/p>\n<p style=\"text-align: justify;\">Fortunately, there are different ways to do this depending on your setup and skill level. In this guide, we\u2019ll walk you through four simple methods to import sample data in Magento 2, including:<\/p>\n<ul style=\"text-align: justify;\">\n<li><a href=\"https:\/\/litextension.com\/blog\/import-sample-data-in-magento-2\/#method-1-import-sample-data-in-magento-2-using-magento-cli\"><strong>Method 1. Perform Magento import sample data with CLI<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/litextension.com\/blog\/import-sample-data-in-magento-2\/#method-2-install-magento-2-sample-data-using-composer\"><strong>Method 2. Install Magento sample data using Composer<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/litextension.com\/blog\/import-sample-data-in-magento-2\/#method-3-clone-git-repositories-to-install-sample-data\"><strong>Method 3. Clone Git repositories to install sample data<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/litextension.com\/blog\/import-sample-data-in-magento-2\/#method-4-import-sample-data-during-magento-migration-with-litextension\"><strong>Method 4. Import sample data during Magento migration with LitExtension<\/strong><\/a><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Let&#8217;s get started!<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">Import Sample Data in Magento 2 &#8211; All You Need to Know<\/h2>\n<p style=\"text-align: justify;\">Before diving into how to import sample data in Magento 2, it\u2019s important to understand what sample data actually is and when you should use it.<\/p>\n<p style=\"text-align: justify;\">Sample data in Magento 2 refers to a set of demo content built on the Luma theme, including products, categories, CMS pages, banners, and customer information. This data is designed to give your store a fully populated look, making it easier to test features, design themes, and evaluate the store\u2019s functionality.<\/p>\n<figure id=\"attachment_86175\" aria-describedby=\"caption-attachment-86175\" style=\"width: 1513px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-86175\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/magento-2-sample-data.webp\" alt=\"Magento 2 sample data\" width=\"1513\" height=\"957\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/magento-2-sample-data.webp 1513w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/magento-2-sample-data-300x190.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/magento-2-sample-data-1024x648.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/magento-2-sample-data-768x486.webp 768w\" sizes=\"(max-width: 1513px) 100vw, 1513px\" \/><figcaption id=\"caption-attachment-86175\" class=\"wp-caption-text\">Magento 2 sample data packages<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">You should consider installing or importing sample data in Magento 2 when you want to preview how the platform works with actual store content. It\u2019s especially helpful if you\u2019re testing a theme, running a demo store, or experimenting with extensions. Instead of working with an empty storefront, you\u2019ll be able to simulate how your data will display in the new setup, making it easier to adjust layouts or settings before launching.<\/p>\n<p style=\"text-align: justify;\">Additionally, for developers and store owners planning a Magento migration, learning how to import sample data in Magento 2 also helps preview the migration process and visualize how their data appears in the new platform.<\/p>\n<p style=\"text-align: justify;\">However, keep in mind that sample data is meant for learning and testing only. According to Adobe, you cannot fully uninstall sample data from your database, so it&#8217;s best to install it on a separate test or development environment rather than on a live store.<\/p>\n<p style=\"text-align: justify;\">In short, the sample data is a safe and effective way to explore and prepare your Magento 2 store before going live.<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">Method 1. Import Sample Data in Magento 2 Using Magento CLI<\/h2>\n<p style=\"text-align: justify;\">If you installed Magento 2 with Composer (using <code>composer create-project<\/code>) or from the archive on the Magento download site, this method gives you the fastest and most reliable way to add sample data modules. Note that it won&#8217;t work with an archive downloaded from GitHub, as its <code>composer.json<\/code> file doesn&#8217;t include the repo.magento.com repository. You\u2019ll also need your Adobe Commerce (or Magento Open Source) authentication keys, the same ones used during installation.<\/p>\n<p style=\"text-align: justify;\">To import sample data in Magento 2 using Magento CLI, follow these steps:<\/p>\n<p style=\"text-align: justify;\"><strong>Step 1<\/strong>. Make sure your store is in developer mode. Sample data can&#8217;t be installed in production mode, so if your store is running in production mode, switch it by running: <code>bin\/magento deploy:mode:set developer<\/code>. If developer mode is already enabled, move straight to the next step.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 2<\/strong>. As the file system owner, run this line in your Magento root directory: <code>bin\/magento sampledata:deploy<\/code>. This command adds the sample data packages to your root <code>composer.json<\/code> file and installs all the necessary modules, including demo products, categories, banners, and CMS pages.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 3<\/strong>. Finally, apply the changes to your application by running: <code>bin\/magento setup:upgrade<\/code>. This step updates the database and schema so the sample data becomes fully functional in your store.<\/p>\n<p style=\"text-align: justify;\">If you see an error saying that the &#8220;https:\/\/repo.magento.com\/packages.json&#8221; URL requires authentication, run <code>composer update<\/code> in your Magento root directory and enter your authentication keys when prompted. Then, run the <code>sampledata:deploy<\/code> command again.<\/p>\n<p style=\"text-align: justify;\">By following these steps, you&#8217;ll efficiently import sample data in Magento 2 and make your store ready for testing or previewing.<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">Method 2. Install Magento 2 Sample Data Using Composer<\/h2>\n<p style=\"text-align: justify;\">Another way to install sample data to Magento is by manually adding sample data packages to the <code>composer.json<\/code> file. This approach gives you more control over which modules to include without running the <code>sampledata:deploy<\/code> command.<\/p>\n<p style=\"text-align: justify;\">To import sample data in Magento 2 using Composer, please follow the steps below:<\/p>\n<p style=\"text-align: justify;\"><strong>Step 1.<\/strong> Open your root <code>composer.json<\/code> file in a code editor.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 2.<\/strong> Add the required sample data packages under the <code>\"require\"<\/code> section, such as <code>magento\/module-catalog-sample-data<\/code>, <code>magento\/module-cms-sample-data<\/code>, and <code>magento\/sample-data-media<\/code>. Make sure to replace the &#8220;version&#8221; with the version of each package that corresponds to your Magento version.<\/p>\n<figure id=\"attachment_86176\" aria-describedby=\"caption-attachment-86176\" style=\"width: 777px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-86176\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/install-magento-sample-data-using-composer.webp\" alt=\"Install Magento 2 sample data using Composer\" width=\"777\" height=\"290\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/install-magento-sample-data-using-composer.webp 777w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/install-magento-sample-data-using-composer-300x112.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/install-magento-sample-data-using-composer-768x287.webp 768w\" sizes=\"(max-width: 777px) 100vw, 777px\" \/><figcaption id=\"caption-attachment-86176\" class=\"wp-caption-text\">Install Magento 2 sample data using Composer<\/figcaption><\/figure>\n<p style=\"text-align: justify;\"><strong>Step 3<\/strong>. Run the following command in the Magento root directory to download the sample data modules: <code>composer update<\/code>. If prompted, enter your authentication keys.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 4<\/strong>. Lastly, run <code>bin\/magento setup:upgrade<\/code> to install the sample data modules and update your database.<\/p>\n<p style=\"text-align: justify;\">By manually adding sample data packages to <code>composer.json<\/code>, you can still import sample data in Magento 2 without the <code>sampledata:deploy<\/code> command, making it a flexible solution for developers and advanced users.<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">Method 3. Clone Git Repositories to Install Sample Data<\/h2>\n<p style=\"text-align: justify;\">Additionally, if you&#8217;re working with a Magento 2 instance cloned from GitHub, you can clone the sample data repository directly from GitHub. This method gives you full control over the sample data version and works best in development environments.<\/p>\n<p style=\"text-align: justify;\">Before you begin, keep in mind that Adobe intends this method only for contributing developers working with Magento Open Source cloned from GitHub. You also need to use the sample data branch that matches the branch of your Magento installation (e.g., 2.4-develop with 2.4-develop). For a more stable setup, Adobe recommends using a released branch such as 2.4.<\/p>\n<p style=\"text-align: justify;\">Here are two ways you can clone GitHub repositories to import sample data in Magento 2.<\/p>\n<h3 style=\"text-align: justify;\">Clone with SSH<\/h3>\n<p style=\"text-align: justify;\"><strong>Step 1.<\/strong> From your web browser, navigate to the <a href=\"https:\/\/github.com\/magento\/magento2-sample-data\" target=\"_blank\" rel=\"nofollow noopener\">Magento 2 sample data repository<\/a> on GitHub.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 2.<\/strong> Next, click the &#8220;&lt;&gt; Code&#8221; button, choose the SSH tab, and click the &#8220;Copy to clipboard&#8221; icon.<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-86186\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-sample-data-with-ssh.webp\" alt=\"Clone Magento 2 sample data with SSH\" width=\"1235\" height=\"153\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-sample-data-with-ssh.webp 1235w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-sample-data-with-ssh-300x37.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-sample-data-with-ssh-1024x127.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-sample-data-with-ssh-768x95.webp 768w\" sizes=\"(max-width: 1235px) 100vw, 1235px\" \/><\/p>\n<p style=\"text-align: justify;\"><strong>Step 3.<\/strong> Switch to your web server&#8217;s docroot directory. Then, run the following command using what you&#8217;ve obtained:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>git clone git@github.com:magento\/magento2-sample-data.git<\/code><\/p>\n<p style=\"text-align: justify;\">After cloning, switch to the branch that matches your Magento installation, for example:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>git checkout 2.4-develop<\/code><\/p>\n<p style=\"text-align: justify;\"><strong>Step 4.<\/strong> Then, link the sample data to your Magento code base by running:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>php -f &lt;sample-data_clone_dir&gt;\/dev\/tools\/build-sample-data.php -- --ce-source=\"&lt;path_to_your_magento_instance&gt;\"<\/code><\/p>\n<p style=\"text-align: justify;\">Once the command completes, set the right permissions in your sample data directory so that the storefront can load properly. Set the group owner to your web server group (e.g., <code>chown -R :www-data .<\/code> on Ubuntu), then run <code>find . -type d -exec chmod g+ws {} +<\/code>. After that, go back to your Magento root directory and clear the cache and generated files with <code>rm -rf var\/cache\/* var\/page_cache\/* generated\/*<\/code>.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 5.<\/strong> Finally, run the following line to update your Magento codebase: <code>bin\/magento setup:upgrade<\/code><\/p>\n<h3 style=\"text-align: justify;\">Clone with HTTPS<\/h3>\n<p style=\"text-align: justify;\"><strong>Step 1.<\/strong> Go to the Magento 2 sample data repository on GitHub.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 2.<\/strong> Then, select the &#8220;&lt;&gt; Code&#8221; button and choose the HTTPS tab. Copy the provided URL to your clipboard and get ready to clone.<\/p>\n<figure id=\"attachment_86185\" aria-describedby=\"caption-attachment-86185\" style=\"width: 1905px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-86185\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository.webp\" alt=\"Clone Magento 2 Git repository\" width=\"1905\" height=\"548\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository.webp 1905w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository-300x86.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository-1024x295.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository-768x221.webp 768w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/clone-magento-2-git-repository-1536x442.webp 1536w\" sizes=\"(max-width: 1905px) 100vw, 1905px\" \/><figcaption id=\"caption-attachment-86185\" class=\"wp-caption-text\">Clone the Magento 2 GitHub repository<\/figcaption><\/figure>\n<p style=\"text-align: justify;\"><strong>Step 3.<\/strong> In your web server&#8217;s docroot directory, enter the following command line and wait for the repository to clone:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>git clone https:\/\/github.com\/magento\/magento2-sample-data.git<\/code><\/p>\n<p style=\"text-align: justify;\">After cloning, switch to the branch that matches your Magento installation, for example:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>git checkout 2.4-develop<\/code><\/p>\n<p style=\"text-align: justify;\"><strong>Step 4.<\/strong> Then, switch to your &lt;magento_root&gt; and enter this command to link the sample data to your Magento instance.<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>php -f &lt;sample-data_clone_dir&gt;\/dev\/tools\/build-sample-data.php -- --ce-source=\"&lt;path_to_your_magento_instance&gt;\"<\/code><\/p>\n<p style=\"text-align: justify;\">Once the command completes, set the same permissions as in the SSH method: set the group owner of the sample data directory to your web server group, run <code>find . -type d -exec chmod g+ws {} +<\/code>, and clear <code>var\/cache\/*<\/code>, <code>var\/page_cache\/*<\/code>, and <code>generated\/*<\/code> in your Magento root directory.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 5.<\/strong> Finally, run the following line to update your Magento codebase: <code>bin\/magento setup:upgrade<\/code><\/p>\n<p style=\"text-align: justify;\">Using either cloning method, you can successfully install Magento sample data from GitHub and continue your setup or testing with a fully populated demo store.<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">Method 4. Import Sample Data During Magento Migration with LitExtension<\/h2>\n<p style=\"text-align: justify;\">For those planning to migrate to Magento, one of the best ways to preview how your store will look and function is by using LitExtension\u2019s Demo Migration. Instead of working with Magento&#8217;s default content, this method allows you to import sample data in Magento 2 directly from your existing store, giving you a realistic view of your store layout, products, and data structure on the new platform.<\/p>\n<p style=\"text-align: justify;\">This approach is ideal if you want to evaluate your Magento 2 setup before completing the full migration. Here\u2019s how you can do it in just three simple steps:<\/p>\n<h3 style=\"text-align: justify;\">Step 1. Set up Source Cart and Target Cart<\/h3>\n<p style=\"text-align: justify;\">First, log in to the <strong><a href=\"https:\/\/app.litextension.com\/\" target=\"_blank\" rel=\"noopener\">LitExtension Migration App<\/a><\/strong> using your registered account or Google account. Once inside, click <strong>Create New Migration<\/strong> to get started.<\/p>\n<figure id=\"attachment_80321\" aria-describedby=\"caption-attachment-80321\" style=\"width: 2557px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-80321\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in.webp\" alt=\"Sign in to LitExtension\" width=\"2557\" height=\"1412\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in.webp 2557w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in-300x166.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in-1024x565.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in-768x424.webp 768w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in-1536x848.webp 1536w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/litextension-log-in-2048x1131.webp 2048w\" sizes=\"(max-width: 2557px) 100vw, 2557px\" \/><figcaption id=\"caption-attachment-80321\" class=\"wp-caption-text\">Sign in to LitExtension<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Now, in your Source Cart setup, please select your current platform from the drop-down list. Then, depending on your cart type, you&#8217;ll need to provide different credentials to set up.<\/p>\n<p style=\"text-align: justify;\"><strong>1.<\/strong> If you are on a hosted platform (such as Shopify, BigCommerce, or Weebly), please fill in the required information (typically <strong><a href=\"https:\/\/litextension.com\/migration-guide\/get-api-key.html\" target=\"_blank\" rel=\"noopener\">API key<\/a><\/strong> and store URL) in the corresponding fields.<\/p>\n<p style=\"text-align: justify;\"><strong>2.<\/strong> On the other hand, if you are using an open-source solution (for example, WooCommerce, Magento, PrestaShop), you&#8217;ll need to download LitExtension Connector and upload it to your store\u2019s root folder. Then, please fill in your cart URL and wait for the notification \u201cConnection was successfully installed\u201d to appear on the screen.<\/p>\n<p style=\"text-align: justify;\">For a full walk-through on how to set up the LitExtension Connector, please check out our <strong><a href=\"https:\/\/litextension.com\/migration-guide\/install-connector-file.html\" target=\"_blank\" rel=\"noopener\">connector installation guide<\/a><\/strong> or watch our video tutorial below:<\/p>\n<p style=\"text-align: justify;\"><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/_fqaR7U5ilY?si=unEMfOZHA_aFJM5z\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p style=\"text-align: justify;\">Scroll down to the Target Cart Setup section and select Magento in the dropdown list. Then, repeat the same process of downloading and uploading LitExtension Connector, and provide your store URL. Wait a few seconds until the notification <strong>&#8220;Connection was successfully installed&#8221;<\/strong> pops up, and you are ready to go.<\/p>\n<p style=\"text-align: justify;\">Once everything is done, click <strong>Next: Configure Your Migration<\/strong> to proceed.<\/p>\n<h3 style=\"text-align: justify;\">Step 2. Select the data you want to migrate<\/h3>\n<p style=\"text-align: justify;\">In this step, you&#8217;ll need to choose the type of sample data you want to import to Magento 2. Here, you can select all entities or only specific ones based on what you want to test in your new store.<\/p>\n<figure id=\"attachment_80327\" aria-describedby=\"caption-attachment-80327\" style=\"width: 1043px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-80327\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/select-entities-to-migrate.webp\" alt=\"Select entities to be migrated\" width=\"1043\" height=\"411\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/select-entities-to-migrate.webp 1043w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/select-entities-to-migrate-300x118.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/select-entities-to-migrate-1024x404.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/11\/select-entities-to-migrate-768x303.webp 768w\" sizes=\"(max-width: 1043px) 100vw, 1043px\" \/><figcaption id=\"caption-attachment-80327\" class=\"wp-caption-text\">Select entities to be migrated<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Furthermore, if you want to extend your migration capabilities, feel free to select our <strong><a href=\"https:\/\/litextension.com\/additional-options.html?utm_source=blog&amp;utm_medium=display&amp;utm_campaign=anchortext&amp;utm_term=alice&amp;utm_content=importsampledatainmagento2\" target=\"_blank\" rel=\"noopener\">Additional Options<\/a><\/strong> right below. Some options are free with the Automated Migration, while others may add a small fee. Besides, make sure to map your language and order status so that they will display correspondingly on your new platform.<\/p>\n<p style=\"text-align: justify;\">When everything is in place, click <strong>Next: Start Free Demo Migration<\/strong> to bring your sample data to Magento 2.<\/p>\n<h3 style=\"text-align: justify;\">Step 3. Run the Demo Migration<\/h3>\n<p style=\"text-align: justify;\">Once you press the button, you&#8217;ll get to the import process right away. Here&#8217;s how our Demo Migration works:<\/p>\n<ul style=\"text-align: justify;\">\n<li>If your demo includes <strong>orders<\/strong> (either orders only or all entities selected), we will migrate the 20 most recent orders. Along with them, we also migrate all related customers, products, and categories linked to those orders.<\/li>\n<li>If your demo includes <strong>only products and categories,<\/strong> we will migrate the 20 most recent products, along with their related categories.<\/li>\n<li>If your demo includes <strong>unrelated data (without orders),<\/strong> we will migrate the 20 most recent entities of the selected type.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">However, please note that &#8220;Reviews&#8221; will not be included in the Demo Migration, but they will be transferred along with the rest of your data in the Full Migration. And, if you choose to import tax to Magento 2, our system will transfer the 20 earliest tax entities.<\/p>\n<figure id=\"attachment_86208\" aria-describedby=\"caption-attachment-86208\" style=\"width: 1901px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-86208\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running.webp\" alt=\"Demo Migration running\" width=\"1901\" height=\"953\" srcset=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running.webp 1901w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-300x150.webp 300w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-1024x513.webp 1024w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-768x385.webp 768w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-1536x770.webp 1536w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-360x180.webp 360w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-750x375.webp 750w, https:\/\/litextension.com\/blog\/wp-content\/uploads\/2025\/09\/demo-migration-running-1140x570.webp 1140w\" sizes=\"(max-width: 1901px) 100vw, 1901px\" \/><figcaption id=\"caption-attachment-86208\" class=\"wp-caption-text\">Demo Migration running<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Using this method, you can import sample data in Magento 2 that&#8217;s pulled directly from your own store, giving you a personalized demo environment that\u2019s much more relevant than generic sample content. Once you&#8217;re satisfied, you can proceed with the Full Migration at any time. And if your store has fewer than 100 entities, you can even run the Full Migration for free.<\/p>\n<div class=\"cta-detail\">\n<div>\n<p class=\"title\"><strong><span style=\"font-size: 28px;\">Preview Your Own Data on Magento 2 for Free<\/span><\/strong><\/p>\n<p style=\"margin-bottom: 2px; font-size: 16px; line-height: 2;\">Run a free Demo Migration with LitExtension Automated Migration and see your real products, customers, and orders on your new Magento 2 store before going all in.<\/p>\n<p><a class=\"btn-frame\" href=\"https:\/\/litextension.com\/magento-migration.html?utm_source=blog&amp;utm_medium=display&amp;utm_campaign=ctabox&amp;utm_term=alice&amp;utm_content=importsampledatainmagento2_mid\" target=\"_blank\" rel=\"noopener noreferrer\">START FREE DEMO<\/a><\/p>\n<\/div>\n<div><img decoding=\"async\" class=\"size-medium wp-image-78213\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/09\/2-08-1.png\" alt=\"LitExtension Automated Migration Tool Demo\" \/><\/div>\n<\/div>\n<hr \/>\n<h2 style=\"text-align: justify;\">Bonus Reading: How to Remove or Update Sample Data Modules<\/h2>\n<p style=\"text-align: justify;\">Once you\u2019ve finished importing sample data in Magento for testing or designing your store, you might want to remove the sample data to prepare for your real content. Magento 2 treats sample data as regular modules, so you can remove or update them just like any other extension.<\/p>\n<p style=\"text-align: justify;\">If you import sample data in Magento 2 using Composer or CLI, run the following command line in your root directory:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>bin\/magento sampledata:remove<\/code><\/p>\n<p style=\"text-align: justify;\">On the other hand, if you clone the GitHub repository to install sample data, run this command line instead:<\/p>\n<p style=\"padding-left: 40px; text-align: justify;\"><code>php -f &lt;sample-data_clone_dir&gt;\/dev\/tools\/build-sample-data.php -- --command=unlink --ce-source=\"&lt;path_to_your_magento_instance&gt;\"<\/code><\/p>\n<p style=\"text-align: justify;\">Please note that these commands only remove the sample data modules. The demo products, categories, and other entities that were already added stay in your database. So, if you want to wipe out your sample data completely, simply delete the database and <strong><a href=\"https:\/\/litextension.com\/blog\/install-magento-2\/\" target=\"_blank\" rel=\"noopener\">reinstall Magento<\/a><\/strong> with a clean database.<\/p>\n<p style=\"text-align: justify;\">If you want to update your sample data instead, run <code>bin\/magento sampledata:reset<\/code> before you update Magento. This command prepares the sample data so it can be updated along with your Magento application.<\/p>\n<hr \/>\n<div class=\"cta-detail\">\n<div>\n<p class=\"title\"><strong><span style=\"font-size: 28px;\">Let Our Experts Handle Your Magento Migration!<\/span><\/strong><\/p>\n<p class=\"cta-desc\">With the All-in-One Migration Service, our experts take care of everything, from setup and data migration to post-migration testing, so you can focus on your business.<\/p>\n<p><a class=\"btn-frame\" href=\"https:\/\/litextension.com\/magento-migration.html?utm_source=blog&amp;utm_medium=display&amp;utm_campaign=ctabox&amp;utm_term=alice&amp;utm_content=importsampledatainmagento2_bot\" target=\"_blank\" rel=\"noopener noreferrer\">BOOK FREE CONSULTATION<\/a><\/p>\n<\/div>\n<div><img decoding=\"async\" class=\"size-medium wp-image-78213\" src=\"https:\/\/litextension.com\/blog\/wp-content\/uploads\/2024\/09\/2-08-1.png\" alt=\"All-in-One Migration Service\" \/><\/div>\n<\/div>\n<hr \/>\n<h2 style=\"text-align: justify;\">Import Sample Data in Magento 2 &#8211; FAQs<\/h2>\n<div class=\"faq faq-single-post\">\n<details open=\"\">\n<summary>How to import sample data in Magento 2?<\/summary>\n<div class=\"content\">\n<p>There are several ways to import sample data in Magento 2, including:<\/p>\n<ul>\n<li>Method 1: Import sample data in Magento 2 using Magento CLI<\/li>\n<li>Method 2: Install Magento 2 sample data using Composer<\/li>\n<li>Method 3: Clone Git repositories to install sample data<\/li>\n<li>Method 4: Import sample data during Magento migration with LitExtension.<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details open=\"\">\n<summary>How do I get collection data in Magento 2?<\/summary>\n<div class=\"content\">\n<p>If you\u2019re a developer looking to retrieve collection data (such as products or customers), Magento 2 provides collection models through dependency injection.<\/p>\n<p>For example, to get a list of products, you can use the <code>\\Magento\\Catalog\\Model\\ResourceModel\\Product\\CollectionFactory<\/code> class in your custom module or script. This is separate from the sample data and is used when building custom functionality.<\/p>\n<\/div>\n<\/details>\n<details open=\"\">\n<summary>How to remove sample data in Magento 2?<\/summary>\n<div class=\"content\">\n<p>To remove sample data modules in Magento 2, run <code>bin\/magento sampledata:remove<\/code> if you installed them with Composer or the CLI. If you cloned the GitHub repository, run the <code>build-sample-data.php<\/code> script with <code>--command=unlink<\/code> instead. After that, run <code>bin\/magento setup:upgrade<\/code> and <code>bin\/magento cache:flush<\/code> to complete the process.<\/p>\n<p>Keep in mind that removing the modules doesn&#8217;t delete the sample products and other entities from your database. To remove them completely, you&#8217;ll need to delete the database and reinstall Magento with a clean database.<\/p>\n<\/div>\n<\/details>\n<\/div>\n<hr \/>\n<h2 style=\"text-align: justify;\">Final Words<\/h2>\n<p style=\"text-align: justify;\">In conclusion, understanding how to <strong>import sample data in Magento 2<\/strong> is one of the easiest ways to explore and understand how Magento 2 works. Whether you&#8217;re testing a theme, setting up a demo store, or preparing for a full migration, it gives you a complete view of your store&#8217;s structure and features before committing to the long term.<\/p>\n<p style=\"text-align: justify;\">Last but not least, if you like this article, don&#8217;t forget to check out other <strong><a href=\"https:\/\/litextension.com\/blog\/ecommerce-platforms\/magento\/\" target=\"_blank\" rel=\"noopener\">Magento blogs<\/a><\/strong> on our LitExtension website for more expert tips and insights.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When setting up a new Magento 2 store, starting from a blank site can be overwhelming. You may want to explore how the platform works, test a theme, or check how your extensions behave. In these cases, learning how to import sample data in Magento 2 can help you save time and effort. Fortunately, there [&hellip;]<\/p>\n","protected":false},"author":43,"featured_media":95831,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","jnews-multi-image_gallery":[],"jnews_single_post":{"format":"standard"},"jnews_primary_category":[],"footnotes":""},"categories":[16630,16620,16623,16633],"tags":[],"table_tags":[],"class_list":["post-86173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shopping-cart-migration","category-ecommerce-platforms","category-magento","category-magento-migration"],"uagb_featured_image_src":{"full":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-scaled.webp",2560,1830,false],"thumbnail":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-150x150.webp",150,150,true],"medium":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-300x214.webp",300,214,true],"medium_large":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-768x549.webp",768,549,true],"large":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-1024x732.webp",1024,732,true],"1536x1536":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-1536x1098.webp",1536,1098,true],"2048x2048":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-2048x1464.webp",2048,1464,true],"jnews-360x180":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-360x180.webp",360,180,true],"jnews-750x375":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-750x375.webp",750,375,true],"jnews-1140x570":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-1140x570.webp",1140,570,true],"jnews-120x86":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-120x86.webp",120,86,true],"jnews-350x250":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-350x250.webp",350,250,true],"jnews-750x536":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-750x536.webp",750,536,true],"jnews-1140x815":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-1140x815.webp",1140,815,true],"jnews-360x504":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-360x504.webp",360,504,true],"jnews-75x75":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-75x75.webp",75,75,true],"jnews-350x350":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-350x350.webp",350,350,true],"jnews-featured-750":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-750x536.webp",750,536,true],"jnews-featured-1140":["https:\/\/litextension.com\/blog\/wp-content\/uploads\/2026\/11\/import-sample-data-in-magento-2-1140x815.webp",1140,815,true]},"uagb_author_info":{"display_name":"Alice Le","author_link":"https:\/\/litextension.com\/blog\/author\/alice-le\/"},"uagb_comment_info":0,"uagb_excerpt":"When setting up a new Magento 2 store, starting from a blank site can be overwhelming. You may want to explore how the platform works, test a theme, or check how your extensions behave. In these cases, learning how to import sample data in Magento 2 can help you save time and effort. Fortunately, there&hellip;","_links":{"self":[{"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/posts\/86173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/comments?post=86173"}],"version-history":[{"count":13,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/posts\/86173\/revisions"}],"predecessor-version":[{"id":94302,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/posts\/86173\/revisions\/94302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/media\/95831"}],"wp:attachment":[{"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/media?parent=86173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/categories?post=86173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/tags?post=86173"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/litextension.com\/blog\/wp-json\/wp\/v2\/table_tags?post=86173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}