Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to synchronize a subscription between source and destination servers, which has been modified on a source server during/after Plesk migration?
Answer
To sync subscription(s) between source and destination servers, use the Re-sync feature.
-
On a destination Plesk server, go to Tools & Settings > Migration & Transfer Manager > click on an active migration session.
-
Click on the [Re-sync] button next to a subscription that needs to be synchronized.
-
Select what data needs to be re-synced for this subscription and click OK.
-
Re-sync business objects will re-sync new objects that have been added on a source server during/after migration (DNS records, missing databases without database data, database users, FTP and Plesk users, GIT repositories, SSL certificates, etc).
-
Re-sync website files will re-sync only those files that have been added/modified on a source/target server during/after migration.
To prevent the synchronization of files changed on the target server, add an option to the migrator configuration file:
[GLOBAL]
rsync-additional-args: -u -
Re-sync database data (tables, rows, etc.) will remigrate database(s) completely.
-
Re-sync mail messages will re-sync only new emails that have been sent/received/modified on a source server during/after migration. Emails/accounts that already exist on a destination server will not be removed.
-
-
On a destination Plesk server, go to Tools & Settings > Migration & Transfer Manager > click on an active migration session.
-
Switch to the List of subscriptions tab.
-
Click Switch to advanced mode.
-
Select subscriptions that need to be re-synced using check-boxes and click Re-sync.
-
Select what data needs to be re-synced for this subscription and click OK.
- Re-sync business objects will re-sync new objects that have been added on a source server during/after migration (DNS records, missing databases without database data, database users, FTP and Plesk users, GIT repositories, SSL certificates, etc).
-
Re-sync website files will re-sync only those files that have been added/modified on a source/target server during/after migration.
To prevent the synchronization of files changed on the target server, add an option to the migrator configuration file:
[GLOBAL]
rsync-additional-args: -u -
Re-sync database data (tables, rows, etc) will remigrate database(s) completely.
-
Re-sync mail messages will re-sync only new emails that have been sent/received/modified on a source server during/after migration. Emails/accounts that already exist on a destination server will not be removed.
Synchronizing all content
To sync content of all subscriptions, use the following commands:
-
Linux
# cd /usr/local/psa/var/modules/panel-migrator/sessions/<session_dir_name>/
# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator copy-content
-
Windows
C:\> cd %plesk_dir%\var\modules\panel-migrator\sessions\<session_dir_name>
C:\> "%plesk_dir%admin/plib/modules/panel-migrator/backend/plesk-migrator.bat" generate-migration-list
C:\> "%plesk_dir%\admin\plib\modules\panel-migrator\backend\plesk-migrator.bat" copy-content
If initial migration was done via Plesk interface, it is required to modify the config.ini
file in order to synchronize content via CLI. Add the following line in both [plesk]
for target and [source]
for source server directives in %plesk_dir%\var\modules\panel-migrator\conf\config.ini
file:
CONFIG_TEXT: windows-password-type = "plain"
As a result, config.ini
will look alike:
CONFIG_TEXT: [GLOBAL]
target-type = "plesk"
session-dir = "<session_dir_name>"
skip-log-priority-check = "1"
skip-migrator-updates = "1"
skip-set-session-directory-permissions = "1"
use-separate-log = "1"
source-type = "plesk"
sources = "source"
skip-rpc-agent-deployment = "false"
adjust-applications = "true"
[plesk]
ip = "10.10.10.10"
os = "windows"
windows-username = "Administrator"
windows-password = "*******"
windows-password-type = "plain"
[source]
ip = "20.20.20.20"
os = "windows"
windows-username = "Administrator"
windows-password = "*******"
windows-password-type = "plain"
session-dir = "C:\panel_migrator"
copy-mail-content = "full"
copy-web-content = "full"
copy-db-content = "full"
[ui]
data-import-type = "selected"
timing-policy = "false"
resync-content = "true"
operability-check = "true"
Otherwise, the following error will appear:
CONFIG_TEXT: "%plesk_dir%/admin/plib/modules/panel-migrator/backend/plesk-migrator.bat" copy-content
[INFO] Initialize Plesk Migrator
[INFO] Load configuration
[ERROR] The encrypted password is specified in the configuration option 'windows-password' of section 'plesk'. Migration with encrypted passwords is not supported by CLI interface. Replace the encrypted password by plain one (also change the password type to "plain") or set up the plain password in the environment variable 'PLESK_WINDOWS_PASSWORD'.
Synchronizing content separately
Also, content can be synchronized separately. There are three types of content:
- Mail content
- Database content
- Web content
During Mail content synchronization, all mail content is copied from a source server. New mail on a destination server will not be overwritten.
During Database content synchronization, content of a user's database (MySQL/MS SQL) on a destination server is replaced by content from a source server.
During Web content synchronization, files on a destination server are replaced by files from a source server.
For a specific type of content use the following options to sync web, mail and database content accordingly:
copy-web-content
copy-mail-content
copy-db-content
Note: Such commands synchronize already migrated objects' content. If during or after a migration, a new database or a mail account is created, it will not be synchronized. Instead, use the command below:
# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator transfer-accounts --reload-source-data
To sync Business Objects only:
# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator transfer-accounts --reload-source-data --skip-copy-web-content --skip-copy-mail-content --skip-copy-db-content --skip-services-checks --skip-infrastructure-checks --skip-main-node-disk-space-checks --skip-license-checks --skip-capability-checks --ignore-migration-list-errors
To sync content of certain domains only, use the following instruction:
-
Prepare a migration list containing domains that should be synchronized.
The list format should be as follows:
CONFIG_TEXT: Customer: customer
example.com -
Plesk Migrator should be pointed to that migration list directly when executed. For example, to sync web content:
Linux:
# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator copy-web-content --migration-list-file <path-to-the-migration-list>
Windows:
C:\> "%plesk_dir%admin/plib/modules/panel-migrator/backend/plesk-migrator.bat" copy-web-content --migration-list-file <path-to-the-migration-list>
Comments
18 comments
Hi
Can you say, what does mean these asterisks in the string below?
@poh inah thank you for the comment!**** - means directory name for the specific session, changed to <session_dir_name> to make the article more
**** - means directory name for the specific migration session, changed to <session_dir_name> to make the article more informative.
nice article
I am currently using GS Richcopy 360 which provides real time file sync, which means you dont have to worry about the synchronization problem. Cheers, give it a shot!
@Baretto James,
Hi, the article is dedicated to synchronization by Plesk means. GS Richcopy 360 was not tested for that purpose, therefore, we cannot recommend it.
After the initial Migration, here is how to re-sync multiple subscriptions all at once with Plesk Migrator Version: 2.17
As Plesk Server admin:
Go to Plesk Extensions -> My Extensions -> Plesk Migrator -> Open
Click on the current Migration IP address
Click on "List Of Subscriptions" tab.
Click on "Switch to advanced mode" tab.
Select the subscription(s) to re-sync
Click on the grey tab "Re-Sync"
@Fran - HIS
Thank you, this would be really helpful for other Pleskians!
Hi!
Lots of thanks for the article, It is very helpul!
Is it possible to create a scheduled task to synchronize all the content daily in Linux from Scheduled Tasks?
Could you explain how to do it please?
Thank you again!
Hello Rodrigo,
It is possible to use Plesk Scheduled Tasks.
Create task in Tools & Settings > Scheduled Tasks > Add task with the commands from article.
for example to sync content of all domains:
cd /usr/local/psa/var/modules/panel-migrator/sessions/<session_dir_name>/ && /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator copy-content
Note: migration session must be opened
Hello George,
Thank you very much for your quick response.
When I try to register the new task I receive the following message:
"encrypted password is specified in the configuration option 'ssh-password' of section 'source'.
encrypted passwords is not supported by CLI interface. Replace the encrypted password by plain one
(also change the password type to "plain") or set up the plain password in the environment variable 'SOURCE_SSH_PASSWORD'. "
Any idea about this?
Thank you again.
@Rodrigo Marcos
Check whether you have a /usr/local/psa/admin/sbin/modules/panel-migrator/config.ini file. If so, check if it has ssh-password specified as encrypted and change it to a plain one.
@Alisa Kasyanova
Thank you for your indications but I don't have any config.ini there
Should I create it? what content should it have?
Thanks again.
Rodrigo
@Rodrigo Marcos
Yes, add it as per the following documentation:
https://docs.plesk.com/en-US/onyx/migration-guide/migrating-from-supported-hosting-platfoms/migrating-via-the-command-line.75722/
Please note that migration-list file will exclude domains or subscriptions that are migrated. I've encountered Operation finished successfully for 0 out of 0 subscriptions when trying to schedule re-sync.
Hi @Aaron, "re-sync" feature specifically for domains/subscriptions that are already migrated to refresh their content, so it does not skip subscriptions.
How would i re-copy all the mail from the source cpanel server? The source has 12GB and the destination has a couple of kb.
I remove the account form the destination plesk server to try recopy everything and it just doesn't seem to copy a mailbox, no error and said everything is successful. The plan does allow for 25GB per mailbox.Any idea's?
@John
Try to Reload source data to make sure that the migrator is aware of the mail content.
In case it won't help, I suggest contacting regular Plesk support for a closer look.
Hey, did anyone find a solution to this?
Please sign in to leave a comment.