• Resolved luarb

    (@luarb)


    Hello , i have a domain and a subdomain , using wordpress platform ,
    My question is :
    how to have 2 separate wordpress installations sharing wp_post table ? they share the same database but different prefix , wp_ and wp2_ ,
    i want them to share only the post table .

Viewing 10 replies - 1 through 10 (of 10 total)
  • No, it is not possible to share the same table wp_post with different prefix wp_ and wp2_. There should be two tables in the DB, wp_post and wp2_post.

    Thread Starter luarb

    (@luarb)

    Than how can i make it possible for them to share the content ?

    Are you installing the 2 wordpress in same host?
    If yes, then you have to create 2 tables with wp and wp2_.

    Thread Starter luarb

    (@luarb)

    Yes 2 wordpress same host ,
    I know that i can have them share same database but different prefix,
    What i want to achieve is both sites have the same content .
    I am trying to define table wp_option to be different on those wordpress and all the other tables to be the same .
    So when i have 2 installations
    sharing the same tables but only option table to be different
    they will have different url and home links.
    The content will be the same and the url different.

    If you are not frequently updating your posts, you can generate SQL dump without wp_option table and restore it to another database. I am not sure the way you are going to use will be successful.

    Thread Starter luarb

    (@luarb)

    Problem is ,
    this is not an optimal solution .
    This is what i am using but its not what i want to do
    for the rest of my “posting”.

    Then you can write a PHP script to dump your tables and then import them to another database and set up a cron to execute it automatically.

    Thread Starter luarb

    (@luarb)

    That is an awesome solution my friend.

    I’m going to use php , ssh and bash to do this .
    What is needed to use ssh in php ?
    So i can use bash scripts to do what i am trying to.

    Practically I never did it but following link may help you:

    https://davidwalsh.name/backup-mysql-database-php

    Thread Starter luarb

    (@luarb)

    Thanks mate.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Is there a way to define the prefix of a single table ?’ is closed to new replies.