• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Forwarded to devs Plesk Migrator does not copy databases from DirectAdmin

peter21581

New Pleskian
Greetings,

Although I'm not a Plesk customer, I'm assisting a friend in transitioning from DirectAdmin to Plesk. While using the Plesk migrator version 2.24.0-1083, I encountered an issue with the database connection code. Despite being unfamiliar with Python coding, I have managed to resolve the problem successfully. Therefore, I kindly request the Plesk development team to implement the necessary modifications to the code accordingly.


Error when migrating from DirectAdmin:
Code:
+|2023-06-21_14:15:58,502|D|MT|core.runners.base|||Execute command on the source server 'directadmin' (103.XXX.XXX.XXX): /opt/plesk/python/2.7/bin/python /root/plesk_migrator/plesk_migrator-umb62pya3ubd1sw60rg8iznzgmlobpfp/agent/main.py
+|2023-06-21_14:15:58,729|D|MT|core.runners.base|||Command execution results:
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||stdout: [2023-06-21 09:15:58] Getting DirectAdmin config
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Connecting DirectAdmin database
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Failed to connect to DirectAdmin database with [login]@[host]:[port] "da_admin@localhost:3306" and password "*****":
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||(1045, u"Access denied for user 'da_admin'@'127.0.0.1' (using password: YES)")
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||Database content will not be dumped
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Determining DirectAdmin database vendor and version
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Connection is not found, breaking
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] -- START DUMP --
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Customer 'giango'
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Subscription 'dietxoxo.com'
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] -- FINISH DUMP --
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Printing warnings
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||Failed to connect to DirectAdmin database with [login]@[host]:[port] "da_admin@localhost:3306" and password "*****":
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||(1045, u"Access denied for user 'da_admin'@'127.0.0.1' (using password: YES)")
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||Database content will not be dumped
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||MIGRATION STATUS:
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||END OF MIGRATION STATUS
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] Writing dump file
=|2023-06-21_14:15:58,729|D|MT|core.runners.base|||[2023-06-21 09:15:58] SUCCESS: 'hosting-description.yaml' is ready

Solution:
Made changes to /usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/directadmin/agent/dumper.py

Line 216
From:
Code:
        try:
            connection = pymysql.connect(
                user=user,
                passwd=passwd,
                host=host,
                port=n_port,
                db="mysql"
            )

To:
Code:
        try:
            if os.path.exists("/var/lib/mysql/mysql.sock"):
                connection = pymysql.connect(
                user=user,
                passwd=passwd,
                unix_socket="/var/lib/mysql/mysql.sock",
                db="mysql"
                )
            else:
                connection = pymysql.connect(
                user=user,
                passwd=passwd,
                host=host,
                port=n_port,
                db="mysql"
            )
 
After checking this, developers think could be a known issue: If the mysqlconf option is not set in Direct Admin, migration fails. It is registered here as ID PMT-4811. In order to be sure that this is the same issue, we'd need to check it on the source server. This could be done if you open a support ticket and let support staff know PPS-14581 and PMT-4811 and whether it can be verified that it is the same issue as documented here already.
 
Hello @Peter Debik ,

Here is the source server information:
Code:
CentOS Linux release 7.9.2009 (Core)
DirectAdmin v.1.650 012240df134922e26c50eb42161af66e4f9d3d59
10.5.17-MariaDB MariaDB Server


The problem arises from dumper.py looking at /usr/local/directadmin/conf/directadmin.conf to determine the location of mysqlconf. It then retrieves the passwd value from mysqlconf, which is stored at /usr/local/directadmin/conf/mysql.conf.

However, when the dumper.py has all the information and tries to connect to MySQL/MariaDB Server with user da_admin via host 127.0.0.1, which is not permitted in DirectAdmin, it results in an error (1045, u"Access denied for user 'da_admin'@'127.0.0.1' (using password: YES)").

On the other hand, if dumper.py tries to connect to MySQL/MariaDB Server with the same user da_admin and password but via host "localhost" instead of "127.0.0.1" everything works correctly.

NVIDIA_Share_WBUdwAyIit.png
 
Thank you again, now accepted as a product issue here, registered as ID PMT-5179. Thank you again for the workaround, too. It will be helpful for others who experience the same issue.
 
Back
Top