diff --git a/README.md b/README.md index 103b48f..6d497fc 100644 --- a/README.md +++ b/README.md @@ -66,21 +66,43 @@ cp .env.example .env 7. Import the database from a production WordPress instance. -```sh -# You need SSH admin access to this production server -ssh wp-05.ops.jquery.net -sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"` > wordpress.sql -``` + ```sh + # You need SSH admin access to this production server + ssh wp-05.ops.jquery.net -Then, on your local machine, run: + sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"` > wordpress.sql + ``` -```sh -# Copy the SQL dump from your home directory on the server (as created by the previous command) -scp wp-05.ops.jquery.net:~/wordpress.sql . -# Docker root database password must match your .env file -# NOTE: There must be no space between -p and the password! -docker exec -i jquerydb mysql -u root -proot < wordpress.sql -``` + Then, on your local machine, run: + + ```sh + # Copy the SQL dump from your home directory on the server (as created by the previous command) + # NOTE: There must be no space between -p and the password! + scp wp-05.ops.jquery.net:~/wordpress.sql . + docker exec -i jquerydb mysql -u root -proot < wordpress.sql + ``` + + Optionally, import the blog database as well. This uses a slightly different set of commands because blog have a shorter naming convention for their database and theme than the doc sites. + + ```sh + ssh wpblogs-01.ops.jquery.net + + # Export wordpress_jquery, and import as wordpress_blog_jquery_com. + # Use --no-create-db to omit DB name during export, so we can set expected name during import. + sudo -u tarsnap mysqldump -p wordpress_jquery --no-create-db > wordpress_blog_jquery_com.sql + sudo -u tarsnap mysqldump -p wordpress_jqueryui --no-create-db > wordpress_blog_jqueryui_com.sql + sudo -u tarsnap mysqldump -p wordpress_jquerymobile --no-create-db > wordpress_blog_jquerymobile_com.sql + ``` + + And then locally: + + ```sh + scp wpblogs-01.ops.jquery.net:wordpress_blog_jquery_com.sql . + + echo 'CREATE DATABASE IF NOT EXISTS wordpress_blog_jquery_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jqueryui_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jquerymobile_com;' | docker exec -i jquerydb mysql -u root -proot + + docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquery_com < wordpress_blog_jquery_com.sql; echo 'UPDATE wp_options SET option_value="blog.jquery.com" WHERE option_name="stylesheet";' | docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquery_com + ``` 8. Visit http://local.api.jquery.com, or https://local.api.jquery.com if you created certs. diff --git a/jquery-wp-content b/jquery-wp-content index 504ae80..216c29c 160000 --- a/jquery-wp-content +++ b/jquery-wp-content @@ -1 +1 @@ -Subproject commit 504ae8029c84930e5ca8c165832c4b46b14cff58 +Subproject commit 216c29c55f1c6811a7ea043b8bcb801363c3d873