1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

After restore Plesk server from backup, 'Duplicate entry' problems

Discussion in 'Plesk Expand 2.3 Troubleshooting Issues' started by eugenevdm, Dec 21, 2008.

  1. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    We have six Plesk servers in an Expand configuration, 2 x Linux, 2 x Windows, 1 x Centralized Mail, and 1 x Centralized DNS.

    1 x Linux server was Fedora Core 4 64-bit but we had problems and re-installed the whole server.
    It's now running Ubuntu 8.04 LTS 64-bit. The restore operation succeeded almost 100%, one problem with a MySQL server and one problem of FTP subdirectory not copying across.

    However now it appears this server is completely out of sync with Expand. A typical error when you reload a domain or client is:

    The domain mentioned in the error report has nothing to do with the client or domain or server that you are trying reload. It looks like the keys are confused.

    Reloading the server or clients gets stuck with the duplicate entry problem, and if you try and reload the domain mentioned it dissappears out of Expand. It still exists on the source server.

    Please assist!
     
  2. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    Restoring Plesk servers from backup changes client/domain identifiers (IDs). You need to erase old 'plesk_client_id' and 'plesk_domain_id` values stored in Expand

    Code:
    /usr/local/expand/sbin/expandmysql -e 'UPDATE plesk_client SET plesk_client_id=NULL WHERE server_id=SERVER_ID'
    /usr/local/expand/sbin/expandmysql -e 'UPDATE plesk_domain SET plesk_domain_id=NULL WHERE server_id=SERVER_ID'
    
    where SERVER_ID - restored Plesk server ID

    then reload Plesk clients then reload Plesk domains.
     
  3. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    That worked.

    Gold, you are a scholar and a gentleman and your advice made of Gold. Thank you so much, now my life can go on!

    kind regards,
     
  4. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    ok spoke a little too soon

    I spoke a little too soon. The following happened:

    Reload Plesk Clients - worked
    Fetching domains information from server - worked
    Reload Plesk Domains - worked
    Fetching domains DNS information from server - failed


    Fetching domain aliasses information from server - failed



    Do you any more clever SQL scripts please?
     
  5. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    Do 'Reload Plesk Clients' and 'Reload Plesk Domains' operations was successfully finished?
     
  6. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    Reload Plesk Clients successfully finished.

    Reload Plesk Domains gives the following error:

     
  7. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
  8. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    You can try to resolve 'Duplicate entry' errors manually. For domain aliases you need to replace 'plesk_domain_alias_id' values in 'plesk_domain_alias' table to its new values returned by Plesk server. Then we can try to resolve such errors in 'plesk_dns_zone' table.
     
  9. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    I followed those actions. From the article:


    This was quite a big task (took about two days, lots of mundane searching and assigning)

    My suggestion:

    When a Plesk client is assigned as an Expand client some criteria changes on the Plesk server, e.g.
    Login name now is the same as the Expand client
    Company name (cname) is now the same as the Expand client
    Personal name (pname) is now the same as the Expand client
    Password is also the same?

    Either way there could be some automated 'matcher' to match up restored records with the ability to confirm actions.

    So after the backup somewhere in Expand a function that tries to match up restored server's client's with existing Expand clients. With a check box that allows you to confirm matches.

    e.g.

    Plesk Client on Restored Server Existing Expand Client Login CNAME PNAME Match?
     
  10. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    This is good suggestion.
     
  11. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    We recently had to re-install another server and ran across the same problems. Fortunately for this post I have been able to resolve the problems within hours instead of days / weeks.

    I saw your comment on resolving domain alias 'Duplicate entry' errors manually and I dreaded the operation and time it would take to do that. But I have now found a good manual way of doing it and I would like to document it here.

    Required:

    - Dual screen configuration
    - SQLyog - works on both Windows and Linux (using WINE)

    1. On the left screen, open SQLyog and connect to the Expand database. Paste the following SQL query in the query window:
    "select name, plesk_domain_alias_id from plesk_domain_alias where server_id = SERVER_ID order by name"

    SERVER_ID can easily be obtained by cliciing 'Plesk servers' in Expand and observing the leftmost column.

    You will get a list of Expand domain aliasses with incorrect IDs.

    2. On the right screen, open SQLyog and connect to the freshly installed Plesk server database. Paste the following SQL query in the query window:
    "select name, id from domainaliases order by name"

    On the left screen, chance the "(Read Only)" to "plesk_domain_alias" so that you can edit the data. Now by looking at the right screen you can easily compare and paste information from the right newly installed server to the incorrect Expand data on the left. Ideally you want someone to read the right hand side for you so that it goes quicker. We quickly did 69 records this way.

    Now that I have sorted out Clients, Domains, and Aliasses I have to fix a whole bunch of DNS records
     
  12. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    The DNS was horribly mixed up. When you looked at the DNS record for a client some completely random other client's DNS showed up (but from the same server). Obviously a case of mixed up IDs. So what I did was de-assign the server from CDNS. I had to do it six times in a row before it worked. I then had to re-assign the server back in CDNS. Again, interestingly enough, I had to re-assign it six times before it worked. The whole process of assigning and re-assigning took about 2 hours.
     
  13. Martin Svensson

    Martin Svensson Guest

    0
     
    Eugene,

    Thanks for your reports! I think that you may have spared the rest of us expand-admins many hours of work.

    One question regarding the DNS issues. Did these problems occur even if you followed the advice from the KB, to completely remove the plesk server from expand and then add it again?

    /Martin
     
  14. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    Martin,

    I have done this procedure twice. The first time around I removed the Plesk server from CDNS and also removed the server itself from Expand. In this case the DNS was correct, but re-assiging 300 clients was not a joke.

    The second time I did it I did not remove the Plesk server from Expand, and only removed the server from CDNS. This is when I got the mixed up IDs, which now in retrospect, makes perfect sense. To be honest with you the DNS problems aren't really worth it and next time I'll remove the server as well. I just dread re-assigning those Plesk clients back to their Expand counterparts....
     
Loading...