SymptomsTry restoring user and site with sbrestore:
~# /usr/local/sitebuilder/utils/sbrestore user --name=<user name> --with-sites --with-site-content --input=<backup file>.xml
Please wait while the permissions are being set
Note: utility sbrestore is located in directory /opt/sitebuilder/utils/sbrestore on Debian/Ubuntu.
The user was restored without the site. The following error is shown in Sitebuilder log on page Logs of admin panel:
Cannot execute query - Duplicate entry 'e4terw589kv-65608-4' for key 1, sql - UPDATE modules_Feedback_fields SET position=pos...
How to fix the error and restore the site?
CauseThe error is caused by '<position>' options of fields description in backup file. For example:
<position>64058</position> <== this option causes the error
ResolutionRemove all '<position>' options from the backup file. You may use the following command to remove all lines:
~# sed -i '/<position>/d' <backup file>.xml
Additional informationIf you restore from compressed backup file (with --compress option) you need to uncompress the backup first. Use the following procedure to uncompress the backup.
1. Create file uncompress.php:
$file = fopen('/PATH/TO/<backup file>.gz', 'r');
$data = fread($file, filesize('/PATH/TO/<backup file>.gz'));
$data = gzuncompress($data);
2. Uncompress the backup, save result to xml file
~# php uncompress.php > <backup file>.xml
3. After that you may restore the backup with utility sbbackup. Do not use option --compress to restore from xml backup file <backup file>.xml.