Error stablishing a database connection after move a multisite installation
-
Hello all!
I wanted to move my wordpress multisite installation to localhost, I found problems and I am stuck and desperate.
The site was https:///admin.example.com/ and I wanted to move to /localhost/www/admin.example.com/
I did a mirror backup from /home/user/admin.example.com/ (hosting) to /home/user/www/admin.example.com/ (localhost with debian).
Then I exported the sql from the hosting and imported at localhost with no errors.With phpmyadmin and searchandreplace.php I changed the urls from https://admin.example.com/ to /localhost/www/admin.example.com/. To be sure enough I checked manually the important fields like wp_options, wp_sites, wp_blogs… etc. I did the same changing the paths of the files, from the hosting’s configuration to localhost’s configuration.
I modified .htaccess and wp-config-php and tried to enter to wordpress, but I found the “too many redirects” error. After a bit of fine-tune the apache configuration files and .htacces and wp-config, I point my browser to /localhost/www/admin.example.com/ and I only see “Error stablishing a database connection”.
I revised the mysql host, user and password. I created new users and passwords and I put them carefully at wp-config file.
I can access to mysql from the console with those credentials so I can assume mysql server is working.I thought something was wrong with Apache. If I put an index.html inside /home/user/www/admin.example.com/ and try to access to /localhost/www/admin.example.com/ apache serves the index.html correct, so I assume Apache is working.
Therefore, something wrong with php is happening, so I downloaded wordpress again and I installed in /home/user/www/blog/, with a new ‘blog’ database and the url localhost/www/blog/. It worked like a charm. I thought the problem was with the multisite option, so I enabled it and it worked like a charm, again. I think we can assume the servers on localhost are working.
Having a multisite installed the easy option is “export from hosting and import in ‘blog'” one by one, but I don’t want to lose all the customization, the plugins, and download one by one all the images (one of the blogs is a image repository).
Server logs don’t say nothing about the error but the error persists. Of course, I can’t say how many times I checked wp-config.php looking for typos.
I don’t know what/how/where to look up to solve this. Can you help me? Where would you look up to fix it? Any ideas?
Sorry for the long post. Thanks in advance.
- The topic ‘Error stablishing a database connection after move a multisite installation’ is closed to new replies.