XF 2.2 Help restore the forum

Dkf

Active member
Due to a hard drive failure, the files of the file system have been lost, but the database is still intact.
How can I restore the forum step by step?
Please provide instructions.

Thank you.
 
If your files are lost... you are going to have issues (a prime reason to do a full file and DB backup regularly).
Your files (unless you are using R2 or similar) also consist of any images, avatars, logos, attachments, etc. that have been uploaded and add-ons that were installed.
You can upload the XF files again, then manually install all the add-ons (by extracting and placing them in the appropriate directory) and then importing your DB again... but as for getting back to where you were, without a backup of all the files... you are pretty much toasted. You will have missing images in posts if they were attached, no users will have their avatars and such.
 
If your files are lost... you are going to have issues (a prime reason to do a full file and DB backup regularly).
Your files (unless you are using R2 or similar) also consist of any images, avatars, logos, attachments, etc. that have been uploaded and add-ons that were installed.
You can upload the XF files again, then manually install all the add-ons (by extracting and placing them in the appropriate directory) and then importing your DB again... but as for getting back to where you were, without a backup of all the files... you are pretty much toasted. You will have missing images in posts if they were attached, no users will have their avatars and such.
I understand...

I have a file system backup from a year ago before migrating from vBulletin. + XF mysql.
How can I partially restore attachments and avatars?
What changes occur with avatars and attachments in the process? Can I replicate them manually?

How do I disable all installed plugins? Is it done through the configuration file or via MySQL?
 
How can I partially restore attachments and avatars?
Not cleanly (nor easily) as you had to get those in via an import and XF does it's "magic" on the vB stuff as it imports (renames them to XF structure, creates the necessary linked data, etc).
You may be able to engage someone like @Slavik or @MySiteGuy to do a "custom" import... but even that will be somewhat problematic I'm sure.
To do it cleanly (even with older data) you would need the file structure to be in XenForo installation.
I'm not even sure if doing a "clean" import from your old vB installation and then doing an "import" from your current backup would work (it will probably cause multiple issues with duplicate users, etc).
Now, if you mean you have a backup AFTER the vB migration, copying your /data and your internal_data (this may not be needed) should get your old image attachments back but you will still be missing many (a years worth).

How do I disable all installed plugins? Is it done through the configuration file or via MySQL?
via the config file should suffice.

$config['enableListeners'] = false;
 
  • Like
Reactions: Dkf
Or should I do the following?
Start the forum from a year ago, perform the migration to XF.
Then, provide it with the fresh database?
 
If you don't mind losing the last years worth of data, you can do a fresh migration... You will be exactly where you were at when you moved from vB.
You will most likely NOT be able to do anything easily with the orphaned XF database you have currently due to duplicate content.
To be able to do so, you are most likely going to have to basically write a customized importer.
 
I understand...

I have a file system backup from a year ago before migrating from vBulletin. + XF mysql.
How can I partially restore attachments and avatars?
What changes occur with avatars and attachments in the process? Can I replicate them manually?

How do I disable all installed plugins? Is it done through the configuration file or via MySQL?
You can disable through MySQL, I’ve done it with some bad or buggy addons that caused errors on the admin CP.

My opinion is this isn’t so bad. You can replace the files with the latest download, grab a list of the active plugins and put those files back. You’ll have to deal with missing avatars and attachments after, but I think majority of the forum will be functional.

For sure get someone like @MySiteGuy to help or at least get his opinion, if he can’t fix it, he’ll tell you.
 
You’ll have to deal with missing avatars and attachments after, but I think majority of the forum will be functional.
It will be functional... just a LOT of work to try to replace images... and a lot of "dead" attachments that will have to be cleaned up.
Just a remind of the importance of full backups (files and databases) that should be done regularly AND stored off the hosting system.
 
I plan it this way:

I'm setting up a clean forum with a 2023 database.

On another server, I'm initiating the conversion from VB 2022 to "XF 2022".

And copy attachments and avatars from "XF 2022" to "XF 2023"
 
I plan it this way:

I'm setting up a clean forum with a 2023 database.

On another server, I'm initiating the conversion from VB 2022 to "XF 2022".

And copy attachments and avatars from "XF 2022" to XF 2023

As long as you retained content IDs originally and can do so this time, this should be fine. I would also suggest copying the database tables for your attachment tables over also, as your existing database will have references to everything added as attachments in the last year which no longer exist.

The more important question is how was the data lost from a drive failure, did your host not have backups?
 
If it were me, I'd:

1. Copy the old Xenforo to a temporary location on the host.
2. Install the newest Xenforo database you have.
3. With a freshly installed empty Xenforo, import the database from step 2, using the attachment/avatar file locations from step 1. Retain content ids when importing.
4. You'll end up with a working Xenforo that has the same URLs as before, with attachments and avatars except for those from the past year.

If the old drive is still available, I've rescued data from Linux file systems before. This includes one case where a hacker had deleted all the database files. Most were recoverable, and thankfully those lost were small tables not required to rebuild a new Xenforo installation.
 
