Login/Register
Installatron Plugin
API Documentation

Restore Backup

POST /backups/{id}/restore

Restore a user's backup to its original location.

Note: this API was previously named restore. That name will continue to work.

Parameters


API

/backups/{id}/restore
API endpoint.

{id} is the internal ID of the backup to restore.
POST
Method.

Optional parameters

user
string
The system or control panel username the task is to be performed on or for.

default is the owner of the backup identified by {id} in the API request

Optional database parameters

Include these
db_*
parameters for the application to use a specific database.

* These are required parameters if you are providing a database.
db_host
string
*
The database server.
db_name
string
*
A pre-created database name.
db_user
string
*
A pre-created database username. This user must have full privileges access to the db_name database.
db_pass
string
*
The password of the pre-created database user.
db_prefix
string
Prefix added to database table names.

defaults for the prefix behavior are configured in Installatron Admin > Features
db_host_ip
string
If a different MySQL host value must be temporarily used to connect to the database, use this argument to provide the temporary address. Installed application files will be written with the db_host value, but Installatron will use db_host_ip while installing. Typically omitted.
(eg.
123.123.123.123
)

default is to access db_host directly

Special parameters

background
boolean
Determines whether a task is run as a foreground or background process.
  • false
    = No backgrounding (the task will complete before returning to your script or prompt).
  • true
    = Return to your script after preliminary error checking is completed (disk space, PHP requirements, etc) and then perform the rest of the task on a different process.
Use the GET /tasks API to query the status of a background task.

default is
false
dryrun
enum
Perform a test run of this API call: run the tests, check connections to the database server and remote locations, but don't actually perform this task itself. This is just a test-run to make sure that when it is run for real that there is nothing to stop it from working.
  • none
    = No dry run.
  • all
    = Check all input values and test all connections.
  • input
    = Check only the input values.


default is
none

Response


Response

status
int
HTTP status code describing the result of the request.

200
for Success.
All other numbers represent errors which are described in the errcode output below.
result
boolean
true
= Success.
false
= Failure.
errcode
string
status code 200
complete_dryrun
dryrun was enabled and finished without error.
status code 400
empty_argument_bkloc
Automatic Backup set to default location but no default location is available.
invalid_argument_autobk_custom_daily
Daily Automatic Backup schedule is too frequent.
invalid_argument_autobk_custom_weekly
Weekly Automatic Backup schedule is too frequent.
invalid_argument_autobk_custom_monthly
Monthly Automatic Backup schedule is too frequent.
invalid_argument_autobk_schedule
The backup schedule ID provided is not valid.
invalid_argument_bkloc
Backup location invalid or does not exist.
invalid_backup_app
Attempting to restore a backup, with ID1, to its original location however there is different app installed there now, with ID2.
invalid_website_vhost
The backup's original website is no longer associated with the user's webhosting account (it's not in the account's vhosts).
status code 403
invalid_argument_user
User specified is not authorized to access this data.
status code 404
backup_not_found
The backup archive is not found in its backup location.
user_not_found
The specified user could not be found in the system control panel.
status code 500
failed_backup_download
Backup archive header failed to download.
failed_database_create
Failed to create database and database-user pair.
failed_filesystem_permission
Insufficient user permissions to the path provided.
errfield
enum
If the cause of an error was an incorrect field value then this will show the ID of the field.
(eg.
login
,
passwd
,
email
)
message
string
Message describing the result of the request. Do not rely on this to determine the success or failure of the request.
data


id
string
Internal ID for this install.
(eg.
1234567890abcdefghij12345
)
agent
string
Version of Installatron that installed or imported this install.
(eg.
10.0.0
)
application
string
Type of application this is, referenced by its internal application ID.
(eg.
wordpress
,
drupal
,
magento
)

See Apps Table for a complete list of installer IDs.
autobk
enum
The automatic backup configuration.
  • none
    = Auto-backups are disabled.
  • schedule
    = Use the admin-defined backup schedule referenced by the autobk_schedule parameter.
  • custom
    = Use the backup schedule defined by the combined autobk_daily, autobk_weekly, and autobk_monthly parameters.


