• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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

phlampe

New Pleskian
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:


Error:
Failed deployment of domain mydomain.net

Error:
Execution of /opt/psa/admin/plib/api-cli/domain.php --create mydomain.net -owner admin -do-not-apply-skeleton -notify false -guid a13f0a40-ad36-4bf2-ad9d-25ef24fd6bc1 -vendor-guid 4d23ce91-929c-4d16-83bc-370cac6651fa -creation-date 2007-12-28 -ip 1.2.3.4 -ignore-nonexistent-options failed with return code 2.
Stderr is
Domain with name "mydomain.net" already exists
(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
 
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.
 
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
 
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.
 
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
 
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
 
Back
Top