• Support
  • IT Flow Database Restoration Video

Hey all, thank you for providing a really good platform for us to utilize. Is there any chance that @wrongecho could put out a video showing newbies like me how to restore from a backup? I ask because I started using ITFLOW awhile ago, then somehow it got corrupted and could not figure out how to properly restore it back to working. Days were spent trying various methods and following forum posts which went over my head.

P.S. The installation video on YouTube is very helpful. keep up the good work.

Hey @pr0tex

Thanks for your feedback on the install video.

As it stands, the best way to restore ITFlow is to backup/restore the entire VM. I/We might make a guide on how to do this manually using a database dump and phpMyAdmin sometime in the future, but my preference would be to encourage the full VM backup method - it's easier & faster.

I am sorry to hear you lost data. It's worth mentioning again I did email you on your Gmail address to look at helping you with the database, but I never heard back.

Thank you. I am backing up my VM hourly since our last conversation. My bad for not posting a thank you reply. Just wanted to see if there was a video premier on the topic.

Working on something. Need to figure out the restore aspect, as the backup, works fine. Still much to do. But this is just for the sql backup. As previously mentioned by @wrongecho best to to VM backup.

pr0tex helpfully soon, the basic of it is there, just needs more tests and some adjustments and will be ready to go

How is it going to deal with different DB versions?
for example: backup created when DB was 0.9.8 but at restore it's already 0.9.9 or higher

Is it going to work seamlessly?

Thanks @aftechro You're doing a fantastic job!

hey @Bigbug, that`s where the tests and adjustments is needed haha.

For some reason, the code works well with mysql servers, not that great with MariaDB

    aftechro

    I was constantly spamming here for a while about issues I've had running updates on my ITFlow instance. I've finally decided to try and take care of the root cause by setting up a new ITFlow VM and importing my DB. That has proven to be more difficult than originally expected, so if you need help with testing the restoration of an older version to a newer version, I'm happy to guinea pig for you.

      @afiadam - Can I just be a party popper here and caution that this isn't prod ready as yet. Any testing should be conducted in a dedicated test environment 🙂

        @aftechro

        Hope you had a good Christmas. Great work so far! If we can get this working I think we'd integrate it with the updater so backups are taken automatically before and after updates.

        For database versions, Johnny and I were discussing the idea of allowing users to manually change them. This would tie in nicely here as you could "lock" backup/restores to specific DB versions on which they were taken to allow for easy restoring.

        How are you planning to handle the git versions?

        Honestly great work, I can't wait to see the finished product. This would be very handy for those quick restores after bad update, rather than having to restore the VM (whilst this is the gold standard, it's time consuming!).

        @wrongecho quite a year i had, but i`m trying to get back on the track.

        The way i thought on the backup aspect, is to be a plugin, that can work in 2 ways

        1. at the very first setup, in the browser itflow.org/setup.php after confirming database connection, have 2 options: Fresh/New installation or restore backup from file, which both options should pass the db connection check.

        2. Which works now: after the new installation, have a backup and restore plugin, that can do the backups and restore on the go, or restore from the file, by uploading the file which will be stored under the backups folders, then it will be shown in the backups list, so in the end it can be restored from there. - on this, i need to to the restore from file working

        I have the idea in mind, but as you know, i`m not as great as you or the other guys when comes to implement it or in doing the logic behind the scenarios. I've learned how to use chatgpt to generate some codes, and integrate them into what is needed.

        I'm still relying on you guys to take the idea and make it much better and make the best of it so in the end would met all the itflow coding procedure.

        wrongecho and @afiadam Yep, that`s right, this is just for testing and not live/production environment, so make sure you have a the right backups before playing and testing it.

        wrongecho Oh yeah, I still have the main VM with the primary DB still live and running. Just made a backup DB and a new VM to see if I can get something running that has both our data and allows updates.

        afiadam this works now with MariaDB, bot backup and restore, as well the restore from file.

        for my own test, i`m running a webserver with nginx and mysql, and i just do separate hosting for each instance. production.domain test1.domain test2.domain…. each ones with its own db and config files.

        but because i dont use mariadb, i`m just using the itflow pr-preview to test it, and just change the code in the file.

        so changes to file: aftechro/itflow/tree/patch-15

        testing in: https://patch15863.pr-review.itflow.org/settings_backup.php

        updated video: https://www.veed.io/view/b937611c-a7c1-434c-b8e8-b87c55dfbb3a?panel=share

        Hello @aftechro, welcome back, and great job on the Backup/Restore feature. The UI you've developed is impressive.

        Nevertheless, as @wrongecho pointed out, there are additional aspects to consider in the backup/restore process. A specific issue arises when backing up the database and then deleting an entity such as a contact, user, or any item with associated files. If a restore is performed, the previously deleted user's folder remains in /uploads/users/ID/Files. This could lead to complications, such as a new user being assigned the ID of a deleted user.

        A potential solution could be to include the entire ITFlow directory in the backup, along with the database schema. The backup could be in the form of a compressed tar file, named something like 2024-01-04-13-10-10-ITFlow-Backup.tar.gz.

        Ideally, this backup process should be automated through a daily Cron job using a PHP script. Relying on the UI for backups could lead to prolonged loading times or timeouts, depending on the size of the files and database. This feature could be an optional setting.

        Furthermore, it might be beneficial to dedicate a separate SQL table for backups, which would track details like database version, GIT commit hash, and include hash verification of the tar.gz file for consistency checks during restoration.

        This project is quite expansive, encompassing more variables than just those discussed by @wrongecho and myself.

        We'll likely need to consider this for version 2.0, as we are currently focused on resolving existing bugs.

        The concept and direction are promising, and we've already received positive user feedback. However, for the time being, we still recommend backing up the entire Virtual Machine now.