Recovering a failed Commerce installation [closed]
-
29-01-2021 - |
Question
Scenario:
- existing site
- 1G PHP memory
- install commerce modules locally
- do some dev and configuring
- cex my config and deploy upstream
- deployment fails with "php out of memory"
- try deployment again (4 times)
- eventually "succeeds"
Failure:
- "Success" is actually a farce.
- Drupal config shows commerce* modules as installed, but the commerce database tables don't exist.
- "drush pmi" reports modules as not installed
- "drush en" reports modules as already installed
- "drush pmu" fatals with "missing database tables"
Any tips on recovering from this? I need to preserve all my existing content and whatnot.
Solution
Here's how i fixed the issue. This was a Drupal Commerce problem, but I think the general process could be applicable to other failed module installations:
- Identify module which failed to install correctly (commerce_product)
- Spin up a new vanilla Drupal site, and install the missing module (and its dependencies). In the case of limited resources, Drupal Commerce may need to be enabled one module at a time.
- After enabling the module successfully on the vanilla site, identify the database tables which exist in vanilla but not in the corrupted site. (In my case, there were 9 commerce_product* tables)
- Create those tables on the corrupted site manually: do a
mysqldump --no-data
against the vanilla site, then import it to the corrupt site. - Now uninstall, then re-install the failed module from the corrupted site.
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange