PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Corrupt Form Metadata

  1. Julio Lopez
    Member

    Hello,

    I'm the web developer at the Art Gallery of Ontario and we are a Gravity Forms customer. This week I discovered that some of our forms are not showing up on their respective pages and showing only the "Oops! We could not locate your form" error. In the wordpress admin they are listed, but upon editing them they look like a brand new form.

    After reading around on the forums I've come to the conclusion that the form metadata could be corrupted. I recently had to re-install wordpress 3.0.5 after a catastrophic upgrade to 3.1 resulted in many, many broken links. Anyway, I used phpMyAdmin to rebuild the database from a backup and guess that may have caused a problem.

    Is there anyway to recover my forms and their associated data that has been submitted? I thought I read somewhere that a tool is available, where can we get it?

    you can find an error page here: http://artmatters.ca/wp/birthday-party-information-form/

    The error is showing up before the footer.

    thanks in advance!!

    Posted 13 years ago on Wednesday March 9, 2011 | Permalink
  2. I have added the Meta Recovery Add-On to the Downloads page. You can download, install and activate this Add-On. It will create a new navigation item under Forms called Meta Recovery, use that tool to select your forms individually and repair the meta data.

    Downloads page is here:

    http://www.gravityhelp.com/downloads/

    This issue happens when PHPMyAdmin doesn't properly handle serialized data.

    Posted 13 years ago on Wednesday March 9, 2011 | Permalink
  3. Julio Lopez
    Member

    Hi Carl,

    Thanks for the link. I have downloaded, installed and run the tool and was only able to recover one of my forms. Do you have any other suggestions? What is most important to me now is to recover the submitted data rather than the forms, they can always be rebuilt. Is there any way to pull out human readable records from the GF tables in the WP database without the form metadata?

    Posted 13 years ago on Thursday March 10, 2011 | Permalink
  4. The entries are directly tied to the form settings so. Try using the Import/Export tool to export the entries to CSV and see if that can work.

    You could pull out the entries from the database if you have to but you would have to write the queries to do so and parse the serialized data so it is human readable.

    Unfortunately it sounds like PHPMyAdmin did a number on your form data. Typically the meta recovery tool will work, but we have no control over what PHPMyAdmin does to the serialized data during the export/import process it uses and it doesn't handle serialized data properly.

    Posted 13 years ago on Thursday March 10, 2011 | Permalink
  5. Julio Lopez
    Member

    Ouch!! Really? Ok well I guess I'm going to have to start writing some kind of PHP scripts to read and parse through the data since the GF export util does not work for my corrupted forms. (sigh)

    If I come up with anything useful I'll be happy to share it on the forums as it may help others.

    Thanks for your help Carl!

    Posted 13 years ago on Thursday March 10, 2011 | Permalink
  6. Julio Lopez
    Member

    PS. What tables hold the entries data?
    PPS. In case I have to restore my database from a backup again, what is the best way to back up and restore in order to preserve data integrity?

    Posted 13 years ago on Thursday March 10, 2011 | Permalink
  7. I would recommend using a solution like BackupBuddy or something similar to backup/restore/migrate.

    Entries are stored in the following tables:

    wp_rg_lead
    wp_rg_lead_detail
    wp_rg_lead_detail_long

    The wp_ portion is based on whatever your database table prefix setting in WordPress is set to.

    Posted 13 years ago on Thursday March 10, 2011 | Permalink
  8. Julio Lopez
    Member

    Hi Carl,

    So I figured out that there were some special characters in my form meta that were preventing the meta recovery tool from doing it's job. I had to go in and change characters like é to é and I was then able to fix the problem by running the meta recovery tool.

    Of course, this was after I'd written some scripts to pull entry data without using the form meta data. Oh well.

    Perhaps this code may lead to the development of a new tool plugin for instances where special characters are not the cause of irreparable bad form meta data.

    I created index.php (http://www.pastie.org/1675182) to read the list of forms from the WP DB and to create a form with a select element that allows you to choose what form you want to collect data from.

    I then created recovery.php (http://www.pastie.org/1675204) which is the value of the action attribute of the form on index.php which does the grunt work of getting the data and spitting it out as a csv file.

    My apologies for the messy, uncommented code. I was working quickly.

    Thanks again for all your help.

    Posted 13 years ago on Tuesday March 15, 2011 | Permalink