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

How do I completely wipe out my Plesk customer data before migration ?

Discussion in 'Plesk 11.x for Linux' started by phlampe, Jan 29, 2013.

  1. phlampe

    phlampe New Pleskian

    22
    73%
    Joined:
    Jun 23, 2008
    Messages:
    17
    Likes Received:
    0
    Hello All !

    I've been using one of my Plesk servers as a fallback for my main Plesk installation, migrating data (domains and customers) regularly in order to refresh this fallback server.

    I usually start by removing all customers (and their associated domains and subscriptions) before migrating everything from my production server. But it seems that over time, some objects aren't properly removed with I delete the customers, and there is one particular domain that resists all my attempts to wipe it out: when I select it from the source server in the migration manager, it appears as if it was already on my destination server, and the migration fails with this these errors:


    (actual IP, guid and domain name changed)

    So I suppose that some part of that domain definition isn't properly removed when I delete it's owner, and I'd like to sort of wipe out all the data part of my Plesk installation to start fresh and then migrate everything from my source server.

    Is there a way of doing this without removing Plesk 11 completely ?

    Thanks for any ideas or suggestions,
    Paul-Henri
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    The issue was due the entry for domain 'mydomain.net' is already present in the psa database.
    For some reason records in database may not be removed completely.
    You can create dump of psa database for fresh installed Plesk and restore it after removing all domains/clients/subscriptions on Plesk server. vhosts directories, dns zones and webserver and mailserver configs also should be cleared.
     
  3. phlampe

    phlampe New Pleskian

    22
    73%
    Joined:
    Jun 23, 2008
    Messages:
    17
    Likes Received:
    0
    Thanks a lot for your answer, Igor, it seems like a good way to go.

    Do you have an idea of where I can find such a "blank" database file ? I'm thinking of something included in the installer archive (I suppose this is how Parallels would initialize or bootstrap a first time installation). Otherwise, my only other option would be to dump (= utterly destroy) my current Plesk installation, reinstall it completely, configure it a little (the bare minimum to have the panel working, no customer, no domain), save the empty database in case it gets corrupted again and then migrate everything from my source server.

    Because I didn't do a Plesk install since 2 ou 3 years ago, I'm sort of reluctant to try it (mainly because I think I will spend more time doing it, compared to reimporting a "blank" database file, but maybe I'm mistaken).

    I also thought about trying a pleskbackup of my source server and restoring it on the fallback server, but the Plesk versions are different (10.4.4 vs 11.0.9) and I don't know if it would work better than the migration tool.

    Cheers,
    Paul-Henri
     
  4. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    After installation fresh Plesk just create dump of database with

    # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > /root/psa_clean.dump

    and use it for restoring.
     
  5. phlampe

    phlampe New Pleskian

    22
    73%
    Joined:
    Jun 23, 2008
    Messages:
    17
    Likes Received:
    0
    Hello Igor !

    Thanks a lot for your answer. I finally reinstalled everything and took the opportunity to change and upgrade the OS too, from Ubuntu 10.04 to Centos OS 6.3 (to be in line with my source server), and then reinstalling Plesk 11.0.9.

    I then exported the mysql database to a dump file (in case I need it in the future), using your command line, then reimported all the domains with no problems.

    Cheers,
    Paul-Henri
     
  6. phlampe

    phlampe New Pleskian

    22
    73%
    Joined:
    Jun 23, 2008
    Messages:
    17
    Likes Received:
    0
    Hello All !

    Here's a followup a year later: I used the clean backup I made a year ago because I want to test the upgrade from Plesk 11.0.9 to 11.5. So I wanted to reimport all the domains from my production machine, but I ran again into the same problem on the same domain I had when I started this thread. So I decided to wipe out everything clean and reimport the domains.

    To use my clean dump, I had to enter the following commands:
    Code:
    mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e"DROP DATABASE psa;"
    mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e"CREATE DATABASE psa;"
    mysql -f -uadmin -p`cat /etc/psa/.psa.shadow` psa < /root/plesk/psa_clean.dump
    
    I figured out what to do thanks to this post from the KB: How can I backup/restore a Plesk database dump?

    Enjoy!
    Paul-Henri
     
Loading...