Skip to content

Instantly share code, notes, and snippets.

@coulterpeterson
Last active October 2, 2024 18:30
Show Gist options
  • Save coulterpeterson/593a51a823f063904dcef3f078233e8e to your computer and use it in GitHub Desktop.
Save coulterpeterson/593a51a823f063904dcef3f078233e8e to your computer and use it in GitHub Desktop.
How To Import a Bedrock WordPress Project Into LocalWP

How To Import a Bedrock WordPress Project Into LocalWP

  1. Per the official doc from Bedrock, start by creating a new site in Local.
  2. Use the "open site folder" or "open site shell" option, delete the public folder in \Local Sites\YOURSITE\app\
  3. While in \Local Sites\YOURSITE\app, clone your project down into this folder.
  4. 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.
  5. Open up \Local Sites\YOURSITE\conf\nginx\site.conf.hbs, and change the line root "{{root}}"; to root "path\to\Local Sites\YOURSITE\app\YOURREPO\src\web"
  6. 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 be local.
  7. Run composer install and yarn/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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment