Drupal 8 notes – Transfer site to local system for development

These are procedures and notes to download source code and database content for development use on a local workstation server. The goal is create a mirror of the Drupal based website for local development and testing.

Prerequisites

You should have a local or alternate development system ready. This systems will require a web server running PHP and a database compatible with MySQL. Typically this system should be similar to the system hosting the server you wish to make a copy of for development purposes.

Other tools used on the local system include:

  • PHP-Composer – installed globally
  • Node / npm – installed globally
  • Drush – installed globally
  • Git – installed globally

Transfer Procedures

  1. Export configuration sync package from remote server.
    A. Visit Configurations > Configuration Synchronization.
    B. Visit Export tab.
    C. Download Export file and keep for local set up.
  2. Download Git Repo
  3. Perform composer update:
    composer update drupal/core-recommended –with-dependencies
  4. Download Drupal Database
  5. Install Database for git website. May require your own settings.php file in /sites/default
  6. !!! – Website should load at this point.
  7. !!! Deactivate secure login to stop https redirects:
    drush pm-uninstall securelogin
  8. Log in.
  9. Visit Configurations > Configuration Synchronization. There may be an error for a missing directory. Make sure you create that missing directory path.
  10. Visit Import tab.
  11. Upload file saved in step #1 > C.
  12. Follow upload with “Install All” on Synchronize Import screen.
  13. It’s always a good idea to clear the Drupal Cache: Either with Drush if working:
    drush cache:rebuild
    or by visiting options under Configuration > Performance.
  14. They may be fine, but you may also check database updates with Drush:
    drush updatedb

Leave a Reply

Your email address will not be published. Required fields are marked *