Skip to content

Commit f050cdc

Browse files
authored
Merge pull request #1 from bshaffer/patch-1
Adds Wordpress Migration instructions for PHP 7.2
2 parents 965f44a + a2af51b commit f050cdc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

appengine/standard/wordpress/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,40 @@ gcloud app deploy
102102
Updating from within the WordPress admin UI will not work because the php72
103103
runtime has a mostly read-only file system.
104104

105+
## Migrating an Existing WordPress Site
106+
107+
To migrate an existing WordPress Site, the first step is to migrate your existing MySQL
108+
database to CloudSQL. This can be done using the `mysqldump` command:
109+
110+
1. Connect to your existing MySQL server and run these commands:
111+
```sh
112+
orig_db_user=[YOUR EXISTING WORDPRESS USER]
113+
orig_db_name=[YOUR EXISTING WORDPRESS DATABASE NAME]
114+
mysqldump --add-drop-table -u ${orig_db_user?} -p ${orig_db_name?} > wpdatabase.sql
115+
```
116+
117+
2. Use `gsutil` to move the SQL to a bucket so you can import this into the CloudSQL
118+
instance you created above.
119+
```sh
120+
bucket_name=[YOUR CLOUD STORAGE BUCKET NAME]
121+
gsutil cp wpdatabase.sql gs://${bucket_name?}
122+
```
123+
124+
3. Use the [CloudSQL Import][cloudsql-import] command in `gcloud` to complete migrating
125+
your database:
126+
```
127+
gcloud sql instances import ${db_instance?} gs://${bucket_name?}/wpdatabase.sql \
128+
--database ${db_name?}
129+
```
130+
131+
4. If you have a custom domain, follow the documentation on
132+
[Mapping Custom Domains][mapping-custom-domains].
133+
105134
[bash]: https://www.gnu.org/software/bash/
106135
[cloudshell]: https://cloud.google.com/shell/docs/quickstart
107136
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
108137
[enable-billing]: https://cloud.google.com/billing/docs/how-to/modify-project
109138
[install-gcloud]: https://cloud.google.com/sdk/downloads
110139
[wsl]: https://docs.microsoft.com/en-us/windows/wsl/install-win10
140+
[cloudsql-import]: https://cloud.google.com/sql/docs/mysql/import-export/importing
141+
[mapping-custom-domains]: https://cloud.google.com/appengine/docs/standard/php/mapping-custom-domains

0 commit comments

Comments
 (0)