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

Plesk Uninstall Script (Linux)

Discussion in 'Plesk Service Tools' started by IgorG, Dec 9, 2011.

  1. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,556
    Likes Received:
    1,241
    Location:
    Novosibirsk, Russia
    Dear Plesk users,

    Parallels Plesk Service Team is pleased to present you the uninstall script for removing Plesk from your Linux server.
    Script should remove all Plesk packages and shouldn't remove services like FTP, HTTP, etc. But note that some system services can be broken after Plesk uninstalling due to their tight integration with Plesk.

    So, you can use this script on your own risk and I would like that you will share your experience of script using here.

    Corresponding KB article you can find here - http://kb.parallels.com/en/112988

    Thank you for cooperation.
     
    Last edited by a moderator: Jan 5, 2012
  2. HareeshR

    HareeshR Guest

    0
     
    The script is not working

    Hi

    I tried using the script in our CentOS server which we tried to install plesk. We are getting error:

    '/plesk_remove.sh: line 244: syntax error near unexpected token `
    '/plesk_remove.sh: line 244: `do_rpm_list()

    Line 244 is do_rpm_list()
    {
    exact_list=""
    echo -n "Gavering info from the system... "
    slist=`rpm -qa --qf '[%{NAME}\n]'`
    for pkg in $slist; do
    for i in $plist; do
    [ "$i" = "$pkg" ] && exact_list="$exact_list $i"
    done
    done
    echo "done"
    }


    What could be the issue? Is there any way we can make the script work?

    Thanks and Regards.
     
  3. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,556
    Likes Received:
    1,241
    Location:
    Novosibirsk, Russia
    I have re-uploaded script in KB article. Please try it now.
     
  4. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    uninstall script

    The uninstall script has been tested at one of my servers.

    The strange thing is that a common plesk autoinstaller does not yield the possibility to fully uninstall Plesk Panel.

    In my humble opinion, there should be a common ´uninstaller´, as an addition to the autoinstaller(s).

    The other strange thing is that the most common types of installation are Plesk stand-alone installations.

    In my humble opinion, the uninstall script should remove the Plesk related FTP, HTTP etc. installations and/or, at least, have an option (by parameter) to remove the before mentioned installations at will.

    Kind regards.....
     
  5. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    reinstall after using uninstall script

    The ultimate test of the uninstall script is the reinstallation of Plesk after using the uninstall script.

    It seems to be the case that the uninstall script is removing too much, in order to have autoinstaller working properly when reinstalling the Plesk installation with the autoinstaller.

    The first problem, being the absence of /opt/psa/version, can be easily solved by adding the file, with an appropriate line that indicates the proper version of Plesk to be installed.

    To illustrate, the file /opt/psa/version should contain ´11.0.9 Ubuntu 10.04 110120608.16´ or something similar.

    To Igor and/or Parallels, I should ask with emphasis: adjust the uninstall script to leave the /opt/psa/version file OR to adjust the autoinstaller to check for the existence thereof and the creation of a new appropriate file, if absent.

    Kind regards.....
     
  6. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    reinstall after using uninstall script - Part 2

    The uninstall script does seem to result in the so-called ´Stale pidfile Syndrome´.

    When running the uninstall script, the sw-cp-serverd can leave a process running, so verify the existence of a running process and, if necessary, terminate that.

    Kind regards.......
     
  7. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    reinstall after using uninstall script - Part 3

    A simple change in the uninstall script, of the following kind

    do_remove_garbage()
    {
    rm -rf ~/.autoinstaller ~/parallels 2>/dev/null
    rm -rf /var/run/sw-cp-server.pid 2>/dev/null
    # rm -rf /opt/psa/version /usr/local/psa/version 2>/dev/null
    rm -rf /usr/local/psa/version /opt/psa/core.version /usr/local/psa/core.version 2>/dev/null
    }

    will prevent any problems, mainly the stale pid problem, that can occur.

    The change in script has a clear BENEFIT.

    The uninstall and (following) reinstallation seem to MAINTAIN (almost all) hosting data.

    That is, the uninstall script seems to offer the possibility to restore affected or broken Plesk installations, WITHOUT corrupting the hosting data.

    In my humble opinion, that is most convenient, especially when confronted with system issues and/or attacks.

    However, firewall data (rules) and similar are not maintained, so I need some additional testing for the script to be adapted to allow the restore of relevant data and/or relevant settings.

    Kind regards.........
     
  8. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,556
    Likes Received:
    1,241
    Location:
    Novosibirsk, Russia
    trialotto, Thank you very much for your feedback.
    I do not understand why /opt/psa/version file should not be removed by the script? What is the purpose of this?
    I agree that services should be stopped before running script.
     
  9. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    Igor, the uninstall script can, if necessary, contain

    a) (one) line stopping the psa service, (and)

    b) (one) line removing the file /var/run/sw-cp-server.pid (since the sw-cp-server does not always stop correctly, giving rise to a small probability of a stale pid), (and)

    c) some lines stopping the Plesk related services (since many of those Plesk related services, such as mysql, xinetd etc. do not stop when stopping psa service, as far as I know).

    In theory, the /opt/psa/version file can (and should) be removed.

    In practice, the reinstallation of Plesk (after running the uninstall script) does result in errors, indicating that the before mentioned /opt/psa/version file is required for reinstallation.

    In my humble opinion, the before mentioned errors are likely to be related to the autoinstaller script.

    The causes thereof are not not know to me, even though it seems likely that the /opt/psa/version file can be removed if the sw-cp-server daemon (sw-cp-serverd) is stopped.

    The above will be tested shortly and feedback will follow.

    Furthermore, some attention has to be given to the effect of running the uninstall script on psa database(s).

    In the tests executed, the succesful reinstallation always yields some issues with the existence of earlier database entries, hence preventing the proper recreation of domains, clients etc.

    The above seems to suggest that old data (in remaining database files) cannot be properly updated, when using uninstall script and reinstallation of Plesk thereafter.

    The above is a problem that does resemble the issues when restoring backup files, with (amongs others) the error code of the kind " Virtual host ´´ already exists in Parallels Plesk Panel ".

    It is strange that the backup manager can handle this issue, while the migration manager can not.

    It is certainly strange when noting that, at least to my knowledge, the migration manager is using dump files (backup files) in order to restore them (with backup manager) on the (new) server, to which data is migrated.

    The above can be an incorrect statement, but if not, the difference between the migration manager and the backup manager is in the core the fact that the migration manager is fully automated (command line with fixed arguments), whereas the backup manager is interactive (command line with variable, to be specified arguments).

    Any thoughts on the above would be much appreciated.

    Finally, the uninstall script is not intended to result in a complete removal of (program) dependencies.

    In my humble opinion, a command like apt-get autoremove should be somehow included in the uinstall script.

    Kind regards.....
     
  10. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,556
    Likes Received:
    1,241
    Location:
    Novosibirsk, Russia
    Thank you again. I will forward your feedback to responsible person. All your suggestions will be considered for the further implementation.
     
  11. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,443
    Likes Received:
    206
    reinstall after using uninstall script - General

    In a general fashion, the uninstall script should be able to uninstall specific components.

    At this time, the uninstall script is a full removal of Plesk installation(s).

    In my humble opinion, the basic principle behind the uninstall script is able and, moreover, should be able to (only) remove the components selected - if that yields any advantage compared to full removal of Plesk installation(s).

    If forum users agree with the above, please post a note or send a private message.
     
  12. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,556
    Likes Received:
    1,241
    Location:
    Novosibirsk, Russia
    BTW, the script is open for modifications and anyone of our community can improve it, add new features and share it...
     
Loading...