NO BUG: Where are the templates stored?

When migrating the site, I lost a complex main page template, which is quite difficult to restore :roll_eyes:

I would like to find it, but I don’t understand how these templates are stored in Bricks.

During the transfer, a copy of all files and a database dump were made, which were then re-uploaded to the server. All the data and settings were saved, but one template for the main page was completely gone.

How can it be restored?

Hi,
Thanks so much for your report!

To answer your question: All template-relevant data is stored in wp_postmeta.

However, it would be much easier if you export the missing template from the original installation and then import it into the new installation. This saves you from any operations on the database, which might lead to more issues.

It is possible that the affected template contains some errors, so it was skipped during the migration. Without specific details, however, I can only guess.

Best regards,
timmse

In the database dump (backup copy before migration), when searching for the template ID, I found such an entry

Will it be possible to restore the template from this data? If I understood correctly, this is a revision.

After the transfer, the test site was deleted from the server. I didn’t expect to encounter such a problem. At first I thought that the template had just detached itself from the page. It was created separately as an individual. But then it turned out that it was just empty.

Now, if you repeat the full restoration of the site, I think that the situation will repeat itself and the template from the dump will not load. So that it can then be transferred via import/export.

I figured it out. Yes, I found the template myself, which is on the screenshot. I inserted it into the desired wp_postmeta field, removed the shielding and everything worked.

2 Likes

I’m glad you were able to solve your problem!

Howdy, I have a similar issue. Somehow a template of mine was deleted. I don’t have a backup with a complete version of the template.

I looked for wp_postmeta in my File manager on Runcloud.io and it’s nowhere to be found. Is there some other folder where the templates are stored by Bricks?

Hi Andrew,
Welcome to the forum!

No, there are no “physical” template files – apart from the the default templates.
As I said, all Bricks data is stored in wp_postmeta. Unfortunately, if the template has been permanently deleted, you will no longer be able to find it there.