Recover DB from data folder?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fernando.giacomino
    Junior Member
    • Jul 2022
    • 23

    Recover DB from data folder?

    I've made a backup of data folders (data/espocrm and data/mysql) from install script (running install script, detected actual install and made backup) but never did mysql dump in single mysql file. Is any way to recover or cleanup this folder containing several database files? I've installed and copied this folder but remains restarting mysql container with an error.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    Do you want the database structure (empty, without database records) or the records you had saved before?

    Comment

    • fernando.giacomino
      Junior Member
      • Jul 2022
      • 23

      #3
      Structure + data, I have'nt previous backup in sql format.

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        If you have your custom folders, you can recover the data structure, but the data is always in the database (MySQL, MariaDB). If you don`t have these backupped, no chance.

        espoCRM works (in rough):

        App -> all files of the espoCRM to work correctly
        client/custom -> files, to be used, when the user made customization
        custom -> all customizations
        data -> here are saved data. For example, all uploaded files (images, docs etc.), called attachments in espoCRM. Furthermore you have two configuration files, also important for espoCRM work correctly.
        The attachment`s filenames are converted in files, that will be referenced to the database, because big data is not saved in the database, only "linked"
        Database -> here you find the structure of the database, in case of customization, the json-files in your custom folder will create the database tables and fields for your customization.

        To backup espoCRM you need at least: custom folders, database and data folder. With these files you may in case of not working installation install a blank espoCRM, exchange these folders, do a rebuild and the app should work again with your customizations.

        To work with espoCRM it always helps to read the Documentation. If you follow the recommendations you will have an easy to maintain app.

        Comment

        • esforim
          Active Community Member
          • Jan 2020
          • 2204

          #5
          What sort of install script is it? How is the data being save at the moment?

          Surely there is a convert way and import way, just need the know-how. Where did you get the script? Perhaps there already many topic on this very same question and you end up more successful at the internet over there than at EspoCRM forum.

          Comment


          • fernando.giacomino
            fernando.giacomino commented
            Editing a comment
            In fact the install script (install.sh) provided by Espo, when you run it having installed EspoCRM, it detects and make first a complete copy of data folders (all from /var/www/espocrm in my case > Ubuntu). Then recreate the aplication without delete data. I've used this method before when messed up upgrading, is useful to upgrade too.
        • fernando.giacomino
          Junior Member
          • Jul 2022
          • 23

          #6
          I've found that data is in mysql\data\espocrm multiple .ibd files and recover it with Stellar Repair for Mysql demo, now just can't save it due to license cost (too expensive for my exchange rate). Still I have no clue about why espocrm-mysql is failing. Found that maybe a corrupt or too big log file (binlog.000XXX > 1gb), when zipping that data the process crash at one of this files.

          Searching now if I can import that data locally and restore or fix inside espocrm-mysql container.​

          Comment

          • esforim
            Active Community Member
            • Jan 2020
            • 2204

            #7
            Didn't know it got a feature to do import upon installation.

            What I meant to ask was how did you do the backup, what script it is?

            Comment


            • fernando.giacomino
              fernando.giacomino commented
              Editing a comment
              In last versions of EspoCRM, (I've installed Espo from script install.sh) in folder Espocrm is "command.sh" script, that comes with many useful functions (backup-retrieve, upgrade, etc). Maybe is just in docker version.
          • fernando.giacomino
            Junior Member
            • Jul 2022
            • 23

            #8
            After many tests we ended up buying the license of Stellar Repair for Mysql, the only one of 6 we found on the market that recovered almost all the data and structure of the database from the raw mysql data folder (without dump). We did a fresh install of EspoCRM and then dumped the database. We imported only the retrieved tables that had data and left the rest. We update the database and then copy the folders with customizations (Client, Custom). A long rebuild and voila!

            Comment

            • esforim
              Active Community Member
              • Jan 2020
              • 2204

              #9
              That good news, pity you were forced to have to go down that route.

              Comment

              • item
                Active Community Member
                • Mar 2017
                • 1476

                #10
                Hi,
                with my experiment, everybody have a "critical data" like espoCrm or anythink other but must do a "remote backup".
                storage is not problematic or "$ cost" now.

                Make a backup is not hard, Yuri have post a script who dump database a files in upload folder. (i think it's on github, search backup)

                What is important, is copy this backup to a remote "storage".
                that can be a remote ftps, and remote storage space.
                one time by week i think can be good, depand of your data and bandwith allowed.

                Really important. it's just my advice.

                Regards

                If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

                Comment

                • fernando.giacomino
                  Junior Member
                  • Jul 2022
                  • 23

                  #11
                  I think "command.sh" script is a great help and could be integrated into the frontend. Missing a function to dump the database (there is a backup function but it keeps the data folders separate). How could show or add that functions in admin cron jobs? That will be great.
                  Last edited by fernando.giacomino; 06-30-2023, 01:37 PM.

                  Comment

                  Working...