• Saturday , 30 May 2020

Docker Tutorial: Backing Up and Restoring MySQL and WordPress in Docker

Code Canyon

In this video we’ll cover how to backup files from your docker container as well as a MySQL database. This is done with an installation of WordPress.

Original source

3d Ocean

Related Posts


  1. kensley lewis
    September 21, 2017 at 18:38

    what is difference between this tutorial process, and simply doing a docker export (contianer id) for the wordpress container and mysql container?

  2. Prakash Heda
    September 21, 2017 at 18:38

    Nice one….it helped… on;y if you have used non default user name and DB name that would be perfect from security point….

  3. Moffassal Hossain
    September 21, 2017 at 18:38

    Excellent tutorial, This is all I needed to create a new wordpress from existing wordpress container. I like the simple approach; no fancy tools are involved. Of-course it can be automate using tools like Ansible or similar. Thanks again πŸ™‚

  4. Edvin Norling
    September 21, 2017 at 18:38

    Im currently getting rather nuts since im trying to get this thing in to a cronjob:
    shouldn't it be something like:
    docker run –rm -v $(pwd):/backups/ –link=mywrodpress_db_1:dz mysql /usr/bin/mysqldump –host$DZ_PORT_3306_TCP_ADDR -uroot -psecret wordpress > /backups/wordpress.sql

    I have seen other people doing it with already fixed containers but now im to stubborn…

    I can't get it to use my DZ_PORT_3306_TCP_ADDR variabel…
    How do get it to use it's own variabel?
    Since it's already linked i shouldn't have to define a -e DZ_PORT_3306_TCP_ADDR, half the point is to use the linked one ^^

  5. Daniel Stinebaugh
    September 21, 2017 at 18:38

    For scripting reasons I'd lean on the "exec" option. For a mysql dump from your host just run something like
    docker exec wpfig_db_1 mysqldump –all-databases –password=secret > /backups/wordpress.sql
    Should result in you having your .sql file where you expect it πŸ™‚ Keep up the vid's they're a great help!

  6. Webdev Tory Anderson
    September 21, 2017 at 18:38

    As someone who's just getting started with Docker, this was a terrific tour through basic navigation of containers. I'm going to put this to good use as I figure out how to migrate my local WordPress sites to containers

  7. Steven House
    September 21, 2017 at 18:38

    Doood – if you could create a video about how to create Mid-High level videos – the world could benefit from thiis. πŸ™‚

  8. Clifton Canady
    September 21, 2017 at 18:38

    after running the below command… why would the var/www/html directory be empty?Β 

    docker run -it –rm -v $(pwd):/backups –volumes-from=wpfig_file_1 busybox

  9. Gert-Jan Bark
    September 21, 2017 at 18:38

    Would it be possible to map the file system to some container that supports incremental file system (preventing possible issues that could arrise if a user is working on the WP environment, between the dumping of the sql and the backup of the files)?

  10. Peter Reginald
    September 21, 2017 at 18:38

    Thanks for this tutorial. You've helped me understand a great deal. Now I have to learn fig.

  11. ikacns82
    September 21, 2017 at 18:38

    Β It would be great if you could show us a diagram like on the "Setting Up a WordPress Site Using Docker" that diagram really helped. It is a little difficult to mentally map what you are doing ( going in to container, exporting mysql, sharing volumes…)

Leave A Comment

You must be logged in to post a comment.