using https://github.com/newren/git-filter-repo
mkdir import_tmp; cd import_tmp
wget https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo # get the code
git clone https://github.com/fortio/fortio # the source repo
cd fortio/
python3 ../git-filter-repo --path fhttp --path fgrpc --path-rename 'fhttp:legacy/fhttp' --path-rename 'fgrpc:legacy/fgrpc'
ls legacy # works!