Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 27, 2022 06:34 pm GMT

Import DB in Drupal 8

Drush

In the folder where the file with the database is located, use the command:

drush sql-drop ; drush sql-cli < ./dump.sql

phpMyAdmin

  • Go to phpMyAdmin;
  • Select the database from the list;
  • Click on the Import tab;
  • Click Select File and download the archive with the database;
  • Click the Forward button.

Image description

Docker container

If you work on a local area, this method is preferable. Especially if you have a large database.

In the terminal we write:

docker ps

I find the line with mariadb and find out the CONTAINER_ID I want

The import of the database in the container docker is as follows:

docker exec -i CONTAINER_ID mysql -uUSERNAME -pPASSWORD DATABASE_NAME < dump.sql

In my case, the values are as follows:

CONTAINER_ID: daf7d5df2d5eUSERNAME: drupalPASSWORD: drupalDATABASE_NAME: drupal

Consequently, in order to import the database I will write the following:

docker exec -i daf7d5df2d5e mysql -udrupal -pdrupal drupal < dump.sql

Don't forget to put -u before the login and -p before the password.


Original Link: https://dev.to/vadimfilimonov/import-db-in-drupal-8-5fo4

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To