Skip to main content

SQL password issue when migrating to new server

Comments

3 comments

  • cPanelMichael
    Hello :) The method you are planning to use (obtaining the password from the script configuration files) is likely the most reliable method. It might be time-consuming, but many applications do store the database password in a configuration file in plaintext. Thank you.
    0
  • Oliver hills
    Sorry for bumping an older thread but I thought the below script may help for others in the same situation, it currently finds WordPress and Joomla passwords in the root of a users public_html. It's not pretty as I couldn't be bothered to fix egrep for the Joomla search but it works!
    #!/bin/bash cd /home/ users=($(ls -d */ |grep -v tmp)) for user in "${users[@]}" do path=/home/$user'public_html/' if [ -f $path'wp-config.php' ] then printf '\n%s\n' 'WORDPRESS config found for user '$user cat $path'wp-config.php' |egrep "DB_NAME|DB_USER|DB_PASSWORD" elif [ -f $path'configuration.php' ] then printf '\n%s\n' 'JOOMLA config found for user '$user cat $path'configuration.php' |grep "\$db " cat $path'configuration.php' |grep "\$user " cat $path'configuration.php' |grep "\$password " fi done
    0
  • cPanelMichael
    Thank you for taking the time to provide that workaround.
    0

Please sign in to leave a comment.