Here is a little sunday project: With the help of the awesome DDEV PHP toolset and ddev-gitpod-launcher, we can fire it up a online version of my repository ddev-pull-wp-scripts, import a backup file (via „ddev pull backup“) and get an existing WordPress site running in the browser (cloud) via Gitpod. 🙌
Please consider sponsoring Randy Fays work on DDEV. See recent slides of Christian Muench if you don’t use DDEV yet and want to know why it will make your life as PHP dev much easier. Chat on Discord if you have questions.
Here is how it’s done:
Create simple backup with BackWPup plugin:
Install the BackWPUp-plugin on your site, add new backup job with default settings, set destination to „Backup to folder“:
Run the job and download the finished backup zip-file to your hard drive.
Launch a new Gitpod instance of mandrasch/ddev-pull-wp-scripts
Just click the button to launch the repository mandrasch/ddev-pull-wp-scripts in Gitpod:
Text link: Open in Gitpod
This is done with via ddev-gitpod-launcher by rfay. Amazing! It will launch a new Gitpod workspace online with everything prepared for DDEV + the repository mandrasch/ddev-pull-wp-scripts will be pulled from GitHub:
Upload backup.zip to Gitpod
Rename the downloaded backup file to backup.zip. Upload it into the folder ddev-pull-wp-scripts. You can right click for upload or just drag & drop the file into the folder.
Depending on your backup size, this can take a while. You can see the progress in the status bar:
Import the backup
Type the following into the Gitpod terminal to run the import script routine:
cd ddev-pull-wp-scripts/ ddev pull backup
Nice, your WordPress site should now be available in the Gitpod browser after using the reload icon:
You can log into /wp-admin/ with your regular user credentials. Here you could try out a WordPress update before doing it on your live site, etc. etc.:
If you experience issues, see troubleshooting.
You can tweak the PHP or MariaDB/MySQL version and webserver type (apache or nginx) in .ddev/config.yaml, e.g. for checking if your site runs on PHP 8.0 without problems. See my online generator or check out the official docs for DDEVs config.yaml-options.
The repository mandrasch/ddev-pull-wp-scripts contains a simple provider script which handles the import steps of the backup.zip-file. The source can be found in .ddev/providers/backup.yaml, it can be executed via „ddev pull backup“. This script runs via the awesome DDEV feature Hosting Provider Integration.
⚠️ Disclaimer regarding privacy
I couldn’t find out with a quick search which server regions are used by Gitpod. Please be aware to research this in regards to GDPR before importing sensitive site data into Gitpod as it might be transferred to US servers.