Discussion in 'General' started by Steffan, Apr 22, 2024.

  1. Steffan

    Steffan Member


    if i set backups to 5 for a website
    Then it saves 5 days of web backups but only one database backup
    is that ia bug or is the intentional
  2. Well-Known Member HowtoForge Supporter

    Is the one backup from a manual backup?
    Is the database assigned to the website (still)?
    Have you checked the logs for "Failed to make backup of type mysql" or "skipping database backup for domain" ?

    Can you provide us with some minimal informations => Operating System is Debian/Ubuntu/... ? Your Mysql/Mariadb version?
    Are you using remote storage for the backup?
    Last edited: Apr 22, 2024
  3. Steffan

    Steffan Member

    no it is a automatic backup.
    only the last sql backup is saved.
    The database is connected to the site,
    Tonight it removed the sql backup of 22-04 en replaced it with 23-04

    it is a multi server setup.
    CentOS Stream release 8 for web and sql
    latest Ispconfig

    xisting backups
    Date Type Backup format Scheduler Encrypted Backup file Filesize
    23.04.2024 00:23 Website files zip (deflate) Auto No 9759,31 MB
    23.04.2024 00:00 MySQL Database gzip Auto No db_c162dbxxx_2024-04-23_00-00.sql.gz 200,94 MB
    22.04.2024 00:22 Website files zip (deflate) Auto No 9758,72 MB
    21.04.2024 00:25 Website files zip (deflate) Auto No 9759,54 MB
 likes this.
  4. Well-Known Member HowtoForge Supporter

    Web and Database Backup intervals can be adjusted individually, basically.
    I assume the setting for your database is weekly then.
    Despite my badge I do not know top of my head where to change the setting in the UI.

    But you can go to phpmyadmin or mysql console, select the dbispconfig database / use dbispconfig;
    and verify you can find the database in question using
    SELECT `id`, `backup_interval`, `database_name` FROM `web_database`;
    If backup_interval is stating "weekly", you want to change it to "daily" using either phpmyadmin or
    UPDATE `web_database` SET `backup_interval` = 'daily' WHERE `web_database`.`database_id` = 1;
    pay attention to change the ID in the last example to the matching one of your database
  5. Well-Known Member HowtoForge Supporter

    I am wondering, by chance, did you do the following:
    - enable backup on website weekly
    - add the database
    - change backup to daily afterwards

    or no backup interval, just need to know if _along the lines_ this is what possibly could have happened?

    if no, well my thought is wrong but if yes, there's a potential for a bug not setting the database interval then.
    Depends on what you say.

    If my theory is correct though,
  6. Steffan

    Steffan Member

    if i look into web_database
    Then i see:
    Backup_interval = none
    Backup_copies = 1

    on web_domain
    backup_interval "daily"
    Backup_copies = 5

    but after disabling the backup i see that
    web_database changed to
    Backup_copies = 5

    and after enabling it it stays at 5 so mayby it was a problem on my site and no bug
    Last edited: Apr 23, 2024 likes this.
  7. Well-Known Member HowtoForge Supporter

    I am a little bit puzzled as I could not find a setting to set those individually, so I assume it is a bug somehow. @till
    That is why I wanted to know what / in which order has been done.
    Thank you for your explaination, this might help to find the bug if it is on ISPConfig why this happened and will be fixed soon.

    Would be nice to hear back if it works as expected now, though I think it is save to assume.
    ahrasis likes this.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I have not written this backup function myself, so I don't know in detail when this value is set. If you think that there is a bug, then feel free to add it to the issue tracker with steps on how to reproduce it so I can check it in the code.
    ahrasis likes this.
  9. Well-Known Member HowtoForge Supporter

    Last edited: Apr 23, 2024
    ahrasis likes this.
  10. Well-Known Member HowtoForge Supporter

    To prevent this from happening until a fix is released know the following:
    - when you create or update a database, the backup_interval for the web/domain is beein copied/used
    - when you change the backup_interval for a web/domain the backup_interval is not updated for the database

    If you encounter this issue again until a fix is released, you can set the web backup setting first and update the database afterwards.
    Finally change back your web backup setting.
  11. Well-Known Member HowtoForge Supporter

    Actually, in theory, the backup interval for a database will be updated when the interval for the assigned website changes.

    Is there anything else / steps you could help us to understand how this could happen? @Steffan
  12. Well-Known Member HowtoForge Supporter

    Did you assign the database to a different domain?
    edit: but even then, it should be the same value
  13. Well-Known Member HowtoForge Supporter

    Possible that you or someone in your team used the remote api to update the database manually and changed the interval?
  14. Steffan

    Steffan Member

    No the api is not used.
    This is a controlpanel of a reseller.
    If i look at the datalog history looking on the DB table web_database
    i only see entrys of me as admin not for the reseller.
    The first entry was that i disabled the backup.
    that changed the old 1 to 5... so somewhere it was synced with the web settings
    Field Old New
    backup_copies 1 5

    After enabling the backup again i see the backup interval updated to daly

    Field Old New
    backup_interval none daily

    i cant find any settings that the backup is set. so i could be that it is a old setting?
    So mayby it isnt a bug and just some old value
  15. Well-Known Member HowtoForge Supporter

    Hmm backup_copies might be a good thing to check aswell, I just looked for the interval. Good point.
  16. Well-Known Member HowtoForge Supporter

    My head... forums somehow make me lazy.
    Your setting for the interval was mixed up, this was the cause for you.
    I thought about something different in regards of backup_copies;
    if there is a possibility that backup_copies, as this could be another issue when counting the backups. I doubt it but it could be.
    Also it would be possible to have a different amount of database backup copies around, too. The setting is in the table
    but not accessible individually.
    Not sure if this was done on purpose or done with less thoughts about different user needs or just a design decision-
  17. Steffan

    Steffan Member

    if i look in the database backup_copies has a default value of 1
    so somehow the setting is not changed in the first time the reseller changed the copy settings.

    But i just tested as the reseller with another domain and the setting is changed, so no idee what went wrong but it looks like it is working now.
  18. Well-Known Member HowtoForge Supporter

    Not sure about that but there is a potential for issue if you do use the API.

    You can call sites_database_add and provide a backup_interval and backup_copies setting.
    This will be applied to that Database only.

    If this is called using the WebUI the settings will be copied from the web_domain setting.

    By changing the backup_interval and copied for your web it will update all databases.
    When run_all_backups is called, it reads the setting from the web setting aswell.

    So yeah, really a mess imho.

    Regarding backup_copies and interval you can check / vote for :)
    Will allow you to set the interval on a per database setting when approved.
    This is code I did last night and has not been revisited by officials, it can introduce new bugs or
    I could have missed a dependency, unlikely in this case but I'm no god so I can't be sure :)

    Also just google "linux xz hack" and you know why one should be careful with code contributions.
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    I'll check the MR in the next few days.
  20. Well-Known Member HowtoForge Supporter

    Ha I did not mean to put pressure, sorry if you took it as such.
    But if there would've been input in form of ideas or someone tried and spotted something would be cool not to miss an opportunity.

Share This Page