0

A docker container made a huge crawl and now the disk space from the VM is almost full. So, I need a solution to export the sql data without exceeding the disk space.

I already found a solution how I can create a MySQL dump in docker but in this post you would create a sql file which could be too big.

I am connected to the VM via ssh and can use the docker-cli. Do you know any solutions how I could kind of stream the data to my PC?

2
  • Just an idea... I had seen a trick for this, on how to transfer a file by using netcat. Check the "send file" part of this photo by Julia Evans. Commented Oct 6, 2020 at 8:15
  • can't you provide a network path as the target for the dump? Commented Oct 6, 2020 at 9:29

1 Answer 1

1

With docker: i have 2 projects deployed via docker-compose docker ps shows 2 mysql containers running: proj1-mysql-1 proj2-mysql-1 so i can directly:

docker exec -it proj1-mysql-1 mysqldump db_development |docker exec -i proj2-mysql-1 mysql db_development

With ssh you can do the same but run mysql via ssh

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.