TransWikia.com

How to bring live site on localhost

Magento Asked on December 28, 2021

I am trying to bring a live site on the localhost I am following these following steps but it gives error at the install time.

Step 1: I have downloaded the live site

Step 2: Then I have created a blank database and imported my DB into that

Step 3: Deleted the local.xml

Step 4: Then restart the installation

It gives error on 99% that no administrator role is found

[ERROR] Exception: No Administrators role was found 

Any solution for this?

2 Answers

If you have a live site and Database DP following Steps to make it work on localhost

  1. in you db.sql file find your base URL (secure and unsecured) using ctrl + f

change them something like that

Secure `https://www.example.com` to `https://localhost/example` 

insecure `http://www.example.com` to `http://localhost/example` 

Import you SQL dump in a local empty database

  1. Copy all content from live site to var/www/html/example Now goto app/etc/env.php

change following data with your local credentials

'db' => [
        'table_prefix' => '',
        'connection' => [
            'default' => [
                'host' => 'localhost',
                'dbname' => 'magento235',
                'username' => 'root',
                'password' => 'admin123',
                'active' => '1',
                'driver_options' => [

                ]
            ]
        ]
    ],
  1. Run following commands in example folder
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
chmod -R 777 var/ pub/ generated/

I will work Fine I have migrated a site Few days ago with same steps

Happy coding

Answered by Real Magento Man on December 28, 2021

With reference to this link.

Can you please do this process in mysql.

Run $ n98-magerun2 admin:user:create --admin-user=dev_admin --admin-password=dev123456 [email protected] --admin-firstname=DEV --admin-lastname=dev123456

And check it will working.

Happy Coding.

Answered by Mayur Sisodiya on December 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP