How to configure FTP storage settings via SQL query?

Created:

2016-12-22 13:50:50 UTC

Modified:

2017-08-08 13:40:57 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to configure FTP storage settings via SQL query?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux

Question

How to configure FTP storage settings via SQL query?

Answer

NOTE: direct inserts into databases is not a safe way to manage Plesk. Instead, it is recommended to use API requests for automation purposes.

The following query can be used to configure FTP storage settings for backup in psa database for domain-level settings:

begin;
select @id:=6;

INSERT INTO `BackupsSettings` 

VALUES
(@id,'domain','backup_ftp_settingactive','true')
(@id,'domain','backup_ftp_settinghost','
192.0.2.2')
(@id,'domain','backup_ftp_settingdirectory','/ftp_dir_path/')
(@id,'domain','backup_ftp_settinglogin','ftpusername')
(@id,'domain','backup_ftp_settingpassword','*********')
(@id,'domain','backup_ftp_settingpassive_mode','false')
(@id,'domain','backup_ftp_settinguse_ftps','false')
(@id,'domain','backup_ftp_settinguse_backup_password','false')
(@id,'domain','backup_ftp_settingbackup_password','');
commit;

For domain-level settings: BackupsSettings.id = domains.id and BackupsSettings.type = 'domain'

For server-wide settings: id=1 and BackupsSettings.type = 'server' .

Have more questions? Submit a request
Please sign in to leave a comment.