Plesk

How to restore a deleted Web Presence Builder site from a snapshot located in a domain folder?

Question

Is it possible to restore the site from the domain example.com?

Answer

The site can be restored from a snapshot located in the /data/snapshots directory of the domain where it was published.

When a new site for the domain is created, old snapshots are not shown in Web Presence Builder, even if the files exist in the file system. This is because the name of the main XML file contains the ID of the old site. To show old snapshots for new sites, it is necessary to rename the XML file:

For Linux:

  1. Connect to the server via SSH and check snapshot name:

    # ls -la /var/www/vhosts/example.com/httpdocs/data/snapshots/
    total 252
    -rw-r--r-- 1 testcust psacln 223 Jul 1 13:34 03a21c5dbeaf22159bc109374638f61f_list.xml
    -rw-r--r-- 1 testcust psacln 250139 Jul 1 13:34 3b395edf0050931a8632de93a4d3085a.php

    Here, 03a21c5dbeaf22159bc109374638f61f is the ID of the old site that was published to the domain example.com.

  2. Create a new instance of the WPB site for the domain example.com via Plesk in Domains > example.com > Edit in Web Presence Builder.

    Warning: Do not publish the site yet.

  3. Find the Site ID by the name of the Plesk domain:

    # plesk db
    mysql> select d.name as 'Plesk Domain', s.uuid as 'Site uuid', s.site_id as 'Site ID' from psa.domains d, psa.dom_param dp, sitebuilder5.site s where d.id=dp.dom_id and dp.param='site_builder_site_id' and s.uuid=dp.val and d.name='example.com';
    +--------------+--------------------------------------+----------------------------------+
    | Plesk Domain | Site uuid | Site ID |
    +--------------+--------------------------------------+----------------------------------+
    | example.com | d116751c-458c-5179-3f57-142135a67b3c | 172bc09617fa3dcafded8e53377097d5 |
    +--------------+--------------------------------------+----------------------------------+

  4. Rename the XML file to make it fit the new Site ID:

    # mv /var/www/vhosts/example.mom/httpdocs/data/snapshots/03a21c5dbeaf22159bc109374638f61f_list.xml /var/www/vhosts/example.com/httpdocs/data/snapshots/172bc09617fa3dcafded8e53377097d5_list.xml

  5. Refresh the page with the new site instance. Snapshots should be shown on the "Revert" page. As soon as they are available in WPB, you can restore them by clicking Load.

Note: After the snapshot is restored, there may be additional issues with site images because they have the old location paths in the WPB database. As a result, they may not be visible in the restored site.
To solve this, re-upload the images or change the paths in the database:

# mysqldump --disable-extended-insert sitebuilder5 > sb_backup.sql
# grep "03a21c5dbeaf22159bc109374638f61f" sb_backup.sql | grep widget_property
INSERT INTO widget_property VALUES (570,462,'content','<p><img id="mce-548" style="float: left; margin-right: 20px;" title="helloworld" src="/sitebuilder/sites/03/03a21c5dbeaf22159bc…