Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

NOTE: This article is DEPRECATED as the preferred local setup for WordPress devs is to use Lando or native WordPress CLI tools.

Setting up a Wordpress instance Locally with Local.

  1. Create the project in local by selecting 'Add Local Site'

    Image Modified
  2. Once the site is created, clone the project via git

  3. (For Jesse/Ubuntu) Next, Ubuntu users need to rename the wp-content directory in order to successfully create a symlink in next step. i.e.:

    1. Code Block
      mv ~/Local\ Sites/rocketshipstaging/app/public/wp-content/ ~/Local\ Sites/rocketshipstaging/app/public/wp-content-bak/
  4. Now we must symlink the repos together. In my case, I cloned my repo to ~/Documents/repos/ so a symlink for a default Local install looks like this:

    1. ln -s /Users/colegeerts/Documents/repos/aptp/wordpress/wp-content /Users/colegeerts/Local\ Sites/aptp/app/public/

    2. for Jesse/Ubuntu I use:

      Code Block
      ln -s ~/Documents/rocketship/wp-content/ ~/Local\ Sites/rocketshipstaging/app/public/wp-content
  5. Download the Database

    1. Should the Wordpress install contain WPMigrate PRO, the easiest method is to likely just leverage that like so:
      Make sure you have it activated on the Staging site and your Local Dev site. Then head to /wp-admin/tools.php?page=wp-migrate-db-pro#settings to grab the connection info. Go back to your local dev environment to /wp-admin/tools.php?page=wp-migrate-db-pro#migrate. Choose Pull and enter the copied connection info into the Remote Site text area. You'll then need to enter the username and password to access staging. Then your settings should be something like this. Then Pull. It will take about 5 minute or less. Then the local dev site will say Complete and might log you out. Just sign back in and you're good to go.

      Image Modified
    2. Should there not be a connected WPMigrate PRO, download the database and conduct a find and replace for the base url of the application. In my case I use sed, so I invoke a command that looks like:

      1. sed -i 's/https:\/\/aptp\.com/http:\/\/aptp\.local/g' wordpress.sql

      2. This command will look different based on the URL you want to swap. Basically we should be swapping the live url for the Local one (smile)

  6. Import the site via adminer on the Database tab.