Plesk

After removing a WordPress domain in Plesk WP Toolkit starts to show an error: Can not find domain by id X

Symptoms

Cause

Orphaned data in WordPress SQLite database for the removed domain

Resolution

Apply the corresponding steps:

For Plesk on Linux Server

  1. Connect to the Plesk server via SSH.

  2. Create a backup dump of the 'psa' database.

  3. Remove any possible tasks leftover from the Plesk database:

    # plesk db "truncate longtasks"
    # plesk db "truncate longtaskparams"

  4. Create a backup of the WP Toolkit database:

    # cp -p /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3{,.backup}

  5. Access the WP Toolkit database in SQLite:

    # sqlite3 /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3

  6. Enable headers:

    # sqlite> .headers on

  7. Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is 123:

    # sqlite> select instanceId from InstancesDomains where domainId=123;
    instanceId
    567

  8. Remove all corresponding information:

    # sqlite> DELETE FROM Instances where domainId=123;
    sqlite> DELETE FROM InstanceProperties WHERE instanceId=567;
    sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
    sqlite> DELETE FROM Instances where id=567;

    Note: If more than one instance id was listed on the previous step output, execute the above InstanceProperties, InstanceDomains and Insntances deletions for each ID number accordingly.

  9. Exit SQLite:

    # sqlite> .quit

For Plesk on Windows Server

  1. Connect to the Plesk server via RDP.

  2. Download the command tool for managing SQLite databases and extract sqlite3.exe into %plesk_dir%varmoduleswp-toolkit.

  3. Create a backup of the 'psa' database.

  4. Open a command prompt (CMD) as Administrator and remove possible tasks leftovers from the Plesk database:

    C:> plesk db "truncate longtasks"
    C:> plesk db "truncate longtaskparams"

  5. Create a backup copy of the WP Toolkit database:

    C:> copy "%plesk_dir%varmoduleswp-toolkitwp-toolkit.sqlite3" "%plesk_dir%varmoduleswp-toolkitwp-toolkit.sqlite3.bak"

  6. Open the downloaded tool and access the WP Toolkit database:

    C:> "%plesk_dir%varmoduleswp-toolkitsqlite3.exe" "%plesk_dir%varmoduleswp-toolkitwp-toolkit.sqlite3"

  7. Enable headers:

    sqlite> .headers on

  8. Get a WordPress instance ID using the domain ID from the error…

Exit mobile version