Recovering Lost Groundhogg Funnel Steps, including Forms

So, Groundhogg has some bad habits and some punishing ones

One bad habit is that forms only exist in funnels, as steps. That makes them really easy to delete, especially if you copy a funnel, and are not really careful whether you are in funnel 1 or funnel 2…

The punishing part is that Groundhogg will occasionally AutoSave your work. If you happen to get “AutoSaved” when you have deleted things you didn’t mean to delete…you can’t simply back out and reload the funnel.

This recently happened to me…after I calmed down, I :

Went so Server Rewind in my cPanel, and rehydrated an SQL dump of the database from yesterday. Open your database dump in an editor, and keep it handy…

The relevant tables here are the appropriately named gh_funnels (the parent), gh_steps, gh_stepmeta. Funnelid is the first related key, and the stepid the second.

In PHPMyAdmin or something similar, copy the two child tables, appending something like _220606 to the first copy and copy structure only (which will be yestarday’s state) and _backup_220607, which is a backup of the kinda broken mess from today, copying structure AND data, but a nice safety net. Repeat for the other child table.

Jump back to your editor and look for the Insert Into {Child Tablename} statements. In my case, there was one giant insert statement per table.

Copy the insert block of SQL and modify the tablename to the _220607 (today) tablename and run the SQL in PHPMyAdmin, MySQL Workbench, etc. Now you have a yesterday table, before things went terribly wrong. Repeat for the other child table.

At the funnels table, find your funnel…mine had an ID of 2. You will recognize the name.

In the steps table, the first step had an id of 4…1 and 3 were present in the yesterday file, but I had somehow managed to delete them from my live website.

So, in PHPMyAdmin select the missing Steps in the yesterday steps table (steps_220606) by checkmarking them in the first column…at the bottom of the page, With Selected, Copy, at the bottom of that page, in the first dropdown, Show Insert Query, then Preview SQL. Copy the code.

Click the SQL tab. You should be able to run this query directly, after taking off the _220606 from the tablename in the insert statement, against your live tables of the same name. Remember that you have a backup that we just made, in addition to any Server Rewind or other system backups that will let you roll back to yesterday at least, worst case.

Now the stepmeta is a little messier…because I didn’t fill in the StepID during import, these records got AutoIncrement key (ID) values of 196 and 197….not to worry.

The Form_fill step, step 1, the first step in funnel 2 (clear as mud?) in my live steps_meta table was mostly generic…it picked up a minimal first, last, email form body…so I just found the form body in the yesterday table, stepmeta_220606, clicked Edit, and copied the full form into the live stepmeta table as the form for step_id 196.

You should be able to use the Groundhogg UI from this point to reorder anything that got out of order.

In my case, I got my 20 field form back in less time than it would have taken to recreate it, and learned some tricks in the process…

Hope you never make this mistake, but that this article helps you if you do.

Contact Us if you’ve got an interesting business tech problem…solving interesting business tech problems is what we do.

Similar Posts