Skip to content

Commit a8525ac

Browse files
committed
More
1 parent e201ff6 commit a8525ac

9 files changed

+178
-224
lines changed

azure-stack/operator/app-service-migrate-file-server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ If the credentials changed, you must update the file share credentials to connec
103103
1. Launch the **Web Cloud Management Console**.
104104
1. Check the **Web Cloud Management Console -> Web Cloud** screen and verify that both **Controllers** are **Ready**.
105105
1. Select **Credentials**.
106-
1. Next, select the credential you wish to update. In this example, select **FileShareOwnerCrdential** or **FileShareUserCredential** and select edit – either from the menu bar or from the right click context menu.
106+
1. Next, select the credential you wish to update. In this example, select **FileShareOwnerCrdential** or **FileShareUserCredential** and select **Edit** – either from the menu bar or from the right click context menu.
107107
1. Enter the new credential details and then select **OK**.
108108
1. Repeat for **FileShareUserCredential** if that has also changed.
109109
1. Once you complete updating the credentials, you must **restart CN0-VM**.
@@ -115,5 +115,5 @@ If the credentials changed, you must update the file share credentials to connec
115115

116116
## Next steps
117117

118-
- [Backup App Service on Azure Stack Hub](app-service-back-up.md)
118+
- [Back up App Service on Azure Stack Hub](app-service-back-up.md)
119119
- [Restore App Service on Azure Stack Hub](app-service-recover.md)
Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,96 @@
11
---
22
title: Migrate SQL server
3-
description: Document listing how to migrate the Azure App Service on Azure Stack Hub resource provider SQL server.
4-
author: apwestgarth
5-
manager: stefsch
6-
3+
description: Learn how to migrate the Azure App Service on the Azure Stack Hub Resource Provider to SQL server.
4+
author: sethmanheim
75
ms.topic: article
8-
ms.date: 10/25/2022
9-
ms.author: anwestg
10-
ms.reviewer:
11-
ms.lastreviewed:
12-
13-
# Intent: Notdone: As a < type of user >, I want < what? > so that < why? >
14-
# Keyword: Notdone: keyword noun phrase
15-
16-
---
6+
ms.date: 08/12/2024
7+
ms.author: sethm
8+
ms.reviewer: anwestg
179

1810
---
1911

2012
# Migrate SQL server
2113

22-
This article describes how to migrate to new SQL Server infrastructure for hosting the Azure App Service on Azure Stack Hub Resource Provider databases - appservice_hosting and appservice_metrics.
23-
14+
This article describes how to migrate to the SQL Server infrastructure for hosting the Azure App Service on Azure Stack Hub Resource Provider databases, including appservice_hosting and appservice_metrics.
2415

2516
## Back up App Service secrets
26-
When preparing to migrate, you must back up the App Service keys used by the initial deployment.
27-
2817

29-
Use the administration portal to back up app service secrets by following these steps:
18+
When you prepare to migrate, you must back up the App Service keys used by the initial deployment. Use the administrator portal to back up App Service secrets by following these steps:
3019

3120
1. Sign in to the Azure Stack Hub administrator portal as the service admin.
32-
33-
2. Browse to **App Service** -> **Secrets**.
34-
35-
3. Select **Download Secrets**.
21+
1. Browse to **App Service** -> **Secrets**.
22+
1. Select **Download Secrets**.
3623

3724
![Screenshot that shows how to download secrets in Azure Stack Hub administrator portal.](./media/app-service-migrate-sql-server/download-secrets.png)
3825

39-
4. When secrets are ready for downloading, click **Save** and store the App Service secrets (**SystemSecrets.JSON**) file in a safe location.
26+
1. When the secrets are ready for downloading, select **Save** and store the App Service secrets (**SystemSecrets.JSON**) file in a safe location.
4027

4128
![Screenshot that shows how to save secrets in Azure Stack Hub administrator portal.](./media/app-service-migrate-sql-server/save-secrets.png)
4229

4330
## Back up the App Service databases from the current server
4431

