WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Where is Multisite data? (3 posts)

  1. fredericch
    Member
    Posted 1 year ago #

    A bug in the program caused me to lose one of my websites. I would like to use Time Machine to restore to a previous state, but where is the actual multisite data file? If I restore that file, will all my website be restored, or are there multiple files that i need to restore?

  2. soniabhardwaj
    Member
    Posted 1 year ago #

    As you know the main deference between developing a single WordPress plugin vs. a multisite plugin is where data is written. According to this article since plugins normally have complete reign over one database, and in some cases the plugins local pages files you must be sure to only call the $wpdb global object instead of a hard-coded reference to a table.

    For example, if you need to execute an SQL command on the posts table, then do not use wp_posts as the table name $post_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM wp_posts"));

    use this

    $post_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts"));

    [signature moderated]

  3. fredericch - Same place WordPress Single Site is stored.

    Files are on your server, and house your themes, your plugins, and your uploaded media.

    SQL Database houses your post contents, site settings, users, etc.

Topic Closed

This topic has been closed to new replies.

About this Topic