Support » Plugin: WP Data Access » Changing the Database (Schema)

  • Resolved jimhunterabdn

    (@jimhunterabdn)


    Hi Peter

    Is there a simple way to change the Database (I think you refer to it as the Schema) – assuming that my site only uses one database?

    Use case: I maintain two versions of my site – development and live. I need them to use different databases (for obvious reasons). However I want it to be simple to copy my development site to the live site. Using something like Duplicator I can do this easily for the site in general. However WP Data Access seems to refer to the Schema explicitly in a number of tables: wpda_media, wpda_menus, wpda_project_page, wpda_project_table, wpda_publisher, wpda_table_design, wpda_table_settings.

    It is possible to edit these tables by hand (and I’ve done it!) but clearly a more systematic approach would be desirable as I don’t want to make mistakes when updating the live site.

    I think I’ve read the documentation with care, but perhaps I’m missing something?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jim,

    Good to hear from you again! 🙂

    There are twom ways to do this:
    (1) Export and import your plugin tables from the Data Explorer
    (2) Export and import specific projects or publication from the tool menu (Data Publisher for example)

    The plugin will store a place holder for the default schema name on export and replaces it on import. For external tools these values are “not visible” and therefor not replaced.

    Does this helps?

    Best regards,
    Peter

    Thread Starter jimhunterabdn

    (@jimhunterabdn)

    Hi Peter

    Many thanks for the prompt reply (and for your continuing support for the plugin!)

    I’ve experimented with your two methods and both seem to work for me. Two comments

    Export/import with Data Explorer. This seems to be the best solution as one can import and export all tables at the same time – cuts down effort and avoids mistakes. Just delete all existing tables before import.

    Export/import from the tool menu. Also OK but a bit more laborious – if you want to make sure the schema names are consistent across all tables you have to import/export Data Projects, Project Templates, Data Designer separately.

    Is this a fair summary?

    Best wishes

    Jim

    PS I’m still a bit confused as to the meaning of the ‘Selected database … (reflects table access only)’ settings for both front- and back- ends (in WP Data Access Settings). What do these do?

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jim,

    Sorry for my late reply! Is has been a busy weekend.

    I agree that option 2 looks a bit more laborious. But it looks like I forgot to mention an important detail. If you export a project from the Data Projects page, it exports the full project including all pages and templates. That might make exporting a Data Project less laborious if you only want to transfer one specific Data Project. Sorry I forgot to mention!

    >>> PS I’m still a bit confused as to the meaning of the ‘Selected database … (reflects table access only)’ settings for both front- and back- ends (in WP Data Access Settings). What do these do?

    Interesting question! That should be clear I thought but I see now why it does not.

    Since WP Data Access allows to work with multiple databases, you can change table access settings per database. So the “Table access” section belongs to the “Selected databases” section directly below it. If you change Table access, it is only changed for the selected database. If you want to change the table access for another database, you need to select the database first. How can I change these sections to make them more self explanatory?

    Thanks,
    Peter

    Thread Starter jimhunterabdn

    (@jimhunterabdn)

    Hi Peter

    I take your point about Data Projects.

    With regard to ‘Table access’ I now see what it’s for. Perhaps the wording ‘(reflects table access only)’ could be ‘(containing the tables used in Table Access below)’. Perhaps a bit wordy but …

    Jim

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jim,

    After looking at it again I found a much simpler solution. Instead of writing two separate lines I combined them in one. Thanks for reporting Jim! This is important as it helps to make the plugin more user friendly.

    Thank you so much,
    Peter

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing the Database (Schema)’ is closed to new replies.