32+
To restore App Service, you need the **Appservice_hosting** and **Appservice_metering** database backups. We recommend using SQL Server maintenance plans or Azure Backup Server to ensure these databases are backed up and saved securely regularly. However, you can use any method that ensures regular SQL database backups are created.
4533

46-
To restore App Service, you need the **Appservice_hosting** and **Appservice_metering** database backups. We recommend using SQL Server maintenance plans or Azure Backup Server to ensure these databases are backed up and saved securely regularly. However, any methods of ensuring regular SQL database backups are created can be used.
34+
To manually back up these databases while logged into SQL Server, use the following PowerShell commands:
4735

48-
To manually back up these databases while logged into the SQL Server, use the following PowerShell commands:
49-
50-
```powershell
51-
$s = "<SQL Server computer name>"
52-
$u = "<SQL Server login>"
53-
$p = read-host "Provide the SQL admin password"
54-
sqlcmd -S $s -U $u -P $p -Q "BACKUP DATABASE appservice_hosting TO DISK = '<path>\hosting.bak'"
55-
sqlcmd -S $s -U $u -P $p -Q "BACKUP DATABASE appservice_metering TO DISK = '<path>\metering.bak'"
56-
```
36+
```powershell
37+
$s = "<SQL Server computer name>"
38+
$u = "<SQL Server login>"
39+
$p = read-host "Provide the SQL admin password"
40+
sqlcmd -S $s -U $u -P $p -Q "BACKUP DATABASE appservice_hosting TO DISK = '<path>\hosting.bak'"
41+
sqlcmd -S $s -U $u -P $p -Q "BACKUP DATABASE appservice_metering TO DISK = '<path>\metering.bak'"
42+
```
5743

5844
> [!NOTE]
59-
> If you need to back up SQL AlwaysOn databases, follow [these instructions](/sql/database-engine/availability-groups/windows/configure-backup-on-availability-replicas-sql-server?view=sql-server-2017&preserve-view=true).
45+
> If you need to back up SQL AlwaysOn databases, [follow these instructions](/sql/database-engine/availability-groups/windows/configure-backup-on-availability-replicas-sql-server?view=sql-server-2017&preserve-view=true).
6046
61-
After all databases have been successfully backed up, copy the .bak files to a safe location along with the App Service secrets info.
47+
After you successfully back up all databases, copy the .bak files to a safe location along with the App Service secrets info.
6248

6349
## Restore the App Service databases on a new production ready SQL Server instance
6450

65-
The App Service SQL Server databases should be restored on a production ready SQL Server instance.
51+
The App Service SQL Server databases should be restored on a production-ready SQL Server instance.
6652

