Migrate your site on Dashboard

This tutorial will guide you in moving your production site on Dashboard.

This tutorial assumes you’ve created a site on Dashboard and will guide you in how to migrate the contents of your production site into your newly created Dashboard site. Any WordPress site is usually split in three main components: the code (wp-content folder without the media files), the database and the media files (uploads folder), so we’ll take each of these one by one.

To follow this tutorial, you’ll need a site to move, more exactly archives of it’s code, database and media files. In this tutorial, the site to be moved is in a repository called mysite.

Step 1. Import the code

1. Create a repository on GitHub

You’ll need to store your code on your own GitHub repository, you can use our Stack example repo as a starting point. For example, you can create a new repository and copy the contents from stack-example-wordpress into your new repo.

2. Setup Google Cloud Build

You can also set up any other CI that updates the site when pushing on master, Here are Google’s detailed steps on how to run builds on GitHub.

To use the Google Cloud Build app, your repository must contain a cloudbuild.yaml file to configure your build, here is an example you can use a starting point:

steps:
- name: 'gcr.io/cloud-builders/docker'
  args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/www-mysite-com-lemqz:$SHORT_SHA', '.' ]
- name: 'gcr.io/cloud-builders/kubectl'
  args: ['patch', '-n', 'proj-by57pu', 'wordpress', 'www-mysite-com-lemqz', '--type=json', '-p', '[{"op": "replace", "path": "/spec/image", "value": "gcr.io/$PROJECT_ID/www-mysite-com-lemqz:$SHORT_SHA"}]']
  env:
  - 'CLOUDSDK_COMPUTE_ZONE=europe-west4-c'
  - 'CLOUDSDK_CONTAINER_CLUSTER=presslabs-dashboard-1'
images:
  - 'gcr.io/$PROJECT_ID/www-mysite-com-lemqz:$SHORT_SHA'
  1. Add themes and plugins to the repo

Copy the wp-content/themes and wp-content/plugins folders from your the site you want to move into your new dashboard site.

Step 2. Import the database

Step 3. Import media files