We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29703
    • 217 Posts
    Hello,

    I am in a bit of a tricky situation at the mo. Basically I had fully developed a working ModX locally on my machine and then it screwed up pretty bad (the machine that is). The harddrive was corrupt, but I have managed to recover all of the ModX data, except for the database entries.

    I know have access to the corrupt harddrive and can access all the files, though I need to know if there’s a way that I can backup the database? I haven’t got access to the manager for the MySql admin or anything. It must be physical data, so surely it’s retrieveable?

    I know this isn’t ModX specific, though the help here are pretty in the know.

    Any help would be great,

    Henry
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      MySQL databases are stored in folders with the name of the database. For example, in my mysql folder (this is a MAMP installation) I have mysql (the metadata database, it contains all of the logins and permissions for your mysql installation), modx_097, modx_0961 and test. In these are the files for the tables and a db.opt file (which contains metadata specific to that database, such as the character set and collation. Each table has a .frm file and a .MYI file.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 6726
        • 7,075 Posts
        I hope you’re able to retrieve the files... this is a good reminder of why you HAVE to be paranoid about backing up your data !

        I know I subscribed to a daily automated backup service of my server this year, just to sleep easier tongue And I backup the latest server backup every week just to make sure. Locally, as a Mac user with Leopard, I enjoy hourly backups of my computer...

        This being said, I can’t count the times when this kind of stuff happened to me and I said "’if only I had..." rolleyes
        What OS are your running ?

        Back on my Windows days I had pretty decent results recuperating lost data with GetDataBack (forget the ugly website, the product is good).

          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 29703
          • 217 Posts
          Quote from: sottwell at Jan 11, 2008, 04:19 AM

          MySQL databases are stored in folders with the name of the database. For example, in my mysql folder (this is a MAMP installation) I have mysql (the metadata database, it contains all of the logins and permissions for your mysql installation), modx_097, modx_0961 and test. In these are the files for the tables and a db.opt file (which contains metadata specific to that database, such as the character set and collation. Each table has a .frm file and a .MYI file.

          Ah, thanks very much. I basically have retrieved all the .frm and .myi files, but the directory structure was completely lost during the harddrive corruption. Is there any way I can work it out again?

          Thanks,
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Just drop these files into an appropriately named folder (named for the databasename you originally used) and drop those folders into wherever your new MySQL installation stores its data. That depends on your installation, so I can’t really suggest where that might be. In a MAMP installation it’s in MAMP/db/mysql.

            Keep in mind that the original mysql database is vital to access the other databases, since that’s where all the usernames, passwords and permissions are stored for all databases, although you can add to it manually if you have to.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 29703
              • 217 Posts
              Quote from: sottwell at Jan 14, 2008, 04:08 AM

              Just drop these files into an appropriately named folder (named for the databasename you originally used) and drop those folders into wherever your new MySQL installation stores its data. That depends on your installation, so I can’t really suggest where that might be. In a MAMP installation it’s in MAMP/db/mysql.

              Keep in mind that the original mysql database is vital to access the other databases, since that’s where all the usernames, passwords and permissions are stored for all databases, although you can add to it manually if you have to.

              Excellent, thanks for the help. I’ll try it out now.

              Okay I’m getting a whole assortment of errors now - I’m rather confused. Does the MySql username and password need to be identical to that of the previous one I used?