Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Backup warning: Unable to back up database #. Error: Unable to find row with id in data_bases table.

 
backupbackup restore migrationdatabasephpserver

Symptoms

  • A backup for a particular domain finishes with the following warning:

    Unable to back up database #. Error: Unable to find row with id in data_bases table.

Cause

Database inconsistency

Resolution

  1. Connect to the server using SSH

  2. Run the command with the ID of the affected domain (in this case dom_id=37):

    # /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/api-cli/aps.php --get-web-space-instances 37
    ..
    '_name' => 'database',
    '_attrs' => {
    'id' => '5',
    'aps-registry-id' => '380dc3b0-e358-4ecf-a069-bf60eabad408',
    'user' => 'dbuser',
    'prefix' => '',
    },

  3. Back up the psa database

  4. Access the psa database:

    # plesk db

  5. Make sure that the table contains proper values:

    select * from apsResources where registryId='380dc3b0-e358-4ecf-a069-bf60eabad408';
    +----+--------------------------------------+-----------+---------+
    | id | registryId | pleskType | pleskId |
    +----+--------------------------------------+-----------+---------+
    |8| 380dc3b0-e358-4ecf-a069-bf60eabad408 | db-user |7|
    +----+--------------------------------------+-----------+---------+

  6. Find the appropriate values:

    select id, default_user_id from data_bases where name="dbexample";
    +-----+
    | id |
    +-----+
    |5|
    +-----+
    1 row in set (0.00 sec)

    select id from db_users where db_id=5;
    +----+
    | id |
    +----+
    |6|
    +----+
    1 row in set (0.00 sec)

  7. Update psa.apsResources table with correct values:

    update apsResources set pleskId =6where id =8;
    insert into apsResources values (NULL, '380dc3b0-e358-4ecf-a069-bf60eabad408', 'db',5);

Note: If the command executed in step 2 returns more than one database with more than one 'aps-registry-id' and, apply the same process for the other database also. If the command executed in the second step has an empty value for the database ID, that means it is an orphaned record and it should be removed, to do so:

  1. Get the aps-registry-id by running the command for the affected domain and searching for a database with an empty value for it's id:

    # /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/api-cli/aps.php --get-web-space-instances 37 | grep -A5 database
    '_name' => 'database',
    '_attrs' => {
    'id' => '',
    'aps-registry-id' => 'dcb1a095-3aef-4f2b-a872-d196eb041b33',
    'user' => '',
    'prefix' => '',

  2. Remove the row with contains the 'RegistryId' from the previous command:

    delete from apsResources where registryId='dcb1a095-3aef-4f2b-a872-d196eb041b33';

  3. Back up the apsc database and log in apsc database:

    # plesk db

    use apsc;

  4. Retrieve the id to be removed using as UID, the Registryid that you previously got:

    [apsc]> select * from aps_registry_object where uid='dcb1a095-3aef-4f2b-a872-d196eb041b33';

  5. Now with the ID that resulted to the query above use its value as the registry_object_id:

    [apsc]> select * from aps_resource where registry_object_id=16;

  6. Use the ID from the output of the above query as the base_resource_id in the following query:

    [apsc]> select * from aps_resource_adjacency_list where base_resource_id=9;

    After confirming remove the orphaned records:

    [apsc]> delete from aps_resource_adjacency_list where base_resource_id=9;
    [apsc]> delete from aps_resource…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Ruby on Rails vs PHP: Which one’s right for your needs?

Read More »

Exploring Plesk’s Added Value Solutions So Far in 2023

Read More »

Unveiling Sitejet Builder: The Perfect Match for Your Effortless Website Creation Needs

Read More »
Knowledge Base

Plesk migration fails with the warning: Service plan on source server has PHP handler that is not installed on the target server

Read More »

How to change PHP settings for one domain or all domains in Plesk using command line?

Read More »

How to reinstall phpMyAdmin in Plesk for Linux

Read More »

Cannot create server backup in Plesk: Unable to check the amount of free disk space: Argument 2 passed to PleskOsUnix::relativePath() must be of the type string

Read More »

Hosting Wiki

  • Server Redundancy
  • AMP
  • Bare Metal Server
  • Backup
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • PHP
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family