- Per the official doc from Bedrock, start by creating a new site in Local.
- Use the "open site folder" or "open site shell" option, delete the public folder in \Local Sites\YOURSITE\app\
- While in \Local Sites\YOURSITE\app, clone your project down into this folder.
- Open the .env file in app\YOURREPO\src and ensure:
DB_NAME=local
DB_USER=root
DB_PASSWORD=root
WP_HOME='https://YOURSITE.local'
- You'll probably also want to ensure that
DB_HOST=localhost
.
- Open up \Local Sites\YOURSITE\conf\nginx\site.conf.hbs, and change the line
root "{{root}}";
toroot "path\to\Local Sites\YOURSITE\app\YOURREPO\src\web"
- To import your database, you can use the adminier linked within Local for your site. If your db import is too large, you can use a tool like DBeaver to connect to the site and perform your larger import.
- If using an external tool like DBeaver, make sure to select the same database type that you setup your Local site with (e.g. mySQL or MariaDB). Also, you can grab the port of your site's database from under the 'Database' tab of your site in local. Remember that the username and password will both be
root
, and the database name will belocal
.
- If using an external tool like DBeaver, make sure to select the same database type that you setup your Local site with (e.g. mySQL or MariaDB). Also, you can grab the port of your site's database from under the 'Database' tab of your site in local. Remember that the username and password will both be
- Run
composer install
andyarn
/npm install
from within your project as usual, and you should now be able to see your site running on your machine when you lick "open site" from within Local (e.g. https://yoursite.local).
Last active
October 2, 2024 18:30
-
-
Save coulterpeterson/593a51a823f063904dcef3f078233e8e to your computer and use it in GitHub Desktop.
How To Import a Bedrock WordPress Project Into LocalWP
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment