Article ID: 114863, created on Sep 29, 2012, last review on Oct 2, 2014

  • Applies to:
  • Sitebuilder 4.5 for Windows

Symptoms

I want to migrate a user with sites to new server. How to do this the best way?

Resolution

User may be migrated to new server with backup utilities SBBackup.exe/SBRestore.exe.

Remember that backup utilities of Parallels Plesk Sitebuilder 4.5 were developed to backup and restore a site or a user on the same server. The utilities were not tested for data migration between different servers. Migration tool for site builder data has been developed in Web Presence Builder since version 10.

If you wish to migrate please follow the following steps:

1. Make sure the latest version of Parallels Plesk Sitebuilder 4.5.5 for Windows is installed on both source and destination servers.

You may check this on the Autoupdate page of admin interface of Parallels Plesk Sitebuilder:

Server > Autoupdate
SiteBuilder 4.5 for Windows (4.5.5 build100405.226)       


If the version or build does not match then you should upgrade. Please follow instructions from these KB articles to upgrade:

[How to] How to upgrade Parallels Plesk Sitebuilder 1.x, 2.x, 3.x or 4.x to the latest version 4.5?

[How to] How to verify Parallels Plesk SiteBuilder is up-to-date and install the updates?

2. On source server find user and sites you want to migrate, verify they do not exist on the destination server.

On source server login to Sitebuilder database with "SQL Server Management Studio Express" and find user and sites you want to migrate:

select Id, UserName from AccountEntity where UserName='USER_NAME';
71023D4C-1278-4E57-A736-BA1D469105D3   
USER_NAME

select Id, Alias from SiteEntity where AccountID_Owner='71023D4C-1278-4E57-A736-BA1D469105D3';
2F63652E-F13E-41FE-AF85-486B1DF2549D    SITE_NAME1
BE42CBB9-5806-45EC-A9CE-C5CD8992F5D1    SITE_NAME2


On destination server login to Sitebuilder database with "SQL Server Management Studio Express" and verify the objects do not exist:

select Id, UserName from AccountEntity where Id='71023D4C-1278-4E57-A736-BA1D469105D3';
select Id, Alias from SiteEntity where Id in ('2F63652E-F13E-41FE-AF85-486B1DF2549D','BE42CBB9-5806-45EC-A9CE-C5CD8992F5D1');


If you find the user or the sites on the destination host, remove then through Parallels Plesk Sitebuilder GUI. It's  not recommended that you delete records from the database.

3. Find all hosts on the source server and add them to the destination server.

On source server login to Sitebuilder database and find all hosts with their IDs:

select * from HostEntity;
AFA15158-D824-4AFA-8D19-C3A45BDE48BD    HOST_NAME    SMTP_HOST    25    SMTP_FROM   SMTP_USER   SMTP_PASSSWORD    ADDRESS    1    NULL


Temporary add the host (all hosts) to the destination server. Login to the database and execute the following command:

insert into HostEntity values('AFA15158-D824-4AFA-8D19-C3A45BDE48BD','HOST_NAME','SMTP_HOST','25','SMTP_FROM','SMTP_USER','SMTP_PASSWORD','ADDRESS','1',NULL);

4. On source server find plan of user you are migrating. Create a plan with the same ID on the destination server.

On source server login to Sitebuilder database and find plan assigned to user you are migrating:

select PlanId from AccountEntity where Id='71023D4C-1278-4E57-A736-BA1D469105D3';
DF9D6D04-F159-4172-A3F6-ED02274D8ED2

select Id, Name from PlanEntity where Id='DF9D6D04-F159-4172-A3F6-ED02274D8ED2';
DF9D6D04-F159-4172-A3F6-ED02274D8ED2    PLAN_NAME


On destination server login to Sitebuilder database and find a plan with the same ID:

select Id, Name from PlanEntity where Id='DF9D6D04-F159-4172-A3F6-ED02274D8ED2';

If the plan is missing you should create it. Login to Parallels Plesk Sitebuilder GUI on the destination server and add new plan with name 'PLAN_NAME_migrate' (Users > Plans > Add New Plan). Get ID of new Plan:

select Id, Name from PlanEntity where Name='PLAN_NAME_migrate';
ECF8BFE3-F376-4B78-9870-CE9D592B2A54    PLAN_NAME_migrate

Then change plan's ID in the database. Before you change plan’s ID you’ll need to remove all plan’s settings from Parallels Plesk Sitebuilder GUI:

