Using PowerShell, connect to the primary replica and run the following commands

Import-Module SQLPS

$DatabaseBackupFile = “\\server\shared_folder\<database_name>.bak”
$LogBackupFile = “\\server\shared_folder\<database_name>.trn”
$MyAgPrimaryPath = “SQLSERVER:\SQL\InstanceSQL1\AvailabilityGroups\availability_group_name”
$MyAgSecondaryPath = “SQLSERVER:\SQL\InstanceSQL2\AvailabilityGroups\availability_group_name”

Backup-SqlDatabase -Database “<database_name>” -BackupFile $DatabaseBackupFile -ServerInstance “InstanceSQL1”
Backup-SqlDatabase -Database “<database_name>” -BackupFile $LogBackupFile -ServerInstance “InstanceSQL1” -BackupAction ‘Log’

Restore-SqlDatabase -Database “<database_name>” -BackupFile $DatabaseBackupFile -ServerInstance “InstanceSQL2” -NoRecovery
Restore-SqlDatabase -Database “<database_name>” -BackupFile $LogBackupFile -ServerInstance “InstanceSQL2” -RestoreAction ‘Log’ -NoRecovery

Add-SqlAvailabilityDatabase -Path $MyAgPrimaryPath -Database “<database_name>”
Add-SqlAvailabilityDatabase -Path $MyAgSecondaryPath -Database “<database_name>”