0

We have a project in development on a DigitalOcean droplet without having backups enabled since code is in git and I never ever dreamed of loosing database by not doing anything to it.

So after the vacations during Christmas time, my coworker tried to login into the application and he was telling me that he cannot log in, so I did some checks and I see that the database is GONE, only the default ones are present.

I have logs only from last 5 days. I have checked also the /var/lib/mysql and I do not see any data file for the database.

When I try to wildcard search for the database name on the filesystem it does not find anything.

Can anyone tell me what could have happened that it just all vanished and how to try to find any traces of it? I expected at least have a corrupted database file, or something, but not... it's totally gone.

Thank you

Erik Kubica
  • 121
  • 5
  • Thank you for your reply, no there are no deployment scripts, it was a development server dedicated for our upcoming app which is running on Symfony+ReactJS combo. No there was no separate MySQL snapshots (afaik, since I installed it by myself and I am the only one with access to the VPS console with a secure password). No there are only the default databases (MySQL user for the missing DB is still there, only database is gone), however I have seen some login attempts in the last 7 day logs (I don't have older log files). – Erik Kubica Jan 14 '21 at 10:46
  • I am not sure if it was restarted, in the dpkg log I can see some updates from 12th December incl. linux-headers and modules, but it does not contain the word MySQL, so if this update did not trigger the restart of the MySQL service, then no. I have tried to restart the VPS (for some people it solved the issue) but in my case it did not. – Erik Kubica Jan 14 '21 at 10:46
  • The VPS is just some basic mysql+apache+php+certbot instance where I have installed all the required services to run the web app. I have done it countless times and nothing like that ever happened. Only other explanation (other than some VPS fault) for what happened is, if someone somehow was able to execute symfony command to drop the database schema or was able to log in into the database. – Erik Kubica Jan 14 '21 at 10:51
  • You can query mysql uptime using SQL such as `SHOW GLOBAL STATUS LIKE 'uptime';` and the command to show Linux uptime is `uptime` *(it is generally preferably if you [edit] your question to clarify your research effort so far - a well structured question is more readable than often rather conversational comments)* – anx Jan 14 '21 at 10:59
  • 1
    The uptime wont help much, since I have restarted the VPS and MySQL today to see if it fixes the issue (you know that jokes about "did you try it turning it on and off?"). The uptime is 8658 – Erik Kubica Jan 14 '21 at 11:02
  • I have also checked the bash history and everything seems okay with it. – Erik Kubica Jan 14 '21 at 11:03

1 Answers1

2

turns out symfony profiler has phpinfo and the .env file is loaded into it with all sensitive credentials. lesson learned, don't use dev mode on publicly available domain even if indexing is disabled.

Erik Kubica
  • 121
  • 5