• Resolved sergiomolinam

    (@sergiomolinam)


    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.

Viewing 1 replies (of 1 total)
  • Thread Starter sergiomolinam

    (@sergiomolinam)

    Hi all!

    After a few days of intense brain work I had to surrender to the evidence: I am not able enough to solve this.

    All the answers I saw in Google were referred to WordPress NOT multisite installations, so I assume this kind of installations are so much more popular and, therefore, with wider support.

    So I chose the solution I was trying to avoid: export and import by hand each blog and transfer the files to new WordPress systems. It is a bit more complicated, but if something is broken only affects a part.

    Maybe the lack of answers in this topic is due to my (too much) long post. My fault. I had to resume it and go to the point (database connection error). Only in case if something I was trying to do was important, I wanted to post all the information. Next time it will be shorter.

    As suggestion, we need more information in this kind of errors. I do not know if wordpress can do something, or it is something web server or mysql related. More information with clues are highly welcome in these situations, so we can realize if there is a problem with credentials, with the server, with files’ permission…

    Thank you very much.

Viewing 1 replies (of 1 total)
  • The topic ‘Error stablishing a database connection after move a multisite installation’ is closed to new replies.