0

Banging my head against the wall for a few days here. I have a multi site install live and am trying to pull it down to a localhost on my network since the site isn't active and I want to preserve it. localhost is a linux box running 16.04 with:

  • php Version 5.6.29-1+deb.sury.org~xenial+1
  • apache2 2.4.18
  • mySQL 14.14 Distrib 5.7.16

The live server is running: - php Version 5.4.29 - mySQL 14.14 Distrib 5.5.52 - I cannot figure out how to find out which version of apache is running on the live server.

Here's what I have done to migrate:

  1. Dumped the mySQL database via cPanel
  2. Installed mySQL, apache2, etc. on localhost
  3. Imported the database into mySQL on localhost
  4. Copied every file from my live site down to localhost
  5. Edited /etc/hosts to point 127.0.0.1 yyz.com to maintain the subdomains on the current site.
  6. Ran chgrp to allow www-data to have group access to the folders and files on the local host.
  7. Ran chmod 775 on the folders and files of the localhost
  8. Can confirm that localhost is serving html and php files.
  9. Have changed all instances of wp_*_options siteurl to point to yyz.com
  10. I have tested the database connection via phpand it returns proper table counts. I have done this with a .php file served from yyz.com (yyz.com/sql.php)
  11. I have changed the DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php to reflect a user account that has proper access rights.
  12. I have deleted .htaccess on localhost

When I go to yyz.com or localhost or 127.0.0.1 I get:

Error establishing a database connection

If I go to yyz.com/wp-admin/ or localhost/wp-admin/ or 127.0.0.1/wp-admin/ I get:

One or more database tables are unavailable. The database may need to be repaired.

If I try to repair the database, I get a number of errors that I do not get if I repair the database on the live site:

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'siteurl' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'active_plugins' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'hack_file' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'blog_charset' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'permalink_structure' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'wp_user_roles' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'template' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'stylesheet' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'category_base' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'tag_base' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'link_manager_enabled' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'sidebars_widgets' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_pages' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_calendar' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_archives' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_links' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_meta' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_search' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_text' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_categories' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_recent-posts' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_recent_entries' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_recent-comments' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_recent_comments' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_rss' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_tag_cloud' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'widget_nav_menu' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'use_smilies' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'cron' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('cron', 'a:2:{i:1484715804;a:1:{s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('cron', 'a:2:{i:1484715804;a:1:{s:17:\"wp_update_plugins\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('cron', 'a:2:{i:1484715804;a:1:{s:16:\"wp_update_themes\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'timezone_string' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'gmt_offset' LIMIT 1

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('cron', 'a:2:{i:1484768340;a:1:{s:20:\"wp_maybe_auto_update\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'theme_switched' LIMIT 1


( ! ) Warning: Cannot modify header information - headers already sent by (output started at /home/yyz/Applications/yyz/wp-includes/wp-db.php:1220) in /home/yyz/Applications/yyz/wp-admin/maint/repair.php on line 12
Call Stack
#   Time    Memory  Function    Location
1   0.0001  230104  {main}( )   .../repair.php:0
2   0.0289  1714280 header ( )  .../repair.php:12
WordPress database error: [Table 'yyz.wp_options' doesn't exist]
SELECT option_value FROM wp_options WHERE option_name = 'html_type' LIMIT 1

Stumped and beyond frustrated at this point. Any help is appreciated. Could it be the version differences in mySQL or PHP? Those will be hard, if not impossible for me to fix on the localhost, since it is using mySQL for other applications as well.

1 Answer 1

0

Have you consider using migration plugin like All in one wp migration - https://wordpress.org/plugins/all-in-one-wp-migration/

It takes care of everything out of the box.

1
  • That doesn't work with multisite installs without spending 200 bucks.
    – chow
    Commented Jan 19, 2017 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.