diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index d9e4a7eab..c24cb58b5 100644
--- src/bp-core/bp-core-functions.php
+++ src/bp-core/bp-core-functions.php
@@ -70,6 +70,62 @@ function bp_db_version_raw() {
 		return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
 	}
 
+/**
+ * Output a BuddyPress major version.
+ *
+ * @since 11.0.0
+ *
+ * @param string $version BuddyPress version.
+ */
+function bp_major_version( $version = '' ) {
+	echo bp_get_major_version( $version );
+}
+
+	/**
+	 * Return a BuddyPress major version.
+	 *
+	 * @since 11.0.0
+	 *
+	 * @param string $version BuddyPress version.
+	 * @return string The corresponding BuddyPress major version.
+	 */
+	function bp_get_major_version( $version = '' ) {
+		if ( ! $version ) {
+			$version = bp_get_version();
+		}
+
+		$last_wp_like_major_versions = '2.9';
+		$float_version               = (float) $version;
+
+		if ( 1 !== version_compare( $version, $last_wp_like_major_versions ) ) {
+			$major_version = (string) $float_version;
+		} else {
+			$major_version = (int) $float_version . '.0';
+		}
+
+		return $major_version;
+	}
+
+/**
+ * Output the BuddyPress version used for its first install.
+ *
+ * @since 11.0.0
+ */
+function bp_initial_version() {
+	echo bp_get_initial_version();
+}
+
+	/**
+	 * Return the BuddyPress version used for its first install.
+	 *
+	 * @since 11.0.0
+	 *
+	 * @return string The BuddyPress version used for its first install.
+	 */
+	function bp_get_initial_version() {
+		return bp_get_option( '_bp_initial_major_version', '0' );
+	}
+
 /**
  * Check whether the current version of WP exceeds a given version.
  *
@@ -4674,3 +4730,102 @@ function bp_delete_optout_by_id( $id = 0 ) {
 	$optout_class = new BP_Optout();
 	return $optout_class::delete_by_id( $id );
 }
+
+/**
+ * Get the list of versions needing their deprecated functions to be loaded.
+ *
+ * @since 11.0.0
+ *
+ * @return array The list of versions needing their deprecated functions to be loaded.
+ */
+function bp_get_deprecated_functions_versions() {
+	$ignore_deprecated = null;
+	if ( defined( 'BP_IGNORE_DEPRECATED' ) ) {
+		$ignore_deprecated = (bool) BP_IGNORE_DEPRECATED;
+	}
+
+	/*
+	 * Respect the site owner's choice to ignore deprecated functions.
+	 * Return an empty array to inform no deprecated version files should be loaded.
+	 */
+	if ( true === $ignore_deprecated ) {
+		return array();
+	}
+
+	// List of versions containing deprecated functions.
+	$deprecated_functions_versions = array(
+		'1.2',
+		'1.5',
+		'1.6',
+		'1.7',
+		'1.9',
+		'2.0',
+		'2.1',
+		'2.2',
+		'2.3',
+		'2.4',
+		'2.5',
+		'2.6',
+		'2.7',
+		'2.8',
+		'2.9',
+		'3.0',
+		'4.0',
+		'6.0',
+		'7.0',
+		'8.0',
+		'9.0',
+		'10.0',
+	);
+
+	/*
+	 * Respect the site owner's choice to load all deprecated functions.
+	 * Return an empty array to inform no deprecated version files should be loaded.
+	 */
+	if ( false === $ignore_deprecated ) {
+		return $deprecated_functions_versions;
+	}
+
+	/*
+	 * If the constant is not defined, put our logic in place so that only the
+	 * 2 last versions deprecated functions will be loaded for upgraded installs.
+	 */
+	$initial_version        = (float) bp_get_initial_version();
+	$current_version        = (float) bp_get_version();
+	$load_latest_deprecated = $initial_version < $current_version;
+
+	// We don't load deprecated functions for new installs.
+	if ( ! $load_latest_deprecated ) {
+		// Run some additional checks if PHPUnit is running.
+		if ( defined( 'BP_TESTS_DIR' ) ) {
+			$deprecated_files = array_filter(
+				array_map(
+					function( $file ) {
+						if ( false !== strpos( $file, '.php' ) ) {
+							return str_replace( '.php', '', $file );
+						};
+					},
+					scandir( buddypress()->plugin_dir . 'bp-core/deprecated' )
+				)
+			);
+
+			if ( array_diff( $deprecated_files, $deprecated_functions_versions ) ) {
+				return false;
+			}
+		}
+		return array();
+	}
+
+	$index_initial_version = array_search( $initial_version, $deprecated_functions_versions );
+	if ( false === $index_initial_version ) {
+		return array_splice( $deprecated_functions_versions, -2 );
+	}
+
+	$latest_deprecated_functions_versions = array_splice( $deprecated_functions_versions, $index_initial_version );
+
+	if ( 2 <= count( $latest_deprecated_functions_versions ) ) {
+		$latest_deprecated_functions_versions = array_splice( $latest_deprecated_functions_versions, -2 );
+	}
+
+	return $latest_deprecated_functions_versions;
+}
diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php
index 2651cc0c6..357f95614 100644
--- src/bp-core/bp-core-update.php
+++ src/bp-core/bp-core-update.php
@@ -205,6 +205,8 @@ function bp_version_updater() {
 
 	// Install BP schema and activate only Activity and XProfile.
 	if ( bp_is_install() ) {
+		// Set the first BP major version the plugin was installed.
+		bp_update_option( '_bp_initial_major_version', bp_get_major_version() );
 
 		// Apply schema and set Activity and XProfile components as active.
 		bp_core_install( $default_components );
@@ -761,6 +763,7 @@ function bp_core_get_10_0_upgrade_email_schema( $emails ) {
  * @since 11.0.0
  */
 function bp_update_to_11_0() {
+	bp_delete_option( '_bp_ignore_deprecated_code' );
 
 	add_filter( 'bp_email_get_schema', 'bp_core_get_11_0_upgrade_email_schema' );
 
diff --git src/class-buddypress.php src/class-buddypress.php
index b291d956e..e41be0cfd 100644
--- src/class-buddypress.php
+++ src/class-buddypress.php
@@ -463,6 +463,15 @@ class BuddyPress {
 		 * @param string $value Email type taxonomy slug.
 		 */
 		$this->email_taxonomy_type = apply_filters( 'bp_email_tax_type', 'bp-email-type' );
+
+		/**
+		 * Are PHPUnit tests running?
+		 *
+		 * @since 11.0.0
+		 *
+		 * @param bool $value True if PHPUnit tests are running, false otherwise.
+		 */
+		$this->is_phpunit_running = function_exists( 'tests_add_filter' );
 	}
 
 	/**
@@ -484,11 +493,6 @@ class BuddyPress {
 		if ( ! defined( 'BP_DB_VERSION' ) ) {
 			define( 'BP_DB_VERSION', $this->db_version );
 		}
-
-		// Define if deprecated functions should be ignored.
-		if ( ! defined( 'BP_IGNORE_DEPRECATED' ) ) {
-			define( 'BP_IGNORE_DEPRECATED', true );
-		}
 	}
 
 	/**
@@ -535,30 +539,17 @@ class BuddyPress {
 		require $this->plugin_dir . 'bp-core/bp-core-rest-api.php';
 		require $this->plugin_dir . 'bp-core/bp-core-blocks.php';
 
-		// Maybe load deprecated functionality (this double negative is proof positive!).
-		if ( ! bp_get_option( '_bp_ignore_deprecated_code', ! $this->load_deprecated ) ) {
-			require $this->plugin_dir . 'bp-core/deprecated/1.2.php';
-			require $this->plugin_dir . 'bp-core/deprecated/1.5.php';
-			require $this->plugin_dir . 'bp-core/deprecated/1.6.php';
-			require $this->plugin_dir . 'bp-core/deprecated/1.7.php';
-			require $this->plugin_dir . 'bp-core/deprecated/1.9.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.1.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.2.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.3.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.4.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.5.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.6.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.7.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.8.php';
-			require $this->plugin_dir . 'bp-core/deprecated/2.9.php';
-			require $this->plugin_dir . 'bp-core/deprecated/3.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/4.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/6.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/7.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/8.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/9.0.php';
-			require $this->plugin_dir . 'bp-core/deprecated/10.0.php';
+		// Get the list of versions needing their deprecated functions to be loaded.
+		$deprecated_functions_versions = bp_get_deprecated_functions_versions();
+
+		// Maybe load deprecated functionality.
+		if ( $deprecated_functions_versions && ! $this->is_phpunit_running ) {
+			$this->load_deprecated = true;
+
+			foreach ( $deprecated_functions_versions as $deprecated_functions_version ) {
+				// Load all or last 2 deprecated versions.
+				require $this->plugin_dir . sprintf( 'bp-core/deprecated/%s.php', $deprecated_functions_version );
+			}
 		}
 
 		// Load wp-cli module if PHP 5.6+.
@@ -719,7 +710,7 @@ class BuddyPress {
 		if (
 			! in_array( $component, array( 'core', 'members' ), true ) &&
 			! bp_is_active( $component ) &&
-			! function_exists( 'tests_add_filter' )
+			! $this->is_phpunit_running
 		) {
 			return;
 		}
diff --git tests/phpunit/testcases/core/functions.php tests/phpunit/testcases/core/functions.php
index f3c20c1d8..5be246ffd 100644
--- tests/phpunit/testcases/core/functions.php
+++ tests/phpunit/testcases/core/functions.php
@@ -5,6 +5,8 @@
  */
 
 class BP_Tests_Core_Functions extends BP_UnitTestCase {
+	protected $bp_initial_version;
+
 	/**
 	 * @group bp_esc_sql_order
 	 */
@@ -875,4 +877,41 @@ class BP_Tests_Core_Functions extends BP_UnitTestCase {
 	public function add_newcomponent_page_title( $page_default_titles = array() ) {
 		return array_merge( $page_default_titles, array( 'newcomponent' => 'NewComponent' ) );
 	}
+
+	public function override_initial_version() {
+		return $this->bp_initial_version;
+	}
+
+	/**
+	 * @ticket BP8687
+	 */
+	public function test_bp_get_deprecated_functions_versions() {
+		$current_version = (float) bp_get_version();
+		$versions        = bp_get_deprecated_functions_versions();
+
+		// When current version is the initial version, we shouldn't load deprecated functions files.
+		$this->assertTrue( is_array( $versions ) && ! $versions, 'Please check the list of `$deprecated_functions_versions` in `bp_get_deprecated_functions_versions()`. There should be one for each file of the `/src/bp-core/deprecated` directory.' );
+
+		// We should load the 2 lasts deprecated functions files.
+		$this->bp_initial_version = '8.0';
+
+		add_filter( 'pre_option__bp_initial_major_version', array( $this, 'override_initial_version' ), 10, 0 );
+
+		$versions = bp_get_deprecated_functions_versions();
+
+		remove_filter( 'pre_option__bp_initial_major_version', array( $this, 'override_initial_version' ), 10, 0 );
+
+		$this->assertTrue( 2 === count( $versions ) );
+
+		// Even if this version does not exist in deprecated functions files, we should load the 2 lasts.
+		$this->bp_initial_version = '1.0';
+
+		add_filter( 'pre_option__bp_initial_major_version', array( $this, 'override_initial_version' ), 10, 0 );
+
+		$versions = bp_get_deprecated_functions_versions();
+
+		remove_filter( 'pre_option__bp_initial_major_version', array( $this, 'override_initial_version' ), 10, 0 );
+
+		$this->assertTrue( 2 === count( $versions ) );
+	}
 }
