Damaged Linux VM while reinstalling host OS. Can data be extracted from files in a directory?

I was using self-hosted v4 on a virtual machine for a while. I have a few months worth of data stored in that installation. I recently needed to re-install the operating system on my host machine. So at that point, I copied all the VM files to a temporary storage location, re-installed the OS on my computer, then copied the VM files back to the newly-installed OS. I tried to boot the VM using the new installation, but quickly encountered an error that meant the VM first needed to have been properly shut down before I copied files away from the old OS, in order for them to become bootable on a new host OS. I mistakenly backed up the VM while it was running.

I still have the virtual machine file and can properly access all file system directories by mounting the QCOW2 file in my new operating system. I just can’t boot the actual machine because it was copied over in a running state. There is no way the VM will be able to boot as it requires the unique ID of that particular old OS installation.

Ever since then, I have been using a separate v4 installation as backup. In the end, I would like all data in CSV.

Main question: However, I’m wondering if it’s possible to extract the data I created in the old v4 installation so it can be exported to CSV? If this is possible, I would be searching through the folders on the Linux installation for the raw data, like /etc, /var, /lib, /bin, /home, and so on. I just need to know where the data would most likely be located. Again, booting the old VM is not an option, so the actual functional installations of SQL or PHP are not readily available. I only have access to the storage files. I do (or at least should) remember the passwords for everything like SQL and PHP.

I am most interested in the following data: Clients, Products, Invoices, Payments, Projects, Tasks (including Time Tracker data), Expenses and Vendors. Projects and Tasks/Time Tracker are the absolute most important.

You would need to at a minimum restore the database and then setup a new machine and reimport the database. it would also be handy to restore the .env file.

once restored, it should just work

Thanks for the reply!

Previously, I had only tried directly launching the VM file as it had been configured on the old operating system. That’s where the specific ID was needed and it wasn’t able to boot. However, after reading your post, I searched on Google for where the database files would be stored. In the middle of that search I found an article that suggested creating a new VM and using an existing virtual disk when choosing storage. Once I chose the existing QCOW2 image and created the new VM, everything booted up without issues.

I appreciate your time!