Categories: Magento 2 Tutorials

Learn How to Install Sample Data in Magento 2

Magento is a robust e-commerce platform, powering big brands to get the most out of their online business. It is loaded with a large number of useful features that help store owners to enhance their online store’s performance, and to give their customers an incredible web shopping experience. See: The 10 Important Aspects of Building an Ecommerce Store with Magento 2 There are still many store owners who are thinking to move their online business to Magento 2. Installing Magento 2 is the way forward for them. If you haven’t installed it yet, we have got you covered with a comprehensive guide on How to Install Magento 2 By default, you can easily install Magento sample data during the installation process. However, many people skip this step and I have seen queries about installing Magento 2 sample data after the platform installation. This guide will resolve all these queries! Today, you will learn as to how to install Magento 2 sample data. Let’s start! Open the SSH terminal and connect your Magento 2 store with it. Navigate to the root directory of your store to run the required CLI commands. To install Magento 2 sample data, first run the following CLI command: php bin/magento sampledata:deploy It will ask about URL authentication to repo.magento.com. You have to enter a username and password. To get the credentials, login to your Magento Marketplace account and then navigate to My Profile: Next, click on Access Keys: Now, click on Create a New Access Key to create one. However, if you have already created the access key, you can also use the existing one. The Public Key is the username and Private Key is the password for URL authentication. Enter them to the CLI. Type ‘Y’ and press the Enter key. Now upgrade the setup by running the following CLI command: php bin/magento setup:upgrade Now just run the following commands one by one:
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
However, if you get any memory error message after running a command to install Magento sample data, then update the command as follows: php -d memory_limit=2G bin/magento sampledata:deploy All done. You are good to go. Just launch your store and you will see that Magento 2 sample data has been successfully installed:

Wrapping Up

Installing Sample data to an online store is a great way to check the performance and interface of any platform, thus helping store owners to make a decision for the right platform. I believe after following this tutorial you should now be able to install Magento 2 sample data. If you’re still facing any issues or want to add something, do leave your comment below and I will get back to you!

Frequently Asked Questions

Q. Can I install Magento 2 sample data manually rather than CLI? Yes, you can install Magento 2 sample data manually. Just go to Magento Resources and download Magento 2 version with sample data and install it to the root directory of your server.
Syed Muneeb Ul Hasan

Syed Muneeb Ul Hasan is an expert in PHP and Magento, he prefers to educate users in implementing and learning Magento. When not working, he loves to watch cricket.

Share
Published by
Syed Muneeb Ul Hasan

Recent Posts

Building Employee Trust and Dedication – A Complete Guide

In the highly competitive modern workplace, trust, and employee loyalty are crucial factors for long-term… Read More

3 months ago

12 Winning Strategies for Small Businesses Marketing

In the ever-evolving world of small business developing and implementing effective marketing strategies is critical to… Read More

3 months ago

Top 10 App Development Companies in Dubai 2024

With one of the highest internet penetration rates, the UAE has set out to revolutionize… Read More

3 months ago

Transforming Industries: How Amazons GPT44X is Revolutionizing AI Technology

Artificial Intelligence (AI) has been continually evolving, leading to remarkable advancements in various industries. Among… Read More

8 months ago

Top Magento 2 Extensions for 2023

Extensions, extensions and lots of extensions. We all love extensions, don’t we? After all, extensions… Read More

11 months ago

Unleashing the Power of Software Testing: Cooperating with a Testing Firm

Software quality is crucial to a firm's success across industries in the quickly changing digital… Read More

11 months ago