.. _getting_started_ref: Getting started with Openstack Migrate ====================================== .. include:: ../how-to/install.rst Configuration ------------- ``openstack-migrate`` receives a YAML configuration file that defines: * the source and destination cloud * credentials used to identify and migrate resources * internal Sqlite database location * timeouts * whether to preserve certain resource properties (e.g. volume types, availability zones, network segmentation IDs, MAC addresses, etc) * multi-tenant mode See the :ref:`configuration reference` for the full list of ``openstack-migrate`` options. Let's define a minimal configuration file: .. code-block:: bash export OPENSTACK_MIGRATE_CONFIG=~/migrate-config.yaml cat > $OPENSTACK_MIGRATE_CONFIG < /home/ubuntu/cloud-config.yaml <`. Batch migrations ---------------- ``openstack-migrate`` can also move a group of resources that match a given filter. The following command migrates all the images of a given project. We'll do a dry run first: .. code-block:: none openstack-migrate start-batch \ --resource-type=image \ --filter "project-id:609c48d29a1b483cb2d8a75bc84abdf7" \ --dry-run 2025-12-16 14:14:17,851 INFO DRY-RUN: image migration, resource id: f02d3b07-7008-486d-b298-a08b1b1f3e2e, cleanup source: False 2025-12-16 14:14:17,852 INFO DRY-RUN: image migration, resource id: 19da365c-ddb4-432c-92f2-60b966d347fe, cleanup source: False 2025-12-16 14:14:17,853 INFO DRY-RUN: image migration, resource id: 5f7f24cc-b700-4195-80af-50e61adff91d, cleanup source: False Now without the ``--dry-run`` flag: .. code-block:: none openstack-migrate start-batch \ --resource-type=image \ --filter "project-id:609c48d29a1b483cb2d8a75bc84abdf7" 2025-12-16 14:15:01,646 INFO Initiating image migration, resource id: f02d3b07-7008-486d-b298-a08b1b1f3e2e 2025-12-16 14:15:05,329 INFO Successfully migrated image resource, destination id: 93df67bc-fb7a-4bfa-89a7-3dbfa859472e 2025-12-16 14:15:05,334 INFO Initiating image migration, resource id: 19da365c-ddb4-432c-92f2-60b966d347fe 2025-12-16 14:15:08,354 INFO Successfully migrated image resource, destination id: 44659c49-36cd-4ea9-863e-e39916370be0 2025-12-16 14:15:08,360 INFO Initiating image migration, resource id: 5f7f24cc-b700-4195-80af-50e61adff91d 2025-12-16 14:15:17,138 INFO Successfully migrated image resource, destination id: e1a526cf-1ac5-4532-a5f8-1069ea585c22 If we repeat the command, already migrated resources will be skipped: .. code-block:: none openstack-migrate start-batch \ --resource-type=image \ --filter "project-id:609c48d29a1b483cb2d8a75bc84abdf7" 2025-12-16 14:20:43,414 INFO Resource already migrated, skipping: f02d3b07-7008-486d-b298-a08b1b1f3e2e. Migration: 7d3449c3-a542-48d7-ab99-0649dd066976. 2025-12-16 14:20:43,415 INFO Resource already migrated, skipping: 19da365c-ddb4-432c-92f2-60b966d347fe. Migration: 3928df33-1d65-4082-9429-7719a37de051. 2025-12-16 14:20:43,415 INFO Resource already migrated, skipping: 5f7f24cc-b700-4195-80af-50e61adff91d. Migration: 0209b968-10ae-4770-ac6e-6c454fb4323f. .. include:: ../how-to/operations/list.rst Cleaning up migrations ---------------------- .. _cleanup_source_command: Migrated resources are removed from the source cloud automatically if the ``--cleanup-source`` flag is specified. Alternatively, users may want to remove the original resources at a later time, after validating the migrations on the destination cloud. Use the ``cleanup-source`` command like so: .. code-block:: none openstack-migrate cleanup-source --resource-type=image 2025-12-16 14:33:32,897 INFO Migration succeeded, cleaning up source image: 5f7f24cc-b700-4195-80af-50e61adff91d 2025-12-16 14:33:34,575 INFO Migration succeeded, cleaning up source image: 19da365c-ddb4-432c-92f2-60b966d347fe 2025-12-16 14:33:35,539 INFO Migration succeeded, cleaning up source image: f02d3b07-7008-486d-b298-a08b1b1f3e2e 2025-12-16 14:33:36,527 INFO Migration succeeded, cleaning up source image: 5199e62b-4dac-4a9d-b8b2-7b616e270ea6 This removes all the source images that have been successfully migrated. Note that it also allows filtering by resource id or service type. .. code-block:: none openstack-migrate cleanup-source -h Usage: openstack-migrate cleanup-source [OPTIONS] Cleanup the source after successful migrations. Receives optional filters that specify which resources to clean up. Options: --service TEXT Filter by service name --resource-type TEXT Filter by resource type --source-id TEXT Filter by source resource id. --all Cleanup all succeeded migrations. --dry-run Dry run: only log the resources to be deleted. -h, --help Show this message and exit. .. include:: ../how-to/operations/capabilities.rst .. include:: ../how-to/operations/external-migrations.rst