Note: These instructions are specifically for Windows. Other operating systems might be different, but will use similar concepts.
Required on your computer for this setup: Local by Flywheel, Composer, Node

  1. Download site code from GitHub.
  2. Create new Local by Flywheel site with default settings. Example name: giving
  3. Copy GitHub site code into app folder (/giving/app)
  4. in /giving/conf/nginx/site.conf.hbs, change the root path code to:
    root "C:\Users\YourUsername\Local Sites\giving\app\web";
    Note: the GitHub docs give different root path instructions based on an earlier version of Local by Flywheel
  5. Terminal: in /giving/app:
    composer install --prefer-source
    (will likely take 30 - 60 min)
  6. Terminal: in /giving/app:
    npm install
  7. Terminal: in /giving/app:
    npm run-script build
  8. Terminal: in /giving/app/web/wp-content/plugins/cmb2* folders (4 total):
    composer install --prefer-source
  9. Terminal: in /giving/app/web/wp-content/plugins/carbon-fields-plugin:
    composer install --prefer-source
  10. Terminal: in /giving/app/web/wp-content/plugins/user-switching:
    composer install --prefer-source
  11. Note: In the GitHub Local Environment docs, the .env step is not working
  12. In /giving/app/web/wp:
    Delete wp-config.php
  13. Copy contents of /giving/app/web/wp/wp-config-local.php into /giving/app/config/environments/local.php, replacing similar variables already there. Delete anything redundant.
  14. In /giving/app/config/environments/local.php:
    Fill out info, using the following as defaults (this is what Local by Flywheel uses): database name = 'local'. User = 'root'. Password = 'root'. Host = 'localhost'.
    Beneath the database variables, add: $table_prefix = "wp_";
  15. Download database from Pantheon
  16. Go to Local by Flywheel's Adminer dashboard
  17. Drop tables in local.sql
  18. Import new database from Pantheon into local.sql
  19. In database "options" table, change both the home and siteurl values to http://giving.local
  20. Go to site in Local by Flywheel. The dashboard may show errors that the database isn't connected, but this happens even when the database is successfully connected. So just ignore.
  21. Start the site and view the site. Hopefully, you can see it!
  22. When you go to the WP admin dashboard (go to it via Local by Flywheel), it may show a 404. But, you should see the topbar of the dashboard and still be able to get there successfully.
  23. If you make CSS changes (which should happen in .scss files rather than style.css), compile them using terminal command: grunt
  • No labels