1

I am trying to do some simple queries to figure out how a plugin is saving its information. Basically I was getting a really annoying error, and figured out the custom template content was missing on my local. Every other setting/content was transferred over into the database export from the live site. However, for some reason wp db tables is only showing a few of the tables. I checked wp-config, and checked the database through my SQL GUI. Did wp db check and it listed all the tables. However, wp db tables simply is giving wrong information, and any wp db search is not searching the tables that it for some reason is not display. Am I missing something? (for basic reasons, I replaced the name of my local directory and database name with the placeholder clientsite).

clientsite % wp db check
clientsite.wp_commentmeta                          OK
clientsite.wp_comments                             OK
clientsite.wp_duplicator_packages                  OK
clientsite.wp_email                                OK
clientsite.wp_links                                OK
clientsite.wp_my_calendar                          OK
clientsite.wp_my_calendar_categories               OK
clientsite.wp_my_calendar_events                   OK
clientsite.wp_my_calendar_locations                OK
clientsite.wp_options                              OK
clientsite.wp_postmeta                             OK
clientsite.wp_posts                                OK
clientsite.wp_term_relationships                   OK
clientsite.wp_term_taxonomy                        OK
clientsite.wp_termmeta                             OK
clientsite.wp_terms                                OK
clientsite.wp_usermeta                             OK
clientsite.wp_users                                OK
clientsite.wp_woocommerce_api_keys                 OK
clientsite.wp_woocommerce_attribute_taxonomies     OK
clientsite.wp_woocommerce_downloadable_product_permissions OK
clientsite.wp_woocommerce_order_itemmeta           OK
clientsite.wp_woocommerce_order_items              OK
clientsite.wp_woocommerce_payment_tokenmeta        OK
clientsite.wp_woocommerce_payment_tokens           OK
clientsite.wp_woocommerce_sessions                 OK
clientsite.wp_woocommerce_shipping_zone_locations  OK
clientsite.wp_woocommerce_shipping_zone_methods    OK
clientsite.wp_woocommerce_shipping_zones           OK
clientsite.wp_woocommerce_tax_rate_locations       OK
clientsite.wp_woocommerce_tax_rates                OK
clientsite.wp_wpc_client_categories                OK
clientsite.wp_wpc_client_chains                    OK
clientsite.wp_wpc_client_clients_page              OK
clientsite.wp_wpc_client_file_categories           OK
clientsite.wp_wpc_client_files                     OK
clientsite.wp_wpc_client_files_download_log        OK
clientsite.wp_wpc_client_group_clients             OK
clientsite.wp_wpc_client_groups                    OK
clientsite.wp_wpc_client_login_redirects           OK
clientsite.wp_wpc_client_messages                  OK
clientsite.wp_wpc_client_objects_assigns           OK
clientsite.wp_wpc_client_payments                  OK
clientsite.wp_wpc_client_portal_page_categories    OK
clientsite.wp_wpuf_transaction                     OK
Success: Database checked.

WP CLI Tables command gives the following:

clientsite % wp db tables
wp_users
wp_usermeta
wp_posts
wp_comments
wp_links
wp_options
wp_postmeta
wp_terms
wp_term_taxonomy
wp_term_relationships
wp_termmeta
wp_commentmeta
wp_woocommerce_payment_tokenmeta
wp_woocommerce_order_itemmeta

wp-config.php contains the below.

clientsite % cat wp-config.php
define('DB_NAME', 'clientsite');
COGara
  • 43
  • 5

1 Answers1

3

Found the answer. After some more specific google searching and needing to use quotes (originally just kept returning the wp-cli docs page), I found something on the github issues page. Apparently wp db tables only finds the default tables registered to $wpdb, and not all the tables in the database. This is resolved by using --all-tables at the end of my commands.

For reference: https://github.com/wp-cli/wp-cli/issues/2474

COGara
  • 43
  • 5