For example to push the web site from Test to Production, or to build a Live-like version of the web site on your development machine.
Starting point: Working Wordpress install with real content deployed as shown in "Deploying Wordpress in a Docker container" and "Deploying Mysql in a Docker container".
On Test:
export Database using a Wordpress Plugin like WP Migrate DB
export data files from the data volume container used by Wordpress container as described above
Instantiate a database server container as described above
Import the mysql dump as shown in "Import a sql database dump in Mysql running in a Docker container"
Create a data volume container for Wordpress as shown in first part of "Deploy Wordpress in a Docker container"
Import data files as shown in "Import into a data volume container"
verify that all files have been copied over. Remove the 'wp-config.php' file.
Instantiate a wordpress server container as described in second part of "Deploy Wordpress in a Docker container"
Notes:
When exporting data files, you can either backup the whole /usr/share/nginx/www or just /usr/share/nginx/www/wp-content
When exporting data files, you may want to exclude large files from the uploads directory. E.g: You can pass '--exclude "*.mp3" to the tar command to exclude all mp3
if you have exported /usr/share/nginx/www, Wordpress software is included which is most of the time what you want to do when migrating from Test to Production, but is rarely what you want if you were using these steps to get production data from Live installation into a newer version of the web site being developed. In that case export only wp-content
the last note results from the fact that a mount point from a data volume container supersedes the identically named mount point from the instantiated container. More info at Docker Docs.
For example to push the web site from Test to Production, or to build a Live-like version of the web site on your development machine.
Starting point: Working Wordpress install with real content deployed as shown in "Deploying Wordpress in a Docker container" and "Deploying Mysql in a Docker container".
On Test:
On Production:
Notes: