-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PE-40371) Add migration plan for standard architecture
This commit adds a migration plan which utilises backup, install and restore plans to install and restore PE on new infrastructure with a standard architecture. This commit also introduces a new 'migration' option for backup and restore plans, enabling a new migration plan.
- Loading branch information
petergmurphy
committed
Feb 24, 2025
1 parent
e5f627c
commit 3544a79
Showing
5 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
plan peadm::migrate ( | ||
Peadm::SingleTargetSpec $old_primary_host, | ||
Peadm::SingleTargetSpec $new_primary_host, | ||
) { | ||
peadm::assert_supported_bolt_version() | ||
|
||
$backup_file = run_plan('peadm::backup', $old_primary_host, { | ||
backup_type => 'migration', | ||
}) | ||
|
||
download_file($backup_file['path'], 'backup', $old_primary_host) | ||
|
||
$backup_filename = basename($backup_file['path']) | ||
$remote_backup_path = "/tmp/${backup_filename}" | ||
$current_dir = system::env('PWD') | ||
|
||
upload_file("${current_dir}/downloads/backup/${old_primary_host}/${backup_filename}", $remote_backup_path, $new_primary_host) | ||
|
||
$old_primary_target = get_targets($old_primary_host)[0] | ||
$old_primary_password = peadm::get_pe_conf($old_primary_target)['console_admin_password'] | ||
$old_pe_conf = run_task('peadm::get_peadm_config', $old_primary_target).first.value | ||
|
||
run_plan('peadm::install', { | ||
primary_host => $new_primary_host, | ||
console_password => $old_primary_password, | ||
code_manager_auto_configure => true, | ||
download_mode => 'direct', | ||
version => $old_pe_conf['pe_version'], | ||
}) | ||
|
||
run_plan('peadm::restore', { | ||
targets => $new_primary_host, | ||
restore_type => 'migration', | ||
input_file => $remote_backup_path, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters