How to limit sources for Entries field set up via migration
After getting some feedback from Craft support it turns out one has to use uid instead of id for this to work:

"sources" =&gt; ["section:" . $questionsSection-&gt;uid],


Since I had a lot of places in my migration where I needed to specify sources, I included a couple small functions:

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

protected function _section_id($sectionHandle)
{
    return Craft::$app-&gt;sections-&gt;getSectionByHandle($sectionHandle)-&gt;uid;

} // _section_id()

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

protected function _source($handle, $kind = 'section')
{
    $source = $kind . ':' . $this-&gt;_section_id($handle);
    return $source;

} // _source()

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */


You can then limit the entries field sources like so:

"source" =&gt; null,
"sources" =&gt; [
    $this-&gt;_source("sectionA"),
    $this-&gt;_source("sectionB"),
],


(Note that I'm additionally setting "source" =&gt; null as per a plugin-created migration I analyzed, but not sure if it's required.)