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:
- Dumped the
mySQL
database viacPanel
- Installed
mySQL
,apache2
, etc. onlocalhost
- Imported the database into
mySQL
onlocalhost
- Copied every file from my live site down to
localhost
- Edited
/etc/hosts
to point127.0.0.1 yyz.com
to maintain the subdomains on the current site. - Ran
chgrp
to allowwww-data
to have group access to the folders and files on the local host. - Ran
chmod 775
on the folders and files of the localhost - Can confirm that localhost is serving
html
andphp
files. - Have changed all instances of
wp_*_options
siteurl
to point toyyz.com
- I have tested the database connection via
php
and it returns proper table counts. I have done this with a.php
file served fromyyz.com
(yyz.com/sql.php
) - I have changed the
DB_NAME
,DB_USER
,DB_PASSWORD
andDB_HOST
inwp-config.php
to reflect a user account that has proper access rights. - I have deleted
.htaccess
onlocalhost
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.