docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Request for help importing large database

Open robert-j-peterson opened this issue 2 years ago • 4 comments

Description

Hi, Mark — first of all, thank you so much for this repo. It's the best one-step Magento install I've come across.

I am not reporting a bug but asking for an assist. I'm still fairly new to Docker, and I'm not quite connecting the dots when it comes to certain concepts. I know you must be busy, so huge thanks in advance.

Steps To Reproduce

I'm trying to import a large database from the command line.

I've done this many times before in other environments, but the concepts of Docker are confusing me, haha.

In short: Where on my the hard drive for my local system — ie the computer I'm physically working on — do I put the SQL.gz file, and where should I run the mysql import command? Should I open the shell for the magento mariadb container?

Thank you!

Expected Result

Actual Result

robert-j-peterson avatar Jul 27 '22 22:07 robert-j-peterson

unzip your SQL.gz file in local (not in docker container)

# Import existing database:
bin/mysql < ../existing/magento.sql

rangerz avatar Jul 28 '22 01:07 rangerz

unzip your SQL.gz file in local (not in docker container)

# Import existing database:
bin/mysql < ../existing/magento.sql

Thanks so much for the response! Can you be more specific, though? I moved the file to my local, in my users directory, and ran this command from the bash line of the database container:

mysql -u root -pmagento < /Users/robertjpeterson/mysql_dump/db.sql.gz

Error: Cannot open ... No such file

I'm not sure what I'm missing.

Thanks again!

robert-j-peterson avatar Jul 28 '22 13:07 robert-j-peterson

Hey, I think I found the solution — but now I'm running into another error. Thank you again for your help!!!

robert-j-peterson avatar Jul 28 '22 14:07 robert-j-peterson

@robert-j-peterson You may unzip your gz file

gzip -d db.sql.gz
# or
gunzip db.sql.gz

rangerz avatar Jul 28 '22 21:07 rangerz

Sorry just saw all these messages now! I keep trying to stay on top of my GitHub repos but it's hard. Glad you figured it out, but I'll be closing this one out as a non-issue. I'd recommend creating a Discussion instead of an Issue if you need help with something.

markshust avatar Dec 04 '22 14:12 markshust