How to back up Sitebuilder data


2016-11-16 13:02:52 UTC


2017-08-16 18:27:37 UTC


Was this article helpful?

Have more questions?

Submit a request

How to back up Sitebuilder data

Applicable to:

  • Plesk Sitebuilder for Windows
  • Plesk Sitebuilder for Linux
  • Plesk 11.x for Linux


How to back up Sitebuilder data?


Sitebuilder data can be backed up with the Backup feature in the Sitebuilder GUI, using the sbbackup utility and dumping Sitebuilder data manually.

NOTE: The below methods allow to back up user and site configuration data on the Sitebuilder server. The site's data on the published server is not dumped.

  1. Backup feature in Sitebuilder GUI.

    Log in to Sitebuilder as the administrator and go to Server > Backup .

    Click Create Backup Now to start dumping.

    After the dumping process is finished, you will see the dump you created:

    File: /usr/local/sitebuilder/backups/backup_all_20081222_0905.compressed

    NOTE : Dumping of Sitebuilder modules is a PHP memory-consuming process. Therefore, the following error might can be received, if there are many sites that use modules.

    PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 2540273 bytes) in /usr/local/sitebuilder/include/SB/Site.php on line 818

    In this case, a full backup of Sitebuilder is not created. As a solution, you may temporarily increase the memory_limit parameter in Sitebuilder php.ini configuration file:

    ~# grep memory_limit /opt/php52/etc/php.ini
    memory_limit = 1024M ; Maximum amount of memory a script may consume (16MB)

    Restart Apache and create the backup through the GUI. Then change the parameter back, and restart Apache.

    IMPORTANT : Permanently increasing the memory_limit parameter in Sitebuilder PHP is not recommended, as server performance can be affected.

    After creating the backup, change the memory_limit parameter back to the recommended value of 64M.

    Alternatively, you may back up all Sitebuilder objects (users, sites) one-by-one with the sbbackup utility.

  2. Sitebuilder backup with the sbbackup utility. To back up all content:

    # /usr/local/sitebuilder/utils/sbbackup all --compress --output=/BACKUP/DIR/ALL_BACKUP.gz

    ( /BACKUP/DIR is the directory where backup files are saved to. Select a valid location of your choice.)

    Again, note that dumping of Sitebuilder modules is a PHP memory-consuming process. If there are many sites that use modules, you might get an empty resulting file, ALL_BACKUP.gz.

    Use the command below to dump the user and all its sites.

    # /usr/local/sitebuilder/utils/sbbackup user --uuid=<user uuid> --with-sites --with-site-content --recursive --compress --output=/BACKUP/DIR/USER.NAME_BACKUP.gz

    If the user is a Reseller, then all Site Owners that belong to the user are dumped with this command.

    The following MySQL query can be used to get a list of UUIDs for regular Sitebuilder users:

    mysql> select uuid from user where user_name not like 'admin%';
  3. Manual dumping of Sitebuilder data.

    To back up Sitebuilder data, you may simply save the /usr/local/sitebuilder/htdocs/sites directory, the /usr/local/sitebuilder/config file, and the sitebuilder3 database. You may use the following commands to back up the site directory and configuration:

    # tar -zcf sitebuilder.dump.`date +%F.%s`.tgz /usr/local/sitebuilder/htdocs/sites /usr/local/sitebuilder/config
    ~# mysqldump -u<user> -p<password> sitebuilder3 > /BACKUP/DIR/sitebuilder3.dump.`date +%F.%s`.sql

    ( <user>/<password> are the username and password for the MySQL administrator.)

    The exact name of the Sitebuilder database can be found using the sb_config utility:

    # sb_config --help | grep sb_db_name
    --sb_db_name Sitebuilder database name [sitebuilder3]

    For details about the utilities sbbackup/sbrestore for Sitebuilder 4.5, refer to the Backing Up and Restoring Plesk Sitebuilder Data chapter of the Administrator's Guide .

  4. Scheduled backup of Sitebuilder.

    To create a scheduled backup task, create a script that dumps all content of Sitebuilder, and put the script into crontab.

    Below are examples of such a script.

    This first script is for dumping all content. As a result, one backup file is created in the /BACKUP/DIR directory.
    sbbackup all --compress --output=/BACKUP/DIR/ALL_BACKUP.gz

    The following script is to dump all Sitebuilder users with their sites. As a result, a backup file for each Sitebuilder user is created in the /BACKUP/DIR directory.
    mysql_bin="/usr/bin/mysql" # mysql binary
    mysql_user="admin" # user of mysql administrator
    passwd="setup" # password for mysql administrator
    mysqlsb="$mysql_bin $mysql_opt -u$mysql_user -p$passwd sitebuilder3"
    query="select uuid from user where user_name not like 'admin%'"
    for user in `echo "$query" | $mysqlsb`
    $sbbackup user --recursive --compress --with-sites --with-site-content --uuid=$user --output=/BACKUP /DIR/$user.dump.`date +%F.%s`.gz
Have more questions? Submit a request
Please sign in to leave a comment.