Users > Plans > PLAN_NAME_migrate > Modules > mark enabled everything > Remove from Plan > OK
Users > Plans > PLAN_NAME_migrate > Page Sets > mark enabled everything > Remove from Plan > OK
Users > Plans > PLAN_NAME_migrate > Templates > mark enabled everything  > Remove from Plan > OK
Users > Plans > PLAN_NAME_migrate > Site Families > mark enabled everything > Remove from Plan > OK
Users > Plans > PLAN_NAME_migrate > Publishing Settings > mark enabled everything > Remove from Plan > OK


Also delete remain records from the database:

delete from PlanModuleEntity where PlanId='ECF8BFE3-F376-4B78-9870-CE9D592B2A54';
delete from PlanPagesetEntity where PlanId='ECF8BFE3-F376-4B78-9870-CE9D592B2A54';
delete from PlanTemplateEntity where PlanId='ECF8BFE3-F376-4B78-9870-CE9D592B2A54';
delete from PlanSiteFamilyEntity where PlanId='ECF8BFE3-F376-4B78-9870-CE9D592B2A54';


Change plan's ID:

update PlanEntity set Id='DF9D6D04-F159-4172-A3F6-ED02274D8ED2' where Name='PLAN_NAME_migrate';

Remember to configure Modules, Hosts, Page Sets, Templates, Site Families and Publishing Settings in the plan HOST_NAME_migrate you added before. Login to destination Parallels Plesk Sitebuilder as admin and enable through:

Users > Plans > PLAN_NAME_migrate
 

5. On source server dump the user with SBBackup.exe:

<SOURCE SITEBUILDER DIRECTORY>\Utils>SBBackup.exe users --uuid=71023d4c-1278-4e57-a736-ba1d469105d3 --recursive --with-sites --with-site-content --output="C:\USER_NAME.xml"

6. Copy dump file "C:\USER_NAME.xml" to the destination server. Restore it with the following command:

<DESTINATION SITEBUILDER DIRECTORY>\Utils>SBRestore.exe all --input="C:\USER_NAME.xml" --log="C:\sbrestore_xml.log"

Restoration log is written into file "C:\sbrestore_xml.log".

You might see this error in the restoration log:

"C:\sbrestore_xml.log"
---8<---
[2013-06-05 09:06:07,959][WARN] Restore exception
SWsoft.SiteBuilder.Backup.BackupServiceException: The plan with ID specified in the root account backup not found
   at SWsoft.SiteBuilder.Backup.Version_4_1.BackupMimeReader.ReadBackup(Stream stream, RestoreConfiguration config, BackupHeader backupHeader)
[2013-06-05 09:06:08,162][WARN] Skip backup record. Owner not found:
Version: 4.1
Record state: Normal
Record type: Site
Record ID: 74a43186-9293-4123-92eb-9e031545eebb
Owner ID: e6adb46a-d8fc-4759-abb9-da44136375f1
--->8---


The error means that owner's ID from the dump file does not match owner's ID on the destination server. You'll need to modify the dump file. Open the file and find OwnerId:

"C:\USER_NAME.xml"
--->8---
  <OwnerId>3934d3de-6eaa-4707-8132-8dc4bc511cb2</OwnerId>                       
  <PlanId>b3fa4f63-e5b3-4038-9a9d-97eab3fedb6f</PlanId>                         
---8<---


Where '3934d3de-6eaa-4707-8132-8dc4bc511cb2' is Owner's ID. Find user details on the source server:

select UserName, Email, Role from AccountEntity where Id='3934d3de-6eaa-4707-8132-8dc4bc511cb2';
admin admin@somehost.tld  0


Find Id of this user on the destination server:

select id, UserName, Email, Role from AccountEntity where User_name='admin' and Role=0;
45655FE5-0959-469C-B379-40A330D84619    admin admin_new@somehost.tld   0


Change Owner ID in the dump file:

"C:\USER_NAME.xml"
--->8---
  <OwnerId>45655FE5-0959-469C-B379-40A330D84619</OwnerId>                      
  <PlanId>b3fa4f63-e5b3-4038-9a9d-97eab3fedb6f</PlanId>                        
---8<---

4d336e73be6d8fa81454b57cedf8e2bb 56797cefb1efc9130f7c48a7d1db0f0c fad6dc0c8e983c17ae70a51ac7952cd0 2a62cbceb986d1b8f45bcd3ff4cb29a5 45e8c8798afdb3e279a2f84bd498d19e

Email subscription for changes to this article
Save as PDF