lost Project files for the magento project during an system restart

Copied the project file from a colleague an pasted it in the location “/var/www/html”. Also copied the database from them and pasted it in the same location an created a database with the following commands

mysql> CREATE DATABASE DatabaseName;
mysql> CREATE USER 'DatabaseUser'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL ON DatabaseName.* TO 'DatabaseUser'@"localhost";
mysql> FLUSH PRIVILEGES;
mysql> exit;

Now after database is created,  import the SQL file.
To import the SQL file, for example, BackupDatabase.sql, into your new database, simply run the following command:

mysql -u DatabaseUser -p DatabaseName < BackupDatabase.sql

You will be asked for the password of the database user to which the database is assigned. Enter your database user password to finish the import.
With this, the BackupDatabase.sql file has been successfully imported.
Next you need to check the env.php file and edit the database name username and password as per the ones you created in the below shown selected fields. 

after that check whether the location /var/www/html/Sibonne/app/etc has the file config.php

after logging into sql and selecting your database using the command

select * from core_config_data

thaat your websecure url is correct it has the folder name correct

then upgrade , decompile and deploy

sudo php -dmemory_limit=-1 bin/magento setup:upgrade
sudo php -dmemory_limit=-1 bin/magento setup:static-content:deploy -f
sudo php -dmemory_limit=-1 bin/magento indexer:reindex
sudo php -dmemory_limit=-1 bin/magento cache:clean
sudo php -dmemory_limit=-1 bin/magento cache:flush

and also give the needed permission if you encounter any errors in between

then check it will running

Leave a comment

Your email address will not be published. Required fields are marked *