67-
After [preparing the SQL Server instance](azure-stack-app-service-before-you-get-started.md#prepare-the-sql-server-instance) to host the App Service databases, use these steps to restore databases from backup:
53+
After you [prepare the SQL Server instance](azure-stack-app-service-before-you-get-started.md#prepare-the-sql-server-instance) to host the App Service databases, use these steps to restore databases from backup:
6854

6955
1. Sign in to the SQL Server that will host the recovered App Service databases with admin permissions.
70-
2. Use the following commands to restore the App Service databases from a command prompt running with admin permissions:
71-
```dos
72-
sqlcmd -U <SQL admin login> -P <SQL admin password> -Q "RESTORE DATABASE appservice_hosting FROM DISK='<full path to backup>' WITH REPLACE"
73-
sqlcmd -U <SQL admin login> -P <SQL admin password> -Q "RESTORE DATABASE appservice_metering FROM DISK='<full path to backup>' WITH REPLACE"
74-
```
75-
3. Verify that both App Service databases have been successfully restored and exit SQL Server Management Studio.
56+
1. Use the following commands to restore the App Service databases from a command prompt running with admin permissions:
57+
58+
```cmd
59+
sqlcmd -U <SQL admin login> -P <SQL admin password> -Q "RESTORE DATABASE appservice_hosting FROM DISK='<full path to backup>' WITH REPLACE"
60+
sqlcmd -U <SQL admin login> -P <SQL admin password> -Q "RESTORE DATABASE appservice_metering FROM DISK='<full path to backup>' WITH REPLACE"
61+
```
62+
63+
1. Verify that both App Service databases were successfully restored, then exit SQL Server Management Studio.
7664

7765
## Migrate the SQL Server
7866

79-
1. In the Azure Stack Hub admin portal, navigate to **Network Security Groups** and view the **ControllersNSG** Network Security Group.
67+
1. In the Azure Stack Hub administrator portal, navigate to **Network Security Groups** and view the **ControllersNSG** Network Security Group.
68+
1. By default, Remote Desktop is disabled for all App Service infrastructure roles. Modify the **Inbound_Rdp_2289** rule action to **Allow** access.
69+
1. Navigate to the resource group containing the App Service Resource Provider deployment. By default, the resource group is named in the format **AppService.\<region\>**.
70+
1. Connect to **CN0-VM**.
71+
1. Open an administrator PowerShell session and run `net stop webfarmservice`.
72+
1. Repeat steps 3 and 4 for all other controllers.
73+
1. Return to the **CN0-VM** Remote Desktop session and copy the secrets file to the controller.
74+
1. In an administrator PowerShell session run:
8075

81-
1. By default, remote desktop is disabled to all App Service infrastructure roles. Modify the **Inbound_Rdp_2289** rule action to **Allow** access.
82-
1. Navigate to the resource group containing the App Service Resource Provider Deployment, by default the resource group is named in with the format, AppService.\<region\> and connect to **CN0-VM**.
83-
1. Open an Administrator PowerShell session and run **net stop webfarmservice**.
76+
```powershell
77+
Restore-AppServiceStamp -FilePath <local secrets file> -OverrideDatabaseServer <new database server> -CoreBackupFilePath <filepath>
78+
```
8479

85-
1. Repeat step 3 and 4 for all other controllers.
86-
1. Return to **CN0-VM**'s RDP session and copy the secrets file to the controller.
80+
1. A prompt appears that confirms the key values. Press **Enter** to continue, or close the PowerShell session to cancel.
81+
1. Once the cmdlet completes, all worker instances from the custom worker tiers are removed, and those instances are added back in the next step.
82+
1. In the same PowerShell session or in a new administrative PowerShell session, run the following PowerShell script. The script inspects all the associated Virtual Machine Scale Sets and performs corresponding actions, including adding back the instances of custom worker tiers:
8783

88-
1. In an Administrator PowerShell session run
89-
```powershell
90-
Restore-AppServiceStamp -FilePath <local secrets file> -OverrideDatabaseServer <new database server> -CoreBackupFilePath <filepath>
91-
```
92-
1. A prompt will appear to confirm the key values, press **Enter** to continue or close the PowerShell session to cancel.
93-
1. Once the cmdlet completes, **all** worker instances from the custom worker tiers will be removed, and those instances will be added back by the next step
94-
1. In the same PowerShell session or a new Administrative PowerShell session, run the following PowerShell script. The script will inspect all the Virtual Machine Scale Sets associated and perform corresponding actions including adding back the instances of custom worker tiers:
9584
```powershell
9685
Restore-AppServiceRoles
9786
```
98-
1. In the same, or a new, administrative PowerShell session, run the command **net start webfarmservice**.
87+
88+
1. In the same, or in a new administrative PowerShell session, run the command `net start webfarmservice`.
9989
1. Repeat the previous step for all other controllers.
100-
1. In the Azure Stack admin portal, navigate back to the **ControllersNSG** Network Security Group
90+
1. In the Azure Stack administrator portal, navigate back to the **ControllersNSG** Network Security Group.
10191
1. Modify the **Inbound_Rdp_3389** rule to deny access.
10292

10393
## Next steps
94+
10495
[Backup App Service on Azure Stack Hub](app-service-back-up.md)
105-
[Restore App Service on Azure Stack Hub](app-service-recover.md)
96+
[Restore App Service on Azure Stack Hub](app-service-recover.md)

0 commit comments

Comments
 (0)