If it were me, I'd:

1. Copy the old Xenforo to a temporary location on the host.
2. Install the newest Xenforo database you have.
3. With a freshly installed empty Xenforo, import the database from step 2, using the attachment/avatar file locations from step 1. Retain content ids when importing.
4. You'll end up with a working Xenforo that has the same URLs as before, with attachments and avatars except for those from the past year.

If the old drive is still available, I've rescued data from Linux file systems before. This includes one case where a hacker had deleted all the database files. Most were recoverable, and thankfully those lost were small tables not required to rebuild a new Xenforo installation.
I want to install the same set of plugins on an empty forum that I had before. This way, after connecting the new database, the plugin files will already be in the system. How can I see in the MySQL database which plugins and their versions were installed before the crash?
Thank You
 
The more important question is how was the data lost from a drive failure, did your host not have backups?
The forum was running on a virtual server image. Due to an unexpected server reboot, possibly caused by a power outage, a failure occurred. There was no way to recover the image (and its copy) using any means.

Then comes the classic part - I thought there was a backup. But it turned out there wasn't. All files were being copied to another server every day. However, after we switched to XF a year ago, we changed the forum's working directory. And the backup was only set up for the old directory.
 
Due to an unexpected server reboot, possibly caused by a power outage, a failure occurred. There was no way to recover the image (and its copy) using any means.
If your host was a "responsible" host.. they should have been regularly imaging their VM's and when they had a hardware failure, they should have restored from that.... sounds more like an "oh ****, we lost the drives, time to burn the VM setup back out and then have all our users start over from scratch".
Even when I was running ProxMox on my own dedicated server, I was smart enough to back up the VM's for the eventual "oh crap" scenario.... and that was 1/2 a decade ago.
 
If your host was a "responsible" host.. they should have been regularly imaging their VM's and when they had a hardware failure, they should have restored from that.... sounds more like an "oh ****, we lost the drives, time to burn the VM setup back out and then have all our users start over from scratch".
Even when I was running ProxMox on my own dedicated server, I was smart enough to back up the VM's for the eventual "oh crap" scenario.... and that was 1/2 a decade ago.
I am buying a server on Hetzner without administration, and I am responsible for the administration myself.

The backup scheme was taken from here "Backup VM without downtime"
https://b14esh.com/virtualization/kvm/backup-vm-qemu-kvm-libvirt.html.

However, it turned out to have significant shortcomings :(

The files were corrupted. After converting from qcow2 to raw, it was possible to partially access the file system. However, only a very small portion of the files could be retrieved...
 
I am buying a server on Hetzner without administration, and I am responsible for the administration myself.

The backup scheme was taken from here "Backup VM without downtime"
https://b14esh.com/virtualization/kvm/backup-vm-qemu-kvm-libvirt.html.

However, it turned out to have significant shortcomings :(

The files were corrupted. After converting from qcow2 to raw, it was possible to partially access the file system. However, only a very small portion of the files could be retrieved...
I run on Hetzner currently on a 4vCPU/8GB/160GB shared instance.
I have ZERO issues with my backup process. I have a script that runs daily via CRON that dumps the DB and backs it all up... then I have another process on my local Mac desktop that uses Transmit to pull the files in from the server. I then also have a process that uses rsynch to synchronize to another server I have access to via the internet.

I use the same script for several different sites.. it dumps the DB into the local vhost location, then backs up those physical files... then transmits them.. then deletes the server based SQL dump (but not the server based backup). I keep 14 days of backups avaialble.
 
I run on Hetzner currently on a 4vCPU/8GB/160GB shared instance.
I have ZERO issues with my backup process. I have a script that runs daily via CRON that dumps the DB and backs it all up... then I have another process on my local Mac desktop that uses Transmit to pull the files in from the server. I then also have a process that uses rsynch to synchronize to another server I have access to via the internet.

I use the same script for several different sites.. it dumps the DB into the local vhost location, then backs up those physical files... then transmits them.. then deletes the server based SQL dump (but not the server based backup). I keep 14 days of backups avaialble.
In addition to what I described above, I do everything exactly the same as you. Thanks to this, I still have the file system for 2022 and a new database left. I forgot to specify the new address of the forum in rsync :(

If I were only making copies of the qcow2, I would have nothing left.

An open file structure with a database is sometimes better than a single corrupt file with a size of 4 TB.
 
I forgot to specify the new address of the forum in rsync
That's why I use two different destination locations and method of deliverability... and update them on any server move immediately.
Ultimately... and I don't mean to offend you... this was a result of a defective and not tested/maintained backup process by those in "charge"... it's one of those little things that tends to slip the minds of admins frequently.
If I had to move (for whatever reason) my site to another server or install instance.. ALL I'd miss is the last 24 hours of data... and yes, I check the backup process regularly. Is it a PITA to do... yep, but it's just one more responsibility you should adhere to.
 
Last edited:
Back
Top Bottom