Backup Issue with databases and users missing

OS : Debian Linux 11
WB : 2.101
V : 7.7

Hello there,

I had a strange issue while recovering from a crash (full reinstall then full backup restore via CLI) :

Some websites didn’t work anymore, their database were not present in the backup.

Another thing, for all websites (the ones with recovered database and those without) the MariaDB/MySQL user is gone !

My question for you is the following one : what must I do to be sure all databases are included in the backup and all user definition too ?

I would have installed the new os then virtualmin then restored the domains from your backups via the gui rather than the cli. I have done this loads of times and it’s never failed with one exception if your db’s where mysql and you now have maria they are no longer fully compatible and the restore utility will actually fail but the gui will indicate success.

jimr1, thank you for your quick reply, but restoring is not the point (I too, made many restorations by the past using GUI, but using this time CLI restore for fastness and robustness). It went perfectly fine (CLI stating “no errors” and “restore succesfully completed”). The point is the backup behaviour : why some databases are missing and some not ? Is there a setting somewhere to secure that ? And last, why ALL the users settings are gone (need to manually recreate each database user to fix websites display) ?

No one can help ?

As both cli and gui probably use the same code for restoring they will be as robust as each other. If you get a command line option wrong your restore may not be successful. That said the only problem I have ever had with a database restore is when the database to restore is incompatible with the database software installed.
Are you sure that

  1. the backup data files is not corrupt
  2. the database software is the same as when the backup was taken

But you say the domain user is not restored that points to a corrupt backup file

Jimr1,

I see we are running in circle there. Maybe I do not express myself clearly. THERE IS NO CORRUPTION IN THE BACKUP FILE : Both GUI and CLI are saying everything went fine and no errors.

I will write this here again :

The point is the backup behaviour : why some databases are missing and some not ? Is there a setting somewhere to secure that ? And last, why ALL the users settings are gone (need to manually recreate each database user to fix websites display) ? Is there a setting somewhere to secure that too ?

Ok so in your backup file does the following exist ?

replace phporyx.com with the domain your looking at

All this I already have checked and NO, it is not present : that is why I opened this subject.
The main topic is why some are domains are backed up with their databases and some not since “all features / all domains /all virtualmin” are checked. After that, why databases users are all gone ?

We all feel your pain with this as backups are critical as are the inevitable restore of them. I can only speak for myself as I mentioned here in a previous post the backup/restore procedure has been flawless in my environment. https://forum.virtualmin.com/t/outstanding-backup-restore-virtualmin-functionality-feedback/121268.

For the benefit of others and my future self and hopefully you, I will document below my complete settings I have used for years using “Backup and Restore > Scheduled Backups”.

  1. Virtual Servers - Select “All virtual servers”

  1. Features and settings - default “Backup all features”

  1. Destination and format - I use a local directory for quick individual virtual server restores and copy to the cloud for disaster recovery (See 4 below on that part).

  1. Schedule and reporting
  • Add your email for reports
  • I use simple daily/midnight schedule
  • I use rclone “Command to run after backup” to send all backup files to a cloud account

Finally this includes mysql dbs as well as respective users and I confirm regularly that all restores as expected. If you have a similar setup (I use Almalinux 8.5) and experienced the issues you note then that would indicate an issue specific to your installation unfortunately.

I guess you wasted your time with this post the OP seems not have not backed up correctly so therefore the restore has not worked.

Thank you very much for your time and precision. Unfortunately, that is exactly what I do, nevertheless, as I quoted many times, some databases (most of them) got restored and some not. The users are all gone and need to be recreated (frustrating, but easy in the case of WP config file). I think there might be another way to secure all that, before the backup maybe. I wonder if the way I create database is the right way : I go to Webmin and create one from scratch in Servers/MariaDB… Maybe should I create the database within the virtualhost (Virtulhost/Edit database) so that gets associated with it and then being taken in account by the backup. The question of the users remains without explanation to me.

Jimr, time is never wasted when you help someone.

normally I would get virtualmin to create the database on creation of the domain, see below … at least you know everything is correct (user name and permissions wise) and connected to the correct name. I never took into account that there may be an orphan database in the mix … this would explain why the database was not backed up.

in regards to orphan databases if that ends up being the root issue, somewhere I remember seeing a button — associate an existing DB with this virtual server

so – a DB created outside of Virtualmin can be ‘added’ (aka associated) to a specific Virtualmin virtual server so its ‘part of the family’ :slight_smile:

I am not sure at all about userids in that orphan DB – if they get discovered by Virtualmin as part of the association process or not.

Of course when a VH is created, I always leave this option ticked. It’s when another database is needed.
Well, thanks anyway. Remains the users issue.

That is precisely what I thought might be a solution. I’ll have to experiment another crash and backup issue to confirm that (or I can see what’s inside the tgz, like Jlmr1 noted four days ago). Remains the users issue.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.