default is
none
autobk_schedule
string
(Only when autobk is
schedule
)
Internal ID of backup schedule that will be used for this app's backing up.
(eg.
1234567890abcdefghij1234567890ab
)

Schedules are created by an admin or reseller account in Installatron administration > Schedules and a schedule ID can be found by either editing the schedule from there (the ID is the first value displayed on the edit page), or by using the GET /set/backup_schedules API.

default is no value
autoup
enum
Automatic update configuration.
  • none
    = Never update.
  • all
    = Always update.
  • minor
    = Update to new minor versions.


default is
minor
autoup_backup
enum
Automatically create a backup and automatically restore the backup if the update fails.
  • none
    = Never backup.
  • all
    = Always backup.


default is
all
autoup_plugins
enum
(WordPress only) Automatic plugin update configuration.
  • none
    = Never update.
  • all
    = Always update.
  • custom
    = Per-plugin control over what will and won't be auto-updated.


default is
all
autoup_themes
enum
(WordPress only) Automatic themes update configuration.
  • none
    = Never update.
  • all
    = Always update.
  • custom
    = Per-theme control over what will and won't be auto-updated.


default is
all
bkloc
string
Location of new backups for this app.
  • local
    for the user's account
  • Or the internal ID of a remote backup location. (eg.
    1234567890abcdefghij12345
    )
cache_files
(internal use only)
cache_numbackups
(internal use only)
cache_preview
(internal use only)
cache_table
(internal use only)
cache_time
(internal use only)
db_host
string
IP address or hostname of the database server used by this app.
(eg.
localhost
,
127.0.0.1
, or a remote IP/hostname)
db_type
enum
Type of database used by this app.
(eg.
mysql
,
pgsql
)
db_name
string
Name of the database used by this app.
db_user
string
Name of the database-user used by this app.
db_pass
string
Name of the database-user's password used by this app.
db_prefix
string
Name of the database table prefix used by the tables of this app.
(eg.
wp_
,
dw8q_
)
login
string
A custom field value of this installer, in this case the administrative user's username.
(eg.
admin
)
email
string
An example custom field value of this installer, in this case the administrative user's email address.
(eg.
username@mydomain.com
)
language
enum
Language used by this install.
(eg.
en
,
no
)

See the GET /browser/{id} API to find a full list of languages supported by this version of this application.
sitetitle
string
A custom field value of this website, in this case the website's title.
(eg.
My Family Blog
)
sitetagline
string
A custom field value of this website, in this case the website's tagline.
(eg.
The personal blog of the family Smith.
)
limitloginattempts
boolean
A custom field value of this website, in this case
yes
indicates this optional (WordPress only) plugin is enabled.
twofactor
boolean
A custom field value of this website, in this case
yes
indicates this optional (WordPress only) plugin is enabled.
exclude_files
array of strings
Array of files and folders the user has selected to be excluded from backups and clones of this app.

eg.
"exclude_files": [
  "wp-content/cache"
],
file
string
Path to Installatron's data file for this application.
(eg.
/home/username/.appdata/current/1234567890abcdefghij12345
)
files
array of strings
Array of files and folders that Installatron knows to be associated with this app.

eg.
"tables": [
  "index.php",
  "license.txt",
  ".htaccess",
  ".maintenance",
  "readme.html",
  "wp-activate.php",
  "wp-admin",
  "wp-app.php",
  "wp-blog-header.php",
  "wp-comments-post.php",
  "wp-config.php",
  "wp-config-local.php",
  "wp-config-sample.php",
  "wp-content",
  "wp-cron.php",
  "wp-includes",
  "wp-links-opml.php",
  "wp-load.php",
  "wp-login.php",
  "wp-mail.php",
  "wp-settings.php",
  "wp-signup.php",
  "wp-trackback.php",
  "xmlrpc.php"
],
incomplete
boolean
Indicates when the application is incomplete/broken.
(eg.
false
for the application is complete,
true
for an install, migration, or clone failed to create this application successfully*

*In this case we recommend that you uninstall this broken install and try the task again, or restore a backup)
link_admin
string
Path, relative to the install's main URL, to the app's administrative backend.
(eg.
wp-admin
)
notification
array of strings
Array of email notifications that the owner of this app will receive. An empty array means no notifications.

