Installation damaged after migration

Discussion in 'ISPConfig 3 Priority Support' started by xavidp, Oct 12, 2016.

  1. xavidp

    xavidp New Member HowtoForge Supporter

    Hi:

    I migrated ispconfig 3.1 from one server with ubuntu 14.04 to another one with 16.04.
    I first did a bare ispconfig3 install and it worked with no problems. I migrated all content with this script:
    https://github.com/xavidp/bashscripts/blob/master/migrateispconfig.sh

    and at some point (I had to redo some parts while detecting some files - like former letsencrypt files - where missing, or mysql crashing, etc), I lost the ability to login again to ispconfig 3.1 in the new server.
    apache error log says:

    [Wed Oct 12 02:12:52.839094 2016] [fcgid:warn] [pid 29447] [client 37.14.127.156:42318] mod_fcgid: stderr: PHP Warning: mysqli_ping() expects parameter 1 to be mysqli, null given in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 245, referer: https://llavorspac.org:8080/login/
    [Wed Oct 12 02:12:52.839097 2016] [fcgid:warn] [pid 29447] [client 37.14.127.156:42318] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 247, referer: https://llavorspac.org:8080/login/

    Any tip?
     
  2. xavidp

    xavidp New Member HowtoForge Supporter

    regarding the access as user ispconfig, I confirm that this user has perms on db dbispconfig for SELECT, INSERT, UPDATE, DELETE .
    But it seems as if the problem is that ispconfig can't connect to the mysql in localhost. I wonder why.
    I've re-set through phpmyadmin the password for user ispconfig, the password I found in
    /usr/local/ispconfig/server/lib/config.inc.php
    But no change.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    That's the config file of the server part. The ispconfig interface uses this file: /usr/local/ispconfig/interface/lib/config.inc.php

    Please check that the mysql password of the ispconfig user is correct there as well.
     
  4. xavidp

    xavidp New Member HowtoForge Supporter

    Mmm, confirmed, same password in both places.

    The other odd thing I see is that the logo of ispconfig 3.1 is not shown in the login page since issues showed up.
    Does this provide any extra meaningful info?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The logo is stored in the database, no database connection = no logo.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to login with the mysql command with the exact same data from the config file:

    mysql -h localhost -u ispconfig -p
     
  7. xavidp

    xavidp New Member HowtoForge Supporter

    mmmm, for some reason, mysql user ispconfig got not password set (as I could see with phpmyadmin in db mysql, table user, row corresponding to ispconfig user.
    I did set the password with the commands in the console:
    mysql -u root -p
    mysql> use mysql
    mysql> update user set Password = PASSWORD('VERYLONGPASSWORDSTRING') WHERE User = 'ispconfig';

    verylongpasswordstring copied from:
    nano /usr/local/ispconfig/server/lib/config.inc.php

    ...
    $conf['db_password'] = 'VERYLONGPASSWORDSTRING';
    ...

    After that, at least, images from the ispconfig logo in the admin page were recovered...
    Now, let's ensure that I didn't change to something weird the password for the admin user for ispconfig. One step at a time... (i remember reading somewhere how to re-set the ispconfig admin pass through the shell)... More info soon.
     
  8. xavidp

    xavidp New Member HowtoForge Supporter

    Ok, I can't login, still, I don't know why. I have double checked that the password for ispconfig in dbispconfig.sys_user is the right one (once converted with md5sum, etc).
    Ah, oh gosh, something to do with the domain now. Once I change the domain https://example.com:8080/ to https://hostname.example.com:8080/, then I was logged in already!

    Uff, oddities, but I reckon that due to some edge case. I reckon that mine is not the usual migration path after the intermediate issues I had with the semi-automatic migration. I had forgotten, for instance, to port also the new entries from /etc/shadow and /etc/gshadow, since they were not copied over by the script i cloned initially for my migration.
    anyway, I hope I can now easily fix the other issues I had with roundcube (nor imap) email working beforehand.

    If I can't succeed, I'll write again.
    Thanks for your support so far, Till, and of course, for the nice piece of FLOSS you helped to produce in ISPCONFIG 3.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    empty your browser cache and delete cookies.
     
  10. xavidp

    xavidp New Member HowtoForge Supporter

    Sure, thanks.

    By the way, everything is fine, now.
    For some mysterious reason (maybe mine was not such an edge case and other might be suffering from this oddity): there was no user roundcube in mysql. I had to create it by hand with phpmyadmin, copying the pass that I found for it in
    /etc/roundcube/debian-db.php

    As if something went wrong (or failed) with the tutorial I followed here:
    https://www.howtoforge.com/tutorial...l-pureftpd-bind-postfix-doveot-and-ispconfig/

    Note that the tutorial indicates to remove mysql 5.7 (default mysql in ubuntu 16.04) and install mariadb instead. Maybe some query is different in that mariadb version? Or maybe I had some issue because of some weird locale issue I had because I couldn't select my usual locale in my computer (currently using LXLE 16.04 in a laptop but I couldn't set my local locale to ca_ES or es_ES, adn therefore, I had en_GB, and the server complains about something related to locale. MAybe no relation, mentioning just in case; running out of ideas on what could be the reason for the roundcube mysql user missing). Or maybe because I was migrating ispconfig 3.0.x upgraded to 3.1 from ubuntu 14.04 (with squirrelmail and not roundcube) to a ubuntu 16.04 with ispconfig 3.1 (which expected roundcube). Since mysql db was replaced by the migration script, I lost roundcube user?

    Oh well, I'm fine now, thanks for ispconfig 3 again. Happy user here.
    Cheers
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    That's very likly if the script replaced all databases incl. mysql.mysql.
     

Share This Page