Jump to content

templates tables deleted recovery possible?


Mackski
 Share

Recommended Posts

Do you still have the fieldgroups table?

So long as you don't have any unusual settings where a template is using an alternate fieldgroup, you can probably build this back up again with relative ease.

I would start with a templates table from another install and delete all the templates which aren't relevant to the problem site. Then use the fieldgroups table to get the names of the templates and the fieldgroups_id value for that column in the templates table. Once you have rebuilt all the rows in the templates table, I would manually add back the template access / family settings etc.

Hope that makes sense and helps.

Good luck!

Link to comment
Share on other sites

29 minutes ago, Mackski said:

Anyone looking for some extra work

I can help out if you want, but I would have a go at it yourself first. The part that I could do really shouldn't take that long via PHPMyAdmin or some other MySQL GUI. The time consuming bit will be the template access/family settings which I wouldn't know how you would want configured anyway.

Link to comment
Share on other sites

39 minutes ago, adrian said:

Do you still have the fieldgroups table?

So long as you don't have any unusual settings where a template is using an alternate fieldgroup, you can probably build this back up again with relative ease.

I would start with a templates table from another install and delete all the templates which aren't relevant to the problem site. Then use the fieldgroups table to get the names of the templates and the fieldgroups_id value for that column in the templates table. Once you have rebuilt all the rows in the templates table, I would manually add back the template access / family settings etc.

Hope that makes sense and helps.

Good luck!

Ok, so the fieldgroups_id in templates corresponds to the id in fieldgroups? I can see some templates have a flag column, set to 8 for repeaters.

Link to comment
Share on other sites

28 minutes ago, Mackski said:

Ok, so the fieldgroups_id in templates corresponds to the id in fieldgroups? I can see some templates have a flag column, set to 8 for repeaters.

Yes - that's right in both cases!

Let us know how you it goes.

Link to comment
Share on other sites

Just now, Mackski said:

How would I then ensure the pages are still linked to the correct template?

Ah yes, the next step in the puzzle. This is where you'll need to match the id of each row in the templates table to the appropriate "templates_id" field in the Pages table. No magic here, just careful manual matching. I wouldn't touch the Pages table at all though - be sure to change the id in the templates table.

Link to comment
Share on other sites

For the most part I've restored my templates, except repeaters seem to be broken. Not showing fields.

Also the system seems to be re-adding repeaters in the templates table;

eg:
repeater_draw_nomination_repeater1

If I delete this entry, the next page refresh will add:
repeater_draw_nomination_repeater2

Link to comment
Share on other sites

Did you check the template id of the repeater template against the template_id specified in the data column in the "fields" table for the repeater field? 

And of course remember that repeater templates are named: repeater_repeaterfieldname

  • Like 1
Link to comment
Share on other sites

32 minutes ago, adrian said:

Did you check the template id of the repeater template against the template_id specified in the data column in the "fields" table for the repeater field? 

And of course remember that repeater templates are named: repeater_repeaterfieldname

That did the trick, the ID's were different in the serialized data. I changed them and they now work.  Now to just restoring template settings and permissions.

Thanks for you help Adrian!

  • Like 1
Link to comment
Share on other sites

9 minutes ago, Mackski said:

I still get an error/warning, which doesnt seem to effect anything so far:

You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=]

Any chance there is a page that is assigned to a template_id that doesn't exist?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...