Optionally, begin the vfs-site projection branch with a snapshot of the legacy VFS:
emergence-source-http-legacy pull mysite.example.org
# using tree hash output at end of pull command
TREE_HASH=4b825dc642cb6eb9a060e54bf8d69288fbee4904
git commit-tree -m "snapshot mysite.example.org" "${TREE_HASH}"
# using commit hash output at end of commit-tree command
COMMIT_HASH=4b825dc642cb6eb9a060e54bf8d69288fbee4904
git update-ref refs/heads/emergence/vfs-site/v1
Then, project the vfs-site
holobranch and commit it to the same branch:
git holo project emergence-vfs-site --commit-to=emergence/vfs-site/v1
sudo hab pkg install core/python
sudo hab pkg exec core/python pip install httpie httpie-unixsocket
sudo hab pkg binlink core/python http
export SITE_HANDLE="mysitehandle"
# check that CLI works
sudo http \
GET http+unix://%2Femergence%2Fkernel.sock/sites/${SITE_HANDLE}
# null out parent_hostname and parent_key
sudo http \
PATCH http+unix://%2Femergence%2Fkernel.sock/sites/${SITE_HANDLE} \
parent_hostname:=null \
parent_key:=null
in emergence-mysql-shell ${SITE_HANDLE}
:
DELETE FROM _e_files WHERE CollectionID IN (SELECT ID FROM _e_file_collections WHERE Site = "Remote");
DELETE FROM _e_file_collections WHERE Site = "Remote";
Switch site repo to new vfs-site branch:
export SOURCE_NAME="mysourcename"
sudo emergence-git-shell ${SITE_HANDLE} ${SOURCE_NAME}
git fetch --all
git checkout emergence/vfs-site/v1
pwd
exit
Change into that directory and open a PHP shell:
cd "/emergence/sites/${SITE_HANDLE}/site-data/git/${SOURCE_NAME}"
emergence-shell ${SITE_HANDLE}
$collections = array_diff(glob('*'), ['sencha-workspace']);
foreach ($collections as $collection) {
echo "Importing $collection\n\t";
echo http_build_query(Emergence_FS::importTree($collection, $collection));
echo "\n\n";
}
echo NestingBehavior::repairTable(SiteCollection::class, 'PosLeft', 'PosRight')." collections renested\n\n";
Then stop/start PHP to clear all caches and run repair on the VFS, and then stop/start PHP again for good measure