• 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

Forwarded to devs Migrating subscriptions does not preserve setup date if there is no webhosting

mr-wolf

Silver Pleskian
Plesk Guru
TITLE:
Migrating subscriptions does not preserve setup date if there is no webhosting
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
CentOS Linux 7.4.1708 / Plesk Onyx Version 17.8.6 / Plesk Migrator 2.11.4-0
‪CentOS 5.11 (Final)‬ / Plesk version 12.5.30 Update #71
PROBLEM DESCRIPTION:
I migrated all domains from my old Plesk 12.5.30 server.
On this server I have domains that were migrated from even older Plesks.
I believe some of them were on Plesk 7.5

In all those migrations the original setup date was preserved.

Yesterday I migrated all the domains from that server to a new server.
Now that these are all migrated I noticed that the original setup date was lost on all domains that have webhosting disabled.

Because that server was used for DNS this means that all domains, except a few, do not have their original dates anymore.​
STEPS TO REPRODUCE:
Migrate all subscription from 1 Plesk server to another server using the migration tool.

Turn off webhosting on some of those domains on the original server before migrating.​
ACTUAL RESULT:
On the destination server the setup date is lost on domains without webhosting

Source server

upload_2017-10-18_16-9-54.png

Target Server
View attachment 13629
EXPECTED RESULT:
Setup Dates should be preserved always...​
ANY ADDITIONAL INFORMATION:
As I can't really repeat the migration I would like to have that setup date repaired on the target server....
Could you be of some help???
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Confirm bug
 

Attachments

  • upload_2017-10-18_16-8-43.png
    upload_2017-10-18_16-8-43.png
    59.9 KB · Views: 6
Is there some way you could help me with restoring the original setup date on the target?
The target is now in production and in another 10 years I would still like to see those dates from 2006, 2007, 2008

I assume they are in the database...
 
Thank you. Bug was confirmed and submitted by developers as PMT-4051
 
Thank you. Bug was confirmed and submitted by developers as PMT-4051
You're welcome....

But now I would like to correct these dates in the database....
Can you give me some hints about the place in the original database and how to correct these in the new database?
 
You can correct value of cr_date field in domains table.
 
Thanks @IgorG,

Didn't do much with MySQL, but was able to do this anyhow.
I exported the table domains from my old server (ns3).
I used notepad++ to edit all the `domains` references to `domains_ns3` (This part is important or you will overwrite your original table).
I renamed domains.sql to domains_ns3.sql

On my new server I invoked:

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa >psa.sql # Dump the psa database
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa <domains_ns3.sql # Import the extra table domains_ns3
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa # Start mysql on database psa

MariaDB [psa]> UPDATE domains JOIN domains_ns3 ON domains.name = domains_ns3.name SET domains.cr_date = domains_ns3.cr_date;
Query OK, 296 rows affected (0.01 sec)
Rows matched: 310 Changed: 296 Warnings: 0


MariaDB [psa]> drop table domains_ns3;
Query OK, 0 rows affected (0.02 sec)

MariaDB [psa]> quit
Bye


If you want to make sure that setup date is only overwritten if they match a certain date (the day of the migration), you can use an additional filter.
I used this to correct some migrations I did in the past....


UPDATE domains JOIN domains_ns3 ON domains.name = domains_ns3.name SET domains.cr_date = domains_ns3.cr_date where domains.cr_date between '2016-08-23' and '2016-08-29';

I hope this helps others that value this setup date....
 
Last edited:
Back
Top