Okay
  Public Ticket #3229096
Automate creation of wpdata tables.
Closed

Comments

  • Tiago started the conversation

    Hello,

    I the same tables connected to csv files on every website I create. Having to create the tables manually every single time is taking too much time. Is there a way to automate the creation of tables after installing wpdatatable on my new wp instance? That would help out a lot. If anyone has any suggestions I'd appreciate it. 

  •  1,708
    Miloš replied

    Hi, TDM 

    Sorry for the delayed response, we had a break over the weekend.

    -

    When you move your wpDataTables installation and you wish to migrate all tables and settings without having to recreate everything, there are two ways :

    1. When you are moving on live site from local or stage site (or vice-versa) we can suggest using Plugin Duplicator.

     We use it and it's working fine because it will transfer all the files and also the tables to the database. 

    2. Other than cloning the site, another option would be to copy all database tables manually (wp_wpdatatable_#) along with tables wp_wpdatatables, wp_wpdatacharts, wp_wpdatatables_rows and wp_wpdatatables_columns. 

    Then, in wp_options table, you would also need to export the following option_names:

    • wdtPreventDeletingTables
    • wdtUseSeparateCon
    • wdtSeparateCon
    • wdtTimepickerRange
    • wdtTimeFormat
    • wdtTabletWidth
    • wdtTablesPerPage
    • wdtSumFunctionsLabel
    • wdtRenderFilter
    • wdtRenderCharts
    • wdtIncludeBootstrap
    • wdtIncludeBootstrapBackEnd
    • wdtPreventDeletingTables
    • wdtParseShortcodes
    • wdtNumbersAlign
    • wdtBorderRemoval
    • wdtBorderRemovalHeader
    • wdtNumberFormat
    • wdtMobileWidth
    • wdtMinifiedJs
    • wdtMinFunctionsLabel
    • wdtMaxFunctionsLabel
    • wdtLeftOffset
    • wdtTopOffset
    • wdtInterfaceLanguage
    • wdtGeneratedTablesCount
    • wdtFontColorSettings
    • wdtDecimalPlaces
    • wdtCSVDelimiter
    • wdtDateFormat
    • wdtCustomJs
    • wdtCustomCss
    • wdtBaseSkin
    • wdtAvgFunctionsLabel
    • wdtInstallDate
    • wdtRatingDiv
    • wdtMDNewsDiv
    • wdtTempFutureDate

    It is rather cumbersome to do all this, but unfortunately, at the moment, it's the only way. 

    Important to note, for tables linked to an existing data source, 

    you would need to change the file path,

     because at the moment the file path depends on the domain, so if you change the domain, the URL to the file will also have to be changed.

    Here are the instructions on how to change the URL path on the new site/new database,

    for all tables linked to existing file, such as Excel or CSV.

    You can create a new table linked to an Excel file, and it should generate just fine. 

    Once you do that, access your database, and open wp_wpdatatables database table.

    In the "content" column, you will see the path related to the new table. So, if the new file is stored in (for example):

    /var/www/html/your-NEW-site/wp-content/uploads/2021/02/file-one.xls

    And your old files are in:

    /var/www/html/your-OLD-site/wp-content/uploads/2021/02/file-two.xls

    You need to modify the content column for each row, and replace the path.

    To do that, you can run this SQL Query in your new database via any Database Management Tool, such as PHPMyAdmin:

    UPDATE `wp_wpdatatables` SET content=REPLACE(content,'this_part','that_part')
    

    Please bear in mind that wp_ is the default prefix of WordPress, 

    but on your site it could be anything, so you should run `your_prefix_wpdatatables` and actually replace the part of the path in "this_part" and "that_part" sections.

    We will be here to help you with that, if you encounter issues.

    Our developers will be working on adding an easier solution to export everything, but we can't say an ETA on this.

    -

    Let me know if you have any questions. Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables