Prerequisites: Having a running install of Laravel Valet and the WordPress command-line interface wp
.
cd
to the directory where you have chosen to keep your valet sites.- You can find this directory by running
valet paths
; the appropriate directory will not be the one with/.valet/
in its path. - If that command returns no appropriate directory, or no paths at all, you should create a directory on your computer to hold Valet site install directories.
mkdir ~/sites/
will create a folder namedsites
in your user's home directory. Then, runcd ~/sites/
to go there, andvalet park
to register this directory with Valet so that all subdirectories will be served as.test
domains.
- You can find this directory by running
- Create the install's directory:
- If an umbrella repo exists:
git clone git@github.com:INN/umbrella-borderzine
git submodule update --init --recursive
- If an umbrella repo exists:
cd umbrella-borderzine
wp core download
wp config create --dbname=example --dbuser=<user> --dbpass=<pass>
, where<user>
and<pass>
are the database username and password for your computer.wp db create
- if you're working on a multisite, you'll need to add some things to
wp-config.php
. The best way to do that iswp core install
wp core multisite-convert --subdomains --base=borderzine.test --title=foo
- where
borderzine.test
is the domain created by Valet for this directory --title=foo
must be passed but is unimportant and will be reset when you load the database.
- where
- if you're working on a multisite, you'll need to add some things to
wp db reset
- download the sql file, through phpmyadmin/flywheel's interface
wp db import database.sql
, replacingdatabase.sql
with the path to the database you downloaded- If the output of that command contains
ERROR 2006 (HY000) at line 488: MySQL server has gone away
or your mysql error log contains[Note] Aborted connection 10 to db: 'example' user: 'user' host: 'localhost' (Got a packet bigger than 'max_allowed_packet' bytes)
, this StackOverflow solution worked for Ben on 2018-08-22.- Find your mysql error log on OSX by running
ps auxww | grep mysqld
and looking for a string like--log-error=/usr/local/var/mysql/example.local.err
- Find your mysql error log on OSX by running
- If the output of that command contains
wp search-replace borderzine.com borderzine.test --url=borderzine.com --all-tables-with-prefix
- if you're doing a multisite, make sure to rerun that command, replacing
borderzine.com
withsubdomain.org
andborderzine.test
withsubdomain.borderzine.test
, and changing the--url=
parameter to match the valet domain that you just set everything to in the preceding search-replace:wp search-replace subdomain.org subdomain.borderzine.com --url=borderzine.test --all-tables-with-prefix
wp search-replace subdomain.borderzine.com subdomain.borderzine.com --url=borderzine.test --all-tables-with-prefix
- if you're not sure what the URLs for the sites in the multisite are, check the
wp_blogs
table.
- if you're doing a multisite, make sure to rerun that command, replacing
- Optionally, run
valet secure
to serve this site locally over HTTPS using a self-signed certificate. For more about this command, see the Laravel Valet docs. - Optionally, download images and uploads via SFTP. You'll probably only need the newest month's images and the images referenced in the theme settings. Feel free to upload replacement images to the new development site via the normal browser interface.
- In the repo's child theme, if there's a
package.json
, runnpm install