To migrate an existing "vanilla" WordPress site into this Docker-based Bedrock project, follow the steps below. This setup will allow you to take advantage of Bedrock’s enhanced structure and Composer-based dependency management.
-
Export the Database from your vanilla WordPress site using WP-CLI (or mysqldump, phpMyAdmin, but ensure it is mariadb compatible):
wp db export
-
Place the SQL File in the
mysql/
directory in your Bedrock Docker project. This setup will automatically import any .sql files inmysql/
when the MySQL Docker container is built. -
If you've made changes to your
.env
database variables (DB_NAME
,DB_USER
orDB_PASSWORD
) you must run the following command to recreate the_grants.sql
script:bash .vscode\install.sh
This will restore your database to the Bedrock project.
-
Copy your themes from the vanilla site to the Bedrock directory. Bedrock uses
web/app/
instead ofwp-content/
, so copy themes accordingly:cp -R /path/to/vanillawp/wp-content/themes/* ./web/app/themes
Instead of copying plugins directly, Bedrock manages them through Composer, allowing for better version control and dependency management.
-
List Installed Plugins from the vanilla site using WP-CLI:
wp plugin list
Install Free Plugins via Composer; free plugins are available on WP Packagist. You can install them with:
composer require wpackagist-plugin/{plugin-name}
For multiple plugins, list them together:
composer require wpackagist-plugin/advanced-custom-fields wpackagist-plugin/akismet
-
Install Premium Plugins:
Some premium plugins may support Composer directly. If not, consider using tools like Satispress to manage them in a private repository.
Copy the uploads directory to web/app/uploads/ to match Bedrock’s structure:
rsync -vrz /path/to/vanillawp/wp-content/uploads/ ./web/app/uploads/
```bash
sudo docker compose stop
sudo docker volume rm $(basename "$PWD")_db_data
```
The next time you run docker compose up
, the MariaDB container will initialize with a clean database, and your SQL dump will be restored.
For a more in-depth guide, see How to Convert Vanilla WP Site to Bedrock by Neonbrand.
Your migrated site should now be live and fully integrated into the Bedrock structure, ready for development within this Docker setup.