Skip to content

Commit

Permalink
Document workaround for pulling with table prefixes (#171)
Browse files Browse the repository at this point in the history
* Document workaround for pulling with table prefixes

* Add verbatim error message to table prefix documentation. #172

* More helpful missing tables error during pull

* Conform pull/sync docs with new missing user table error.

* Fix doc styling.

---------

Co-authored-by: Alec Reynolds <[email protected]>
  • Loading branch information
xaqrox and reynoldsalec authored Oct 5, 2023
1 parent fced3d9 commit 049f79c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion docs/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ lando pull --auth "$PANTHEON_MACHINE_TOKEN" --database=none --rsync
--verbose, -v Runs with extra verbosity
```
::: warning Table Prefixes
Pantheon explicitly does not support table prefixes for [Drupal](https://docs.pantheon.io/guides/php/settings-php#are-table-prefixes-supported) or [Wordpress](https://docs.pantheon.io/wordpress-known-issues#table-prefixes). If you've ended up with table prefixes (you scoundrel), `lando pull` will fail with the error `Couldn't find expected tables (<table name>)` because it will not be able to detect your users table for the post-pull health check. The database contents will have been transferred, but things that should happen after that ("the ole post-migration search-replace on WordPress", pulling files) will not happen. To fix this, set `LANDO_DB_USER_TABLE` to the correct user table name in your env. For example, for prefix `xyz_`:
```yml
tooling:
pull:
env:
LANDO_DB_USER_TABLE: xyz_users
```
:::
Please consult the manual import documentation below if this command produces an error.
#### Manually Importing Your DB and Files
Expand Down Expand Up @@ -150,4 +161,4 @@ lando push --auth "$PANTHEON_MACHINE_TOKEN" --database=none
--help Shows lando or delegated command help if applicable
--message, -m A message describing your change
--verbose, -v Runs with extra verbosity
```
```
2 changes: 1 addition & 1 deletion scripts/pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ EOF
PULL_DB_CHECK_TABLE=${LANDO_DB_USER_TABLE:-users}
lando_pink "Checking db pull for expected tables..."
if ! mysql --user=pantheon --password=pantheon --database=pantheon --host=database --port=3306 -e "SHOW TABLES;" | grep $PULL_DB_CHECK_TABLE; then
lando_red "Database pull failed... "
lando_red "Couldn't find expected tables ($PULL_DB_CHECK_TABLE)"
exit 1
fi

Expand Down

0 comments on commit 049f79c

Please sign in to comment.