• [ Moderator note: moved to Fixing WordPress. ]

    hello all –

    we have a need to have a second WP site where the content from one of the pages is duplicated (or mirrored) on another WP site with a totally different theme and URL.

    both sites are on the same server.

    i am thinking something like a mysqldump command that targets a specific table and maybe the results are fed right into an sql statement reloading the same table. all of this would be a bash script ran every five minutes via crontab. (yes this is pure linux).

    any thoughts on this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • We’ve done this frequently with one of two methods:

    1) ManageWP.com is a great resource to use, because you can clone any content from one site to another and then, whenever you publish new content, push it out to ALL sites in one action

    2) WordPress multisite. I used to recommend this and install it frequently for my franchise clients, but not as much any more. It has the advantage if you want to control all the sites yourself, but a lot of overhead (including having one shared database).

    Both of these solutions can be implemented pretty quickly, but I would recommend ManageWP as your first choice.

    Cheers!
    spence

    Thread Starter edwardsmark

    (@edwardsmark)

    thanks spencer – i use mu-wp quite a bit and find it to be awesome. ManageWP looks interesting but i am looking for something free.

    so, i am considering something like this now inside a php script:

    mysql –host=123.123.123.123 –username=mark –password=hello wordpressDB;
    SELECT post_excerpt “NEW CONTENT”
    FROM wp_posts
    WHERE post_title = “this is the original post”;

    mysql –host=localhost –user=spencer –password=forman nextWpDB;
    UPDATE wp_posts
    SET port_excerpt = “NEW CONTENT stuff from first command”
    WHERE post_title = “this post is cloned from another website”;

    i added a new page, mysqldumped it, modified it, mysqldumped it again, and diffed the results.

    It all works well as long as you’re only dealing with posts and not users. As soon as you have any logged-in users with posts, post_meta data or comments…it all gets complicated.

    If you only want to deal with content, I would suggest it’s quite easy to just export an .xml of the data from site one and import it to site two.

    ManageWP is just a couple bucks a month btw, so it seems to me it would be a good savings of time for small amount of money (2 cents).

    Cheers!
    spence

    Thread Starter edwardsmark

    (@edwardsmark)

    mysql –host=123.123.123.123 –username=mark –password=hello wordpressDB;
    SELECT post_excerpt “NEW_CONTENT”
    FROM wp_posts
    WHERE post_title = “this is the original post”
    AND post_status = ‘published’
    ;

    $newStuff = :NEW_CONTENT ; // pdo

    mysql –host=localhost –user=spencer –password=forman nextWpDB;
    UPDATE wp_posts
    SET port_excerpt = :NEW_CONTENT
    WHERE post_title = “this post is cloned from another website”
    AND post_status = ‘published’
    ;

    Thread Starter edwardsmark

    (@edwardsmark)

    ok i have to give this one to Spencer. it appears that giving the post a unique category name, and doing the XML export-import is far superior.

    and then maybe use command-line to extract the XML might be the best way to go.

    There is a built-in import tool for WordPress right in the Tools/Import section of the dash… it will do the extraction for you ??

    It installs this plugin: https://www.ads-software.com/plugins/wordpress-importer/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘mirroring WP content on another WP site’ is closed to new replies.