Available notifications:
  • backup
  • backup_error
  • clone
  • clone_error
  • install
  • install_error
  • plugin_update
  • plugin_update_available
  • plugin_update_error
  • restore
  • restore_error
  • sync
  • sync_error
  • template
  • template_error
  • update
  • update_available
  • update_error
(eg.
["update_available","update","update_error"]
)
(eg.
[]
for no notifications)

default is all notification types enabled
parent
string
Internal ID of the application this app was staged from.
(eg.
1234567890abcdefghij12345
)

default is empty
path
string
Location of this install's files.

(eg.
/home/username/public_html/blog
)
(eg.
/var/www/vhosts/mydomain.com
)
(eg.
c:\inetpub\vhosts\mydomain.com
)
plugins
array of structures
(WordPress only) Array of information about the plugins used by this application and whether auto-updating is enabled.

eg.
"plugins": [
  {
    "id": "akismet",
    "version": "5.3.6",
    "activated": false,
    "autoup": "all"
  },
  {
    "id": "limit-login-attempts-reloaded",
    "version": "2.26.18",
    "activated": true,
    "autoup": "all"
  }
],


See the GET /installs/plugins API for more information.
stage
string
Internal ID of the app that will be selected as the default stage when then app is synced.
(eg.
1234567890abcdefghij12345
)

default is empty
tables
array of strings
Array of all database tables Installatron knows to be associated with this app.

eg.
"tables": [
  "wp_commentmeta",
  "wp_comments",
  "wp_links",
  "wp_options",
  "wp_postmeta",
  "wp_posts",
  "wp_term_relationships",
  "wp_term_taxonomy",
  "wp_termmeta",
  "wp_terms",
  "wp_usermeta",
  "wp_users"
],
themes
array structure
(WordPress only) Array of information about the themes used by this application and whether auto-updating is enabled.

eg.
"themes": [
  {
    "id": "twentytwentythree",
    "version": "1.6",
    "active": false,
    "autoup": "all"
  },
  {
    "id": "twentytwentyfive",
    "version": "1.1",
    "active": false,
    "autoup": "all"
  }
],


See the GET /installs/themes API for more information.
time_created
integer
Date and time when this application was installed (as a Unix timestamp).
(eg.
1234567890
)
time_updated
integer
Date and time when this install was last updated (as a Unix timestamp).
(eg.
1234567890
)
title
string
Title of the website, used in Installatron only.
(eg.
My blog
)
url
string
Address where this website is viewed online.
(eg.
https://website.com/blog
)
url_domain
string
domain portion of the url parameter.
(eg.
website.com
)
user
string
Control panel user that owns this install.
(eg.
useraccountname
)
version
string
Application's (as currently used by this website) version.
(eg.
1.2.3
)
version_autouped
string
The version that Installatron last automatically updated the website's application to. Note that the user may have manually updated the app to a newer version since this Automatic Update happened.
(eg.
1.2.3
)
version_autouped_attempts
integer
The number of failed attempts, by Installatron, to update the website's application. Installatron will stop trying to update this application after 3 failed attempts. This count resets after a successful update.
(eg.
2
)
version_available
string
Highest version of the application that Installatron can update the application to, from the version the website is currently using.
(eg.
4.5.6
)
version_available_minor
string
Highest minor version of the application that Installatron can auto-update the application to, from the version the website is currently using.
(eg.
1.2.8
)
version_updates_available
integer
Total number of new versions available for this website's application.
(eg.
11
)

Full Examples

Example: Restore a backup to its original URL

Method: curl
Installatron Product: Installatron Plugin (switch to Installatron Server)
$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi?     # cpanel
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi?    # whm
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw? # directadmin

curl -X POST $cpapi/backups/1234567890abcdefghij12345/restore \
    -H 'Accept: application/json'
Response: json
{
    "result": true,
    "status": 200,
    "errcode": null,
    "errfield": null,
    "message": "The task is complete.\n"
    "data":
        {
            "id": "1234567890abcdefghij12345",
            "application": "wordpress",
            "agent": "10.0.0",
            "autobk": "schedule",
            "autobk_schedule": "1234567890abcdefghij1234567890ab",
            "autoup": "minor",
            "autoup_backup": "all",
            "autoup_plugins": "none",
            "autoup_themes": "none",
            "bkloc": "local",
            "cache_numerrors": 1,
            "cache_numwarnings": 0,
            "cache_files": 12345678,
            "cache_numbackups": 0,
            "cache_preview": 12345,
            "cache_tables": 123456,
            "cache_time": 1234567890,
            "db_host": "localhost",
            "db_type": "mysql",
            "db_name": "databasename",
            "db_user": "databaseusername",
            "db_pass": "dAtAbAsEpAs5//0rD",
            "db_prefix": "wp_",
            "login": "admin123",
            "email": "admin@website.com",
            "language": "en",
            "sitetitle": "My blog",
            "sitetagline": "Just another WordPress site",
            "limitloginattempts": "yes",
            "twofactor": "no",
            "failures": [],
            "file": "/home/useraccountname/.appdata/current/1234567890abcdefghij12345",
            "files": [
                "index.php",
                "license.txt",
                ".htaccess",
                ".maintenance",
                "readme.html",
                "wp-activate.php",
                "wp-admin",
                "wp-app.php",
                "wp-blog-header.php",
                "wp-comments-post.php",
                "wp-config.php",
                "wp-config-local.php",
                "wp-config-sample.php",
                "wp-content",
                "wp-cron.php",
                "wp-includes",
                "wp-links-opml.php",
                "wp-load.php",
                "wp-login.php",
                "wp-mail.php",
                "wp-settings.php",
                "wp-signup.php",
                "wp-trackback.php",
                "xmlrpc.php"
            ],
            "incomplete": true,
            "link_admin": "wp-admin",
            "notification": [],
            "parent": "1234567890abcdefghiparent",
            "path": "/home/useraccountname/public_html/staging",
            "plugins": [
                {
                    "id": "akismet",
                    "version": "5.3.6",
                    "activated": false,
                    "autoup": "all"
                },
                {
                    "id": "limit-login-attempts-reloaded",
                    "version": "2.26.18",
                    "activated": true,
                    "autoup": "all"
                }
            ],
            "stage": "1234567890abcdefghijstage",
            "tables": [
                "wp_commentmeta",
                "wp_comments",
                "wp_links",
                "wp_options",
                "wp_postmeta",
                "wp_posts",
                "wp_term_relationships",
                "wp_term_taxonomy",
                "wp_termmeta",
                "wp_terms",
                "wp_usermeta",
                "wp_users"
            ],
            "themes": [
                {
                    "id": "twentytwentythree",
                    "version": "1.6",
                    "active": false,
                    "autoup": "all"
                },
                {
                    "id": "twentytwentyfive",
                    "version": "1.1",
                    "active": false,
                    "autoup": "all"
                }
            ],
            "time_created": 1611356510,
            "time_updated": 1647057773,
            "title": "My blog stage",
            "url": "http://website.com/staging",
            "url_domain": "website.com",
            "user": "useraccountname",
            "version": "6.7.2",
            "version_autouped": "6.7.2",
            "version_autouped_attempts": 1,
            "version_available": "6.7.3",
            "version_updates_available": 3
        }
}

Example: Restore a backup and provide an existing and configured database for the restored install to use

Method: curl
Installatron Product: Installatron Plugin (switch to Installatron Server)
$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi?     # cpanel
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi?    # whm
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw? # directadmin

curl -X POST $cpapi/backups/1234567890abcdefghij12345/restore \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '
        {
            "db_host": "localhost",
            "db_name": "user_exampledbname",
            "db_user": "user_exampledbuser",
            "db_pass": "exampledbpassword",
            "db_prefix": "wp_"
        }
       '
 
Response: json
{
    "result": true,
    "status": 200,
    "errcode": null,
    "errfield": null,
    "message": "The task is complete.\n"
    "data":
        {
            "id": "1234567890abcdefghij12345",
            "application": "wordpress",
            "agent": "10.0.0",
            "autobk": "schedule",
            "autobk_schedule": "1234567890abcdefghij1234567890ab",
            "autoup": "minor",
            "autoup_backup": "all",
            "autoup_plugins": "none",
            "autoup_themes": "none",
            "bkloc": "local",
            "cache_numerrors": 1,
            "cache_numwarnings": 0,
            "cache_files": 12345678,
            "cache_numbackups": 0,
            "cache_preview": 12345,
            "cache_tables": 123456,
            "cache_time": 1234567890,
            "db_host": "localhost",
            "db_type": "mysql",
            "db_name": "databasename",
            "db_user": "databaseusername",
            "db_pass": "dAtAbAsEpAs5//0rD",
            "db_prefix": "wp_",
            "login": "admin123",
            "email": "admin@website.com",
            "language": "en",
            "sitetitle": "My blog",
            "sitetagline": "Just another WordPress site",
            "limitloginattempts": "yes",
            "twofactor": "no",
            "failures": [],
            "file": "/home/useraccountname/.appdata/current/1234567890abcdefghij12345",
            "files": [
                "index.php",
                "license.txt",
                ".htaccess",
                ".maintenance",
                "readme.html",
                "wp-activate.php",
                "wp-admin",
                "wp-app.php",
                "wp-blog-header.php",
                "wp-comments-post.php",
                "wp-config.php",
                "wp-config-local.php",
                "wp-config-sample.php",
                "wp-content",
                "wp-cron.php",
                "wp-includes",
                "wp-links-opml.php",
                "wp-load.php",
                "wp-login.php",
                "wp-mail.php",
                "wp-settings.php",
                "wp-signup.php",
                "wp-trackback.php",
                "xmlrpc.php"
            ],
            "incomplete": true,
            "link_admin": "wp-admin",
            "notification": [],
            "parent": "1234567890abcdefghiparent",
            "path": "/home/useraccountname/public_html/staging",
            "plugins": [
                {
                    "id": "akismet",
                    "version": "5.3.6",
                    "activated": false,
                    "autoup": "all"
                },
                {
                    "id": "limit-login-attempts-reloaded",
                    "version": "2.26.18",
                    "activated": true,
                    "autoup": "all"
                }
            ],
            "stage": "1234567890abcdefghijstage",
            "tables": [
                "wp_commentmeta",
                "wp_comments",
                "wp_links",
                "wp_options",
                "wp_postmeta",
                "wp_posts",
                "wp_term_relationships",
                "wp_term_taxonomy",
                "wp_termmeta",
                "wp_terms",
                "wp_usermeta",
                "wp_users"
            ],
            "themes": [
                {
                    "id": "twentytwentythree",
                    "version": "1.6",
                    "active": false,
                    "autoup": "all"
                },
                {
                    "id": "twentytwentyfive",
                    "version": "1.1",
                    "active": false,
                    "autoup": "all"
                }
            ],
            "time_created": 1611356510,
            "time_updated": 1647057773,
            "title": "My blog stage",
            "url": "http://website.com/staging",
            "url_domain": "website.com",
            "user": "useraccountname",
            "version": "6.7.2",
            "version_autouped": "6.7.2",
            "version_autouped_attempts": 1,
            "version_available": "6.7.3",
            "version_updates_available": 3
        }
}


© 2004 - 2025 Installatron LLC. All rights reserved. Privacy Policy.