Pr0ject-X / px

Project-X is a pluggable development tool for streamlining redundant project tasks without all the hassle.
https://pr0ject-x.github.io/px/
1 stars 2 forks source link

Cannot sync database from Pantheon #38

Closed fozzieblue closed 4 years ago

fozzieblue commented 4 years ago

We're trying to set up a D8 project using pr0ject-x. We tried to go the drupal-recommended-project route described here, but had no luck: https://youtu.be/FXlNz2rP9LQ

So, I decided to set up a composer-based site with Pantheon first, then try to install pr0ject-x afterwards.

I followed instructions here to create a composer-based site on Pantheon: https://pantheon.io/docs/guides/drupal-8-composer-no-ci

  1. Created a variable for my new site name: export PANTHEON_SITE_NAME="limitless-libraries"
  2. Used terminus to create a new empty site on Pantheon in the NPL org account: terminus site:create --org nashville-public-library $PANTHEON_SITE_NAME 'limitless-libraries' empty
  3. Cloned the example-drops-8-composer repo: git clone git@github.com:pantheon-systems/example-drops-8-composer.git limitless-libraries
  4. I cd'd into the limitless-libraries directory.
  5. Following the directions, I stored the git URL in a variable: export PANTHEON_SITE_GIT_URL="$(terminus connection:info $PANTHEON_SITE_NAME.dev --field=git_url)"
  6. Then, I followed the directions to update git remote to use the Pantheon site Git URL: git remote set-url origin $PANTHEON_SITE_GIT_URL
  7. I removed the files and folders as directed in the instructions. I modified the composer.json file as directed.
  8. I ran composer update because I modified the composer.json file.
  9. I got a site up and running on Pantheon.

Next, I tried to install pr0ject-x:

  1. Require Drupal plugin for this project: composer require --dev pr0ject-x/px-drupal
  2. Require DrupalVM plugin for this project: composer require --dev pr0ject-x/px-drupalvm
  3. Require Pantheon plugin for this project: composer require --dev pr0ject-x/px-pantheon
  4. Initialize Vagrant for this project: vagrant init
  5. Set Pr0ject-x configurations: px config:set
  6. Initialize Pr0ject-x environment: px env:init
  7. Require px for this project: composer require --dev pr0ject-x/px (I noticed this was missing when I compared our composer.json file to the one we can see in the YouTube video.)
  8. Require drush for this project: composer require drush/drush 9 Require drush for this project and put it in the right place: composer require --dev drush/drush (I realized the --dev must make this go in the “require/dev” section of the composer.json file, and now I have drush/drush in two places, yikes.)
  9. Try getting the VM up again: vagrant up (then enter computer password when prompted)

I'm now looking at limitless-libraries.test but instead of seeing the Drupal site, I'm looking at an install screen. This usually signals that I need a database. I am trying to sync a database from Pantheon, but the px pantheon:sync command isn't working.

When I type px pantheon:sync I select dev then wait. It looks like something is happening and it even says "The remote.db.sql.gz file was successfully uploaded!" and "The database was successfully imported into the DrupalVM!" But when I go back to limitless-libraries.text, I'm still only seeing the install screen.

Is there a command or package that we're missing? I'm not sure how to get a database to import.

droath commented 4 years ago

@fozzieblue

It seems like maybe the settings for the local site is not setup correctly. You can navigate to settings.local.php to see if the database connections are defined. I suggest that you try px drupal:local-setup which should get the database connection working. Reach back out if you are still having problems.

fozzieblue commented 4 years ago

@droath

I didn't realize that's what px drupal:local-setup did. I tried it and that worked. We ran that command and we were able to get a database and get our local site up and running. Thank you for your help!

droath commented 4 years ago

@fozzieblue No problem!