Adding sites to the WordPress Toolkit in ispmanager 6
In ispmanager 6, you can manage WordPress versions, themes, and plugins in the WordPress section if the CMS and its components were installed through the ispmanager control panel.
To add manually installed WordPress and its components to the section, go to Navigation board - Website management - WordPress and click Synchronize.
However, if WordPress was installed manually before the WordPress Toolkit was added to ispmanager 6, add the site to the control panel database manually.
First, find out the exact version of your manually installed WordPress. After that you can begin working with the database by connecting to the server via SSH.
MySQL
If MySQL was selected as the primary DBMS during panel installation, connect to the ispmgr database in this DBMS via the console:
mysql
mysql> use ispmgr;Next, run the following commands to obtain the necessary data:
- Find your WordPress version ID:
select id, catalog_id from aps where catalog_id is like '%wordpress%<wordpress_version>%'; - Find the WordPress site ID:
select id from webdomain where name = '<site_name>'; - Check the IDs taken by other WordPress sites:
select id from aps_assign;
Also collect WordPress data and prepare an HTML block with parameters:
<aps_params>
<username> </username> -- the user-owner of the domain.com website
<admin_login> </admin_login> -- WordPress administrator login
<admin_password> </admin_password> -- WordPress administrator password
<database_server> </database_server> -- the database server in ispmanager 6 where the WordPress database is located
<database> </database> -- the name of the database in ispmanager 6 connected to WordPress
<database_username> </database_username> -- the username of this database
</aps_params>Now you can add a record to the aps_assign table by running the following SQL query:
INSERT INTO aps_assign (id, aps, webdomain, path, fast_install_wordpress, parameters, update_error, update_running) VALUES (<unused_aps_assign_id>,<wordpress_version_id>,<site_id>,<site_home_directory>,'on',<wordpress_parameters>,'','off');After adding the record, go to Navigation board - Website management - WordPress and click Synchronize: your site's WordPress information will become available in the WordPress Toolkit.
SQLite3
If SQLite3 was selected as the primary DBMS during installation, queries must be run directly against the database file at /usr/local/mgr5/etc/ispmgr.db:
- Find your WordPress version ID:
sqlite3 -header -column /usr/local/mgr5/etc/ispmgr.db "select id, catalog_id from aps where catalog_id is like '%wordpress%<wordpress_version>%';" - Find your WordPress site ID:
sqlite3 -header -column /usr/local/mgr5/etc/ispmgr.db "select id from webdomain where name = '<site_name>';" - Check the IDs taken by other WordPress sites:
sqlite3 -header -column /usr/local/mgr5/etc/ispmgr.db "select ID from aps_assign;"
Also collect WordPress data and prepare an HTML block with parameters:
<aps_params>
<username> </username> -- the user-owner of the domain.com website
<admin_login> </admin_login> -- WordPress administrator login
<admin_password> </admin_password> -- WordPress administrator password
<database_server> </database_server> -- the database server in ispmanager 6 where the WordPress database is located
<database> </database> -- the name of the database in ispmanager 6 connected to WordPress
<database_username> </database_username> -- the username of this database
</aps_params>Now you can add a record to the aps_assign table by running the following SQL query:
sqlite3 /usr/local/mgr5/etc/ispmgr.db "INSERT INTO aps_assign (id, aps, webdomain, path, fast_install_wordpress, parameters, update_error, update_running) VALUES (<unused_aps_assign_id>,<wordpress_version_id>,<site_id>,<site_home_directory>,'on',<wordpress_parameters>,'','off');"After adding the record, go to Navigation board - Website management - WordPress and click Synchronize: your site's WordPress information will become available in the WordPress Toolkit.
Example
Let's review an example of adding the domain.com website with WordPress version 4.7.
Connect to the DBMS and the ispmgr database:
root@server:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use ispmgr;
Reading table information for completion of table and column names
...
Database changedRetrieving id information from tables:
mysql> select id, catalog_id from aps where catalog_id like '%wordpress%<версия_wordpress>%';
+----+--------------------------------------------------------------------------------------------------------------------------------------+
| id | catalog_id |
+----+--------------------------------------------------------------------------------------------------------------------------------------+
| 56 | tag:apscatalog.com,2017-05-17:/1.2/WordPress.org/WordPress/4.7.5-241/Plesk/undefined/undefined/undefined|2023-07-13 15:34:09|off|off |
+----+--------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select id from webdomain where name = 'domain.com';
+----+
| id |
+----+
| 5 |
+----+
1 row in set (0.00 sec)
mysql> select id from aps_assign;
+----+
| id |
+----+
| 2 |
| 3 |
| 4 |
| 6 |
+----+
1 row in set (0.00 sec)Preparing a string with parameters for the CMS. For example, the site owner is user www-root, and WordPress is connected to the wp47db database on a MariaDB 10.5 server, which administrator is wp47db_adm:
<aps_params>
<username>www-root</username> -- the user-owner of the domain.com website
<admin_login>admin</admin_login> -- WordPress administrator login
<admin_password>passwd</admin_password> -- WordPress administrator password
<database_server>mariadb-10.5</database_server> -- the database server in ispmanager 6 where the WordPress database is located
<database>wp47db</database> -- the name of the database in ispmanager 6 connected to WordPress
<database_username>wp47db_adm</database_username> -- the username of this database
</aps_params>Now we add all the data to a single SQL query, selecting any id that wasn't in the output of the select id from aps_assign command:
INSERT INTO aps_assign
(id, aps, webdomain, path, fast_install_wordpress, parameters, update_error, update_running)
VALUES
(1,56,5,'/var/www/www-root/data/www/domain.com','on','<aps_params><username>www-root</username><admin_login>admin</admin_login><admin_password>passwd</admin_password><database_server>mariadb-10.5</database_server><database>wp47db</database><database_username>wp47db_adm</database_username></aps_params>','','off');After adding the record, go to Navigation board - Website management - WordPress and click Synchronize: your site's WordPress information will become available in the WordPress Toolkit.