• Resolved eigil-skovgaard

    (@eigil-skovgaard)


    Hi Tobias,

    I have a general backup text-file with the SQL INSERT format for all the wp-tables – but I only want to insert the about 127 TablePress tables into the db (via C_panel SQL).

    1. As far as I have learned from earlier support q and a in this topic, TablePress tables and it’s data are exclusively! stored in wp_posts. Is this right?

    I have cut and pasted all ‘tablepress_table’ records from backup-wp_posts into a new INSERT INTO wp_posts SQL-instruction.

    2. If I choose to restore the tables one by one, will the order be critical? (i.e. dependencies to other tables in WordPress?).

    3. Will this be sufficient to show the tables and old settings in TablePress?

    4. I also want to restore the Custom CSS from Plugin Options. I think I recognized a bit of the content somewhere in the backup. Which wp_table would it be?

    Best regards,
    Eigil

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Correct, the data for the TablePress tables is stored in the wp_posts database table.
    In addition, however, the options and visibility settings are stored in the wp_postmeta table.
    And finally, the global plugin options, including the mapping from table ID to WP Post ID is stored in two entries in the wp_options table.

    So, you would then have to extract this information from all three database tables.
    The order should not be critical. It’s more important that the post or postmeta entry IDs in the database are not yet taken. Otherwise, the INSERTs might fail or get different internal IDs.

    So, while this should definitely work (it’s just tedious), the quicker approach might to set up a new/emtpy test site (this could even be on your local computer) and restore the full database backup into that. Then, also install TablePress on that test site and export all tables to the JSON format (in a single ZIP file). That can then be imported on the actual site without ever having to deal with the database directly. And you could just copy the “Custom CSS” from the “Plugin Options” screen.

    Regards,
    Tobias

    Thread Starter eigil-skovgaard

    (@eigil-skovgaard)

    Hi Tobias,
    Very good – thank you.
    Best regards,
    Eigil

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    Thread Starter eigil-skovgaard

    (@eigil-skovgaard)

    Hi Tobias,
    Please open this file:
    https://www.dropbox.com/s/ysk39vlvuensfjo/forklaring%20til%20udtr%C3%A6k%20af%20tabeller.txt?dl=0

    It’s an example of corresponding tablepress-records in the WordPress database.

    My problem is that this TablePress-table does not show up in TablePress-> All Tables.

    Not yet, anyway ;O)

    Best regards,
    Eigil

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, the entry in WP_POSTS with the ID 1185 is your table. The two entries in WP_POSTMETA are the options and visibility settings.

    The two entries from WP_OPTIONS that start with _transient_... are irrelevant. These are cached versions of the table (and the timestamp of expiry). You do not have to restore these and can delete them.

    What seems to be missing are the tablepress_options and tablepress_tables entries from the WP_OPTIONS table. Can you please look for those again? The tablepress_tables entries is the important one here. It contains the relationship between your table ID (3) and the post ID (1185). It’s a JSON encoded array, looking like
    {"last_id":3,"table_post":{"3":1185}}

    Regards,
    Tobias

    Thread Starter eigil-skovgaard

    (@eigil-skovgaard)

    Hi Tobias,

    This went ok:
    The tablepress_tables record revived the id=3 table in the All Tables interface. Everything about the table(s) seem to be working fine now.

    This created a mystery:
    The tablepress_plugin_options is a very long record with a lot of formatting instructions. When I inserted it in wp_options, the process finished ok.

    But, only the header is visible in the field option_value in wp_options, with this look:

    {“plugin_options_db_version”:34,”table_scheme_db_version”:3,”prev_tablepress_version”:”1.8″,”tablepress_version”:”1.8″,”first_activation”:0,”message_plugin_update”:true,”message_donation_nag”:true,”use_custom_css”:true,”use_custom_css_file”:true,”custom_css”:””,”custom_css_minified”:””,”custom_css_version”:0}

    (Tobias and the donation panel became visible, and I’ll bear in mind the good idea ;O)

    Only – all formatting data stayed out of sight, fx:
    /* Tabel 3, Miniatombomber, tryk.*\\/\\n.tablepress-id-3 .column-1 {\\n\\twidth: 20%;\\n}\\n\\n.tablepress-id-3 .column-2 {\\n\\twidth: 80%;\\n}\\n\\n\\

    – where could it be? and the Plugin Options interface is still blank.

    Best Regards,
    Eigil

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    this looks like the default value for the “tablepress_options” field. At the moment, there’s no “Custom CSS” in it (note the "custom_css":"").

    You could now simply copy/paste your “Custom CSS” into the field on the “Plugin Options” screen.

    Regards,
    Tobias

    Thread Starter eigil-skovgaard

    (@eigil-skovgaard)

    Hi Tobias,

    Yes, I could paste a copy of a slighter older version of instructions into Plugin Options, but I was not sure, if this would interfere negatively with the inserted part.

    Also – I am a bit curious about how to actually restore the (slightly newer) backed up data, which are formatted for insertion and would demand some fiddling to be converted manually (provided the written version did not exist).

    I suppose the backed up data reflects the actual settings from the header at the backup time, so why is the data part not restored too?

    This is the actual backed up tablepress_plugin_options file:
    https://www.dropbox.com/s/qwl25wl2thz7caj/988%20tablepress-plugin-options%20backup.txt?dl=0

    Best regards,
    Eigil

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    After seeing this, it actually looks like the tablepress_options entry was never imported back into the database. I don’t know why though.
    I can only suggest that you try that again. You could maybe change the first part to (988,'tablepress_plugin_options2', to get it back into the database as a second entry. Then, copy/paste the option_value content into the one for the actual tablepress_options entry.

    Regards,
    Tobias

    Thread Starter eigil-skovgaard

    (@eigil-skovgaard)

    Hi Tobias,

    This time the insertion was total – and all table attributes are shown in the Plugin Options panel.

    Thank you for your patience.

    I have ordered a “cup of coffee” for you ;O)

    Best regards,
    Eigil

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great! Good to hear that it worked now! ??

    And thanks for the donation, I really appreciate that!

    Best wishes,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Restore tablepress from general backup’ is closed to new replies.