Transfer artifacts from a local instance to a cloud instance

import lamindb as ln

ln.connect("laminlabs/lamin-dev")
 connected lamindb: testuser1/test-transfer-to-cloud
 connected lamindb: laminlabs/lamin-dev
Hide code cell content
def cleanup(artifact: ln.Artifact):
    features_sets = artifact.feature_sets.all()
    experiments = artifact.experiments.all()
    artifact.delete(permanent=True, storage=False)
    features_sets.delete()
    experiments.delete()


artifacts = ln.Artifact.filter(description="test-transfer-to-cloud")
for artifact in artifacts:
    cleanup(artifact)
 a file/folder remains here: /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/.lamindb/DUyUQGH0TBk313Fl0000.parquet
! moved records to trash (branch_id = -1)
! moved records to trash (branch_id = -1)
artifact = ln.Artifact.using("testuser1/test-transfer-to-cloud").get(
    description="test-transfer-to-cloud"
)
artifact.describe()
Artifact .parquet · DataFrame · dataset
├── General
│   ├── description: test-transfer-to-cloud
│   ├── uid: iigBtluzLBnVeABw0000          hash: QAJmQmCCc6r3RI_ces5HcQ
│   ├── size: 1.5 KB                       transform: None
│   ├── space: all                         branch: all
│   ├── created_by: testuser1              created_at: 2025-10-16 13:18:07
│   ├── n_observations: 3
│   └── storage path: /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/iigBtluzLBnVeABw0000
├── Dataset features
│   └── var2                         [bionty.CellMarker]                                                        
PD1                             num                                                                        
CD21                            num                                                                        
└── Labels
    └── .organisms                      bionty.Organism                    human                                   
        .experiments                    wetlab.Experiment                  experiment-test-transfer-to-cloud       
artifact.save(transfer="annotations")
! no run & transform got linked, call `ln.track()` & re-run
 returning schema with same hash: Schema(uid='BkVB2CVLeC3G7Bym', n=2, is_type=False, itype='bionty.CellMarker', dtype='num', hash='ygZEOY-P2mQUntYonTjRVg', minimal_set=True, ordered_set=False, maximal_set=False, branch_id=1, space_id=1, created_by_id=2, created_at=2025-05-03 21:37:21 UTC, is_locked=False)
 mapped: Organism(uid='1dpCL6Td')
 transferred: Artifact(uid='iigBtluzLBnVeABw0000'), Experiment(uid='BRHfwW5l')
Artifact(uid='iigBtluzLBnVeABw0000', is_latest=True, description='test-transfer-to-cloud', suffix='.parquet', kind='dataset', otype='DataFrame', size=1568, hash='QAJmQmCCc6r3RI_ces5HcQ', n_observations=3, branch_id=1, space_id=1, storage_id=3, run_id=178, created_by_id=2, created_at=2025-10-16 13:18:07 UTC, is_locked=False)
artifact.describe()
Artifact .parquet · DataFrame · dataset
├── General
│   ├── description: test-transfer-to-cloud
│   ├── uid: iigBtluzLBnVeABw0000          hash: QAJmQmCCc6r3RI_ces5HcQ
│   ├── size: 1.5 KB                       transform: __lamindb_transfer__/5rYQ1DZky2qU
│   ├── space: all                         branch: main
│   ├── created_by: testuser1              created_at: 2025-10-16 13:18:07
│   ├── n_observations: 3
│   └── storage path: /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/iigBtluzLBnVeABw0000
├── Dataset features
│   └── var2                         [bionty.CellMarker]                                                        
CD21                            num                                                                        
PD1                             num                                                                        
└── Labels
    └── .organisms                      bionty.Organism                    human                                   
        .experiments                    wetlab.Experiment                  experiment-test-transfer-to-cloud       
assert artifact._state.db == "default"
assert artifact.organisms.get().name == "human"
assert artifact.experiments.get().name == "experiment-test-transfer-to-cloud"
assert artifact.features["var"].count() == 2
/tmp/ipykernel_3018/1699649831.py:4: DeprecationWarning: Use slots[slot].members instead of __getitem__, __getitem__ will be removed in the future.
  assert artifact.features["var"].count() == 2
Hide code cell content
!rm -r ./test-transfer-to-cloud
!lamin delete --force test-transfer-to-cloud
 deleting instance testuser1/test-transfer